query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
sequencelengths 0
101
| negative_scores
sequencelengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
POST /tweets POST /tweets.json | def create
@tweet = Tweet.new(tweet_params)
@tweet.user_vote = 0
respond_to do |format|
if @tweet.save
format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }
format.json { render :show, status: :created, location: @tweet }
else
format.html { render :new }
format.json { render json: @tweet.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n user = user_from_token\n @tweet = user.tweets.new()\n @tweet.tweet = params[:tweet]\n if @tweet.save\n render :json => @tweet, :status => :created\n else\n render :json => @tweet.errors, :status => :unprocessable_entity\n end\n end",
"def create\n @tweet = current_user.tweets.create(params[:tweet])\n respond_with(@tweet, :location => tweet_url(@tweet))\n end",
"def create\n @tweet = @user.tweets.build(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to user_tweet_path(@user, @tweet), notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: user_tweet_path(@user, @tweet) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet_from_api\n @tweet_api = User.find(2).tweets.create(tweet_params)\n render json: @tweet_api\n end",
"def create\n @user = User.find(params[:user_id])\n @tweet = @user.tweets.create(tweet_params)\n redirect_to user_tweets_path\n end",
"def create\n @tweet = Tweet.new(tweet_params)\n if @tweet.username == nil\n # This is for the current user posting tweets\n @tweet.username = current_user.name\n @tweet.user_id = current_user.id\n # Updates to Twitter\n current_user.twitter.update(@tweet.tweetbody)\n else \n # Incoming tweets from the daemon script\n @tweet.save\n end\n respond_with(@tweet)\n end",
"def create\n @tweet = Tweet.new(tweet_params)\n \n respond_to do |format|\n if @tweet.save\n format.html { redirect_to tweets_path, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = current_user.tweets.build(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet(tweet_body)\n encoded_url = url_encode \"#{@handle}/#{@password}/#{tweet_body}\"\n HTTParty.post(\"#{@api_path}/tweets/new/#{encoded_url}\")\n end",
"def create\n @tweet = Tweet.new(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = Tweet.new(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tputs params[:post_now]\n\t\tif params[:post_now] == \"1\"\n\t\t\tclient = Twitter::REST::Client.new do |config|\n\t\t\t\tconfig.consumer_key = TWITTER_API_KEY\n\t\t\t\tconfig.consumer_secret = TWITTER_API_SECRECT\n\t\t\t\tconfig.access_token = current_user.access_token\n\t\t\t\tconfig.access_token_secret = current_user.access_token_secret\n\t\t\tend\n\t\t\tcontent = params[:tweet][:content]\n\t\tend\n\t\t@tweet = current_user.tweets.build(tweet_params)\n\t\trespond_to do |format|\n\t\t\tif @tweet.save\n\t\t\t\tif client.update(\"#{content}\")\n\t\t\t\t\tputs @tweet.update(tweeted: true)\n\t\t\t\t\tflash[:notice] = \"Successfully posted \" \n\t\t\t\telse\n\t\t\t\t\tflash[:notice] = \"not updated \" \n\t\t\t\tend\n\t\t\t\tformat.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @tweet }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @tweet.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n respond_to do |format|\n begin\n @tweet = TweetApp::ClientContext.status(:post, params[:text])\n flash[:notice] = 'Tweet was successfully created.'\n format.html { redirect_to tweet_url(@tweet) }\n format.json { head :created, :location => tweet_url(@tweet) }\n format.xml { head :created, :location => tweet_url(@tweet) }\n rescue Twitter::RESTError => re\n handle_rest_error(re, format, 'new')\n end\n end\n end",
"def tweets\n user = User.find(params[:id])\n render json: user.list_tweets, status: :ok\n end",
"def post_tweet\n # @tweets << tweet: violates SST\n Tweet.new('tweet message', self)\n end",
"def create_twit(twit)\n RestClient.post configuration.base_url + '/twits',\n { twit: twit }.to_json,\n content_type: :json,\n accept: :json\n end",
"def create\n @tweett = Tweett.new(tweett_params)\n\n respond_to do |format|\n if @tweett.save\n format.html { redirect_to @tweett, notice: 'Tweett was successfully created.' }\n format.json { render :show, status: :created, location: @tweett }\n else\n format.html { render :new }\n format.json { render json: @tweett.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = Tweet.new(tweet_params.merge(user: current_user))\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: \"Tweet was successfully created.\" }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = Tweet.create(:user_id => current_user.id, :text => tweet_params[:text])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = current_user.tweets.new tweet_params\n\n if current_user\n @tweet.user_id = current_user.id\n end\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: \"Tweet was successfully created.\" }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n begin \n new_tweet = Tweet.new(tweet_params)\n if new_tweet.save()\n render(status: 201, json: {tweet: new_tweet})\n else # if validation fails\n render(status: 422, json: {error: new_tweet.errors})\n end\n rescue => error\n render(status: 500, json: {error: \"Internal Server Error: #{error.message}\"})\n end\n end",
"def create\r\n @tweet = Tweet.new(tweet_params)\r\n @tweet.user = current_user\r\n \r\n respond_to do |format|\r\n if @tweet.save\r\n format.html { redirect_to @tweet, notice: \"Tweet was successfully created.\" }\r\n format.json { render :show, status: :created, location: @tweet }\r\n else\r\n format.html { render :new, status: :unprocessable_entity }\r\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @tweet = current_user.tweets.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_back fallback_location: root_path, notice: 'ツーイトの投稿が完了しました。' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @new_tweet = NewTweet.new(new_tweet_params)\n\n respond_to do |format|\n if @new_tweet.save\n format.html { redirect_to @new_tweet, notice: 'New tweet was successfully created.' }\n format.json { render :show, status: :created, location: @new_tweet }\n else\n format.html { render :new }\n format.json { render json: @new_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = Tweet.new(tweet_params)\n\n if @tweet.save\n render :show, status: :created, location: { tweet: @tweet }\n else\n render json: @tweet.errors, status: :unprocessable_entity\n end\n end",
"def create\n @tweet = Tweet.new(tweet_params)\n @tweet.user = current_user\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: \"Tweet creado felizmente.\" }\n format.json { redirect_to root_path, status: :created, location: @tweet }\n else\n format.html { redirect_to root_path, notice: \"No se puede tuitear nada.\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = current_user.tweets.build(tweet_params)\n\n #respond_to do |format|\n if @tweet.save\n flash[:success] = 'ツイートを投稿しました。'\n redirect_to tweets_path\n #format.html { redirect_to @tweet }\n #format.json { render :show, status: :created, location: @tweet }\n else\n @tweets = current_user.feed_tweets.order(id: :desc).page(params[:page])\n flash.now[:danger] = 'ツイートを投稿できませんでした。'\n render 'tweets/index'\n #format.html { render :new }\n #format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end",
"def tweet_params\n params.require(:tweet).permit(:tweet)\n end",
"def create\n # Use current_user below, so that new tweets are only created by the logged in user #MDM\n #@tweet = Tweet.new(tweet_params)\n @tweet = current_user.tweets.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = current_user.tweets.build(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to member_url(current_user), notice: '投稿しました' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_tweet(message)\n tweet = Tweet.new(self, message)\n self.tweets << tweet\n end",
"def tweet(postids)\n handle_response(get(\"/content/tweet.json\", :query => {:postids => postids}))\n end",
"def create\n @tweet = Tweet.new(tweet_params)\n @tweet.user_id = current_user.id\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: \"Tu Tweet se ha publicado con exito!\" }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = FuKing::Twitter.update(params[:tweet][:text])\n\n respond_to do |format|\n if @tweet\n flash[:notice] = 'Tweet was successfully created.'\n format.html { redirect_to(:action => :index) }\n format.mobile { redirect_to(:action => :index) }\n format.xml { render :xml => @tweet, :status => :created, :tweet => @tweet }\n else\n format.html { render :action => \"new\" }\n format.mobile { render :action => \"new\" }\n format.xml { render :xml => @tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_tweet(user_id, tweet_id)\n @alltweets << [user_id, tweet_id]\n end",
"def create\n @tweet_collection = TweetCollection.new(tweet_collection_params)\n Tweet.tweets.each {|t| @tweet_collection.tweets << t}\n \n respond_to do |format|\n if @tweet_collection.save\n format.html { redirect_to @tweet_collection, notice: 'Tweet collection was successfully created.' }\n format.json { render :show, status: :created, location: @tweet_collection }\n else\n format.html { render :new }\n format.json { render json: @tweet_collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = Tweet.new(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to(@tweet, :notice => 'Tweet was successfully created.') }\n format.xml { render :xml => @tweet, :status => :created, :location => @tweet }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet_post = TweetPost.new(tweet_post_params)\n\n respond_to do |format|\n if @tweet_post.save\n format.html { redirect_to @tweet_post, notice: \"Tweet post was successfully created.\" }\n format.json { render :show, status: :created, location: @tweet_post }\n \n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet_post.errors, status: :unprocessable_entity }\n \n end\n end\n end",
"def create\n @tweet = Tweet.create(tweet_params)\n\n @tweet = get_tagged(@tweet)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to home_path, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = Tweet.new(params[:tweet])\n @user = User.find(session[:user_id])\n @tweet.user = @user\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n @tweets = Tweet.paginate page: params[:page], order:'created_at desc', per_page: 10\n @user = User.new\n format.html { render action: \"index\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def twitter\n @user = User.find(session[:user_id])\n t = @user.twitter\n unless t.present?\n redirect_to @user, :notice => \"Please add your twitter account!\"\n return\n end\n @tweets = t.home_timeline\n @posts = []\n @tweets.each do |tweet|\n if Post.exists?(:tweet_id => tweet[:id])\n @posts.push(Post.find_by_tweet_id(tweet[:id]))\n else\n p = Post.new\n p.tweet_id = tweet[:id]\n p.tweeter_twitter_id = tweet[:user][:id]\n if User.exists?(:twitter_id => tweet[:user][:id])\n p.user_id = User.find_by_twitter_id(tweet[:user][:id]).id\n else\n p.user_id = -1\n end\n p.post_type = 3\n p.created_at = tweet[:created_at].to_datetime\n url = \"https://api.twitter.com/1/statuses/oembed.json?id=#{tweet[:id]}&omit_script=true\"\n begin\n tweet_page = open(URI.parse(url))\n p.body = JSON.parse(tweet_page.read)['html']\n if p.save!\n @posts.push(p)\n end\n rescue\n # Tried to access a protected tweet, just skip it\n end\n end\n end\n\n @body_class = 'twitter-background'\n respond_to do |format|\n format.html # twitter.html.erb\n format.json { render json: @posts }\n end\n end",
"def create\n tweet.user = current_user\n\n respond_to do |format|\n if tweet.save\n format.html { redirect_to tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: tweet }\n else\n format.html { render :new }\n format.json { render json: tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet_new_tweet(tweet)\n #setup twitter client\n client = Twitter::REST::Client.new do |config|\n config.consumer_key = $consumer_key\n config.consumer_secret = $consumer_secret\n config.access_token = $access_token\n config.access_token_secret = $access_token_secret\n end\n\n $log.debug(tweet)\n client.update(tweet)\n $log.info(\"Successfully tweeted!\")\nend",
"def index\n @tweets = @user.tweets.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tweets }\n end\n end",
"def create\n signin_apikey\n \n if session[:user_id] != nil\n @tweet = Tweet.new(tweet_params)\n @tweet.author = User.find(session[:user_id]).email.split('@')[0].strip\n @tweet.user_id = User.find(session[:user_id]).id\n if !@tweet.url.blank?\n if !is_url(@tweet.url)\n respond_to do |format|\n format.json { render json: \"Invalid url!\".to_json, status: 400 }\n end\n return\n end\n @tweet.url = @tweet.url.sub \"https://\", \"\"\n @tweet.url = @tweet.url.sub \"www.\", \"\"\n @urlsplit = @tweet.url.split(\"/\")\n @urlsplit.each do |suburl|\n if suburl.include?(\".\")\n @tweet.shorturl = suburl\n end\n end\n end\n @tweet2 = Tweet.find_by url: @tweet.url\n if (@tweet.content.blank? && !@tweet.url.blank?)\n respond_to do |format|\n if @tweet.title.blank?\n format.html { redirect_to new_tweet_path, alert: 'Please try again.' }\n format.json { render json: \"Title property cannot be blank\".to_json, status: 400 }\n elsif (@tweet2 != nil)\n format.html { redirect_to '/tweets/' + @tweet2.id.to_s }\n msg = \"The URL already exists\"\n format.json { render json: msg.to_json , status: 400, location: @tweet }\n elsif @tweet.save\n format.html { redirect_to '/tweets', notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: 201 }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n elsif (@tweet.url.blank? && !@tweet.content.blank?)\n @tweet.ask = true\n respond_to do |format|\n if @tweet.title.blank?\n format.html { redirect_to new_tweet_path, alert: 'Please try again.' }\n format.json { render json: \"Title property cannot be blank\".to_json, status: 400 }\n elsif @tweet.save\n format.html { redirect_to '/tweets', notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: 201 }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n else\n @comment_text=@tweet.content\n @tweet.content=nil\n @tweet.ask = false\n \n if @tweet.save\n Comment.create(contribution: @tweet.id, text: @comment_text, escomment: true, comment_id: nil, user: @tweet.user_id)\n render :json => @tweet.attributes.merge( )\n end\n end\n else\n respond_to do |format|\n format.json { render json: {message: 'Unauthorized, you don\\'t have a valid api_key' }, status: 401 }\n end\n end\n end",
"def tweet_params\n params.require(:tweet).permit(:content, :total_tweet, :retweet)\n end",
"def post_tweet(message)\n Tweet.new(message, self)\n end",
"def create\n @tweetsandwich = Tweetsandwich.new(params[:tweetsandwich])\n\n respond_to do |format|\n if @tweetsandwich.save\n format.html { redirect_to @tweetsandwich, notice: 'Tweetsandwich was successfully created.' }\n format.json { render json: @tweetsandwich, status: :created, location: @tweetsandwich }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweetsandwich.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @tweet = @user.tweets.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tweet }\n end\n end",
"def postTweet(status)\n\t\t\t@client.update(status)\n\t\tend",
"def create\n @tweet = Tweet.new(tweet_params)\n @tweet.user_id = current_user.id\n\n \n\n \n \n \n\n \n \n \n\n\n \n\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: \"Tweet was successfully created.\" }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_user_tweets\n @user_tweets = TwitterClient.user_timeline(params[:name])\n render json: @user_tweets\n end",
"def tweet_params\n params.require(:tweet).permit(:status, :message, :location, :user_id)\n end",
"def tweet_params\n params.require(:tweet).permit(:username, :tweetbody)\n end",
"def post_tweet(message)\n Tweet.new(message, self)\n end",
"def create\n \n @tweet = Tweet.new(params[:tweet])\n \n # write stats\n @keywords.each do |word|\n \n if @tweet.text.downcase.include? word then\n \n stat = WordStatistic.where(:word => word, :day => DateTime.now.beginning_of_day..DateTime.now).first\n if stat.nil? then\n new_stat = WordStatistic.new(:word => word, :day => DateTime.now, :freq => 1)\n new_stat.save\n else\n \n stat.freq += 1\n stat.save\n end\n end\n end # keywords\n\n respond_to do |format|\n if @tweet.save\n format.json { render :json => @tweet, :notice => 'Tweet was successfully created.' }\n format.xml { render :xml => @tweet, :status => :created, :location => @tweet }\n else\n format.xml { render :xml => @tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = Tweetaro.new(tweetaro_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweetしました!' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n tweet = params[:tweet]\n message = tweet[:message]\n @tweet = current_user.tweets.create(tweet_params)\n @comment = Comment.new\n \n redirect_to action: \"index\"\n end",
"def tweet_params\n params.require(:tweet).permit(:text)\n end",
"def tweet_params\n params.require(:tweet).permit(:text)\n end",
"def create\n @tweeeet = current_user.tweeeets.build(tweeeet_params)\n\n respond_to do |format|\n if @tweeeet.save\n format.html { redirect_to root_path, notice: 'Tweet creado con éxito!' }\n format.json { render :show, status: :created, location: @tweeeet }\n else\n format.html { render :new }\n format.json { render json: @tweeeet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet_params\n params.require(:tweet).permit(:content, :user_id, :tweet_id)\n end",
"def tweett_params\n params.require(:tweett).permit(:tweett)\n end",
"def get_timeline\n HTTParty.post(\"#{@api_path}/tweets/#{@handle}/#{@password}\")\n end",
"def tweet_params\n params.require(:tweet).permit(:body)\n end",
"def tweet_params\n params.require(:tweet).permit(:body)\n end",
"def tweet_params\n params.require(:tweet).permit(:body)\n end",
"def tweet_params\n params.require(:tweet).permit(:user_id, :text)\n end",
"def tweet_params\n params.require(:tweet).permit(:usuario_id, :texto)\n end",
"def create\n @tweeter = Tweeter.new(params[:tweeter])\n\n respond_to do |format|\n if @tweeter.save\n format.html { redirect_to @tweeter, notice: 'Tweeter was successfully created.' }\n format.json { render json: @tweeter, status: :created, location: @tweeter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweeter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet_params\n params.require(:tweet).permit(:content, :user_id, :tweet_id)\n end",
"def create\n @fr_tweet = FrTweet.new(fr_tweet_params)\n\n respond_to do |format|\n if @fr_tweet.save\n format.html { redirect_to @fr_tweet, notice: 'Fr tweet was successfully created.' }\n format.json { render :show, status: :created, location: @fr_tweet }\n else\n format.html { render :new }\n format.json { render json: @fr_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @watcher = Watcher.new(watcher_params)\n\n respond_to do |format|\n if @watcher.save\n client = Twitter::REST::Client.new do |config|\n config.consumer_key = \"1jFn305ISZq4moZsv6mYyGls4\"\n config.consumer_secret = \"i8JvIWmswNqA7c9HIpTHJ1nIxZAGGcWyLaGBxfteQXMkNK4DqK\"\n config.access_token = \"14191779-n4X4Fs1WDx9IlNqjt5WhDYT0oMttRlmBP3ysoUhII\"\n config.access_token_secret = \"dixLEBjwapLNrmlZEu2amiB8qcZGihvPnLXoN5d15AgsA\"\n end\n # TODO: max_id, since_id\n client.search(@watcher.keywords, :lang => 'en', :count => 100).take(100).collect do |tweet|\n Tweet.create(:watcher_id => @watcher.id, :tweet_id => tweet.id, :fields => tweet.to_h)\n end\n\n format.html { redirect_to @watcher, notice: 'Watcher was successfully created.' }\n format.json { render :show, status: :created, location: @watcher }\n else\n format.html { render :new }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @favorite_tweet = FavoriteTweet.new(favorite_tweet_params)\n\n respond_to do |format|\n if @favorite_tweet.save\n format.html { redirect_to @favorite_tweet, notice: 'Favorite tweet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @favorite_tweet }\n else\n format.html { render action: 'new' }\n format.json { render json: @favorite_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tweet = current_user.tweets.new(tweet_params)\n\n # respond_to do |format|\n if @tweet.save\n # format.html { \n # puts \"html\"\n # render json: TweetBlueprint.render(@tweet), status: :created \n # }\n # format.json { \n puts \"json\"\n render json: TweetBlueprint.render(@tweet), status: :created \n # }\n else\n # format.html { \n # puts \"error html\"\n # render :new \n # }\n # format.json { \n puts \"error json\"\n render json: { result: 'error', error: @tweet.errors }, status: :unprocessable_entity \n # }\n end\n # end\n end",
"def create\n @tweeter = Tweeter.new(tweeter_params)\n\n respond_to do |format|\n if @tweeter.save\n format.html { redirect_to @tweeter, notice: 'Tweeter was successfully created.' }\n format.json { render :show, status: :created, location: @tweeter }\n else\n format.html { render :new }\n format.json { render json: @tweeter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet(tweet)\n\t\tclient = Twitter::REST::Client.new do |config|\n\t\tconfig.consumer_key = Rails.application.config.twitter_key\n\t\tconfig.consumer_secret = Rails.application.config.twitter_secret\n\t\tconfig.access_token = oauth_token\n\t\tconfig.access_token_secret = oauth_secret\n\tend\n\tclient.update(tweet)\n\tend",
"def tweet_params\r\n params.require(:tweet).permit(:content, :twauthor, :user_id)\r\n end",
"def tweet_params\n params.require(:tweet).permit(:content,:tweet)\n end",
"def create\n @retweet = Retweet.new(params[:retweet])\n\n respond_to do |format|\n if @retweet.save\n format.html { redirect_to @retweet, notice: 'Retweet was successfully created.' }\n format.json { render json: @retweet, status: :created, location: @retweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet_params\n params.require(:tweet).permit(:contents, :id_user, :tweet_id)\n end",
"def create\n\n if Tweet::Create.(current_user, tweet_params)\n return redirect_to tweets_path, notice: 'Tweet was successfully created.'\n end\n\n end",
"def ttweet_params\n params.require(:ttweet).permit(:tweet_body, :ttweet_body)\n end",
"def index\n @tweets = Tweet.all\n\n render json: @tweets\n end",
"def tweet_params\n params.require(:tweet).permit(:content, :user_id)\n end",
"def create\n @twitter_user = TwitterUser.new(params[:twitter_user])\n\n respond_to do |format|\n if @twitter_user.save\n format.html { redirect_to @twitter_user, notice: 'Twitter user was successfully created.' }\n format.json { render json: @twitter_user, status: :created, location: @twitter_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @twitter_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tweet_params\n params.require(:tweet).permit(:content, :user_id)\n\n end",
"def tweet_params\n params.require(:tweet).permit(:message)\n end",
"def tweet_params\n params.require(:tweet).permit(:message, :user_id)\n end",
"def create\n @twee = Twee.new(twee_params)\n\n respond_to do |format|\n if @twee.save\n format.html { redirect_to twees_path, notice: 'Twee was successfully created.' }\n format.json { render :show, status: :created, location: @twee }\n else\n format.html { render :new }\n format.json { render json: @twee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def latest_tweets\n client = Twitter::REST::Client.new do |config|\n config.consumer_key = ENV[\"TWITTER_CONSUMER_KEY\"]\n config.consumer_secret = ENV[\"TWITTER_CONSUMER_SECRET\"]\n end\n\n count = params[:count] || 10\n time_line = client.user_timeline(current_user.twitter_handle, {count: count})\n current_user.update(time_fetched: current_user.time_fetched+1)\n if time_line.class == Twitter::Error::NotFound\n render json: {status: 400, success: false, message: 'Twitter handle or id not valid'}\n else\n render json: {status: 200, success: true, message: 'Success', data: time_line.map{|a| a.text}.as_json}\n end\n\n rescue => e\n Rails.logger.error \"account_controller#latest_tweets - Error: #{e.message}\"\n render json: {status: 500, success: false, message: 'Unexpected error'}\n end",
"def tweet_params\n @tweet_parms = params.require(:tweet).permit(:tweet)\n @tweet_parms[:user] = auth_user\n @tweet_parms\n end",
"def tweet_params\n params.require(:tweet).permit(:status, :zombie_id)\n end",
"def index\n @tweets = current_user.feed_tweets.order(id: :desc).page(params[:page])\n @tweet = current_user.tweets.build\n end",
"def create\n username = params[:username]\n tweets = timeline_query username\n tweet_sentiment_list = get_sentiment(tweets)\n redirect_to :action => \"index\", :tweets => tweet_sentiment_list\n end",
"def tweet_params\n params.require(:tweet).permit(:message, :user_id, :link)\n end",
"def tweet_params\n params.require(:tweet).permit(:message, :user_id, :link)\n end",
"def tweet_params\n params.require(:tweet).permit(:message, :user_id, :link)\n end",
"def save_tweet(params)\n @tweet=self.tweets.new(params)\n @tweet.save\n schedule_tweet(@tweet)\n end",
"def add_tweet(tweet)\n @tweets << tweet\n end"
] | [
"0.7703366",
"0.72558355",
"0.71856695",
"0.7130213",
"0.705414",
"0.7018085",
"0.7003551",
"0.6994446",
"0.698963",
"0.69707346",
"0.69707346",
"0.69071674",
"0.6893714",
"0.68830514",
"0.6881277",
"0.6819126",
"0.67953306",
"0.678633",
"0.6756683",
"0.6734242",
"0.6720373",
"0.67184824",
"0.67015386",
"0.6692809",
"0.6688971",
"0.6660959",
"0.6652602",
"0.6619241",
"0.6610901",
"0.66014075",
"0.6588078",
"0.6583952",
"0.6577264",
"0.6575487",
"0.6553536",
"0.65377945",
"0.64969575",
"0.64789677",
"0.6477812",
"0.6456235",
"0.6440694",
"0.6417829",
"0.64158803",
"0.64096445",
"0.6399313",
"0.63684237",
"0.63681716",
"0.6368104",
"0.6346833",
"0.6345507",
"0.6321917",
"0.63176996",
"0.63128597",
"0.63021123",
"0.6288606",
"0.62878996",
"0.62828463",
"0.62812185",
"0.62740135",
"0.62740135",
"0.6269486",
"0.62581265",
"0.6254715",
"0.62517226",
"0.62512225",
"0.62512225",
"0.62512225",
"0.6250293",
"0.6240649",
"0.6237568",
"0.62123644",
"0.62103504",
"0.6202427",
"0.6195873",
"0.6195465",
"0.61805546",
"0.6173272",
"0.6154754",
"0.61457133",
"0.6145482",
"0.614153",
"0.61276716",
"0.61191547",
"0.6106033",
"0.6079822",
"0.60763955",
"0.60699207",
"0.6069722",
"0.60656446",
"0.6062217",
"0.6062156",
"0.60591173",
"0.6053989",
"0.6035548",
"0.603289",
"0.60306555",
"0.60306555",
"0.60306555",
"0.60301596",
"0.60298157"
] | 0.6560885 | 34 |
PATCH/PUT /tweets/1 PATCH/PUT /tweets/1.json | def update
respond_to do |format|
if @tweet.update(tweet_params)
format.js
format.html { redirect_to tweets_url, notice: 'Tweet was successfully updated.' }
format.json { render :show, status: :ok, location: @tweet }
else
format.html { render :edit }
format.json { render json: @tweet.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tweet.update(tweet_params)\n respond_with(@tweet)\n end",
"def update(tweet)\n client.update tweet\n end",
"def update\n # Add in this #MDM\n @tweet = Tweet.find(params[:id]) \n \n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to user_tweet_path(@user, @tweet), notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if tweet.save\n format.html { redirect_to tweets_path, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: tweet }\n else\n format.html { render :edit }\n format.json { render json: tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @tweet.update(tweet_params)\n\t\t\t\tformat.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @tweet }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @tweet.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @tweet.update(tweet_params)\r\n format.html { redirect_to @tweet}\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @tweet.update(tweet_params)\r\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\r\n format.json { render :show, status: :ok, location: @tweet }\r\n else\r\n format.html { render :edit, status: :unprocessable_entity }\r\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n check_tweet_for_user\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @retweet = Retweet.find(params[:id])\n\n respond_to do |format|\n if @retweet.update_attributes(params[:retweet])\n format.html { redirect_to @retweet, notice: 'Retweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @retweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @new_tweet.update(new_tweet_params)\n format.html { redirect_to @new_tweet, notice: 'New tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @new_tweet }\n else\n format.html { render :edit }\n format.json { render json: @new_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweett.update(tweett_params)\n format.html { redirect_to @tweett, notice: 'Tweett was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweett }\n else\n format.html { render :edit }\n format.json { render json: @tweett.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @favorite_tweet.update(favorite_tweet_params)\n format.html { redirect_to @favorite_tweet, notice: 'Favorite tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @favorite_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @tweet.assign_attributes(tweet_params)\n @tweet.uuid = session[:uid]\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweetaro_params)\n format.html { redirect_to @tweet, notice: 'Tweetを更新しました。' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trash_tweet.update(trash_tweet_params)\n format.html { redirect_to @trash_tweet, notice: 'Trash tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @trash_tweet }\n else\n format.html { render :edit }\n format.json { render json: @trash_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to root_path, notice: 'ツーイトの編集が完了しました。' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @retweet.update(tweet_params)\n format.html { redirect_to retweets_path, notice: 'Retweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @retweet }\n else\n format.html { render :edit }\n format.json { render json: @retweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: '編集しました' }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tweeter = Tweeter.find(params[:id])\n\n respond_to do |format|\n if @tweeter.update_attributes(params[:tweeter])\n format.html { redirect_to @tweeter, notice: 'Tweeter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweeter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @tweet.user == current_user\n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to @tweet, notice: \"Tweet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to root_path, notice: \"You did not tweeted this tweet!\"\n end\n end",
"def update\n \t@project = Project.find(params[:project_id])\n @tweet = Tweet.find(params[:id])\n\n respond_to do |format|\n if @tweet.update_attributes(params[:tweet])\n format.html { redirect_to(project_tweet_path(@project,@tweet), :notice => 'Tweet was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweeeet.update(tweeeet_params)\n format.html { redirect_to @tweeeet, notice: 'Tweet actualizado con éxito!' }\n format.json { render :show, status: :ok, location: @tweeeet }\n else\n format.html { render :edit }\n format.json { render json: @tweeeet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tweetsandwich = Tweetsandwich.find(params[:id])\n\n respond_to do |format|\n if @tweetsandwich.update_attributes(params[:tweetsandwich])\n format.html { redirect_to @tweetsandwich, notice: 'Tweetsandwich was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweetsandwich.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @twitter_user = TwitterUser.find(params[:id])\n\n respond_to do |format|\n if @twitter_user.update_attributes(params[:twitter_user])\n format.html { redirect_to @twitter_user, notice: 'Twitter user was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @twitter_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n signin_apikey\n if session[:user_id] != nil\n if @tweet.user_id.to_s == session[:user_id].to_s\n respond_to do |format|\n if @tweet.update(tweet_update_params)\n format.html { redirect_to @tweet, notice: 'Tweet was successfully edited.' }\n format.json { render json: @tweet, status: 200 }\n else\n format.html { render :edit }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.json { render json: {message: 'Forbidden, you can\\'t edit a tweet that is not yours' }, status: 403 }\n end\n end\n else\n respond_to do |format|\n format.json { render json: {message: 'Unauthorized, you don\\'t have a valid api_key' }, status: 401 }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fr_tweet.update(fr_tweet_params)\n format.html { redirect_to @fr_tweet, notice: 'Fr tweet was successfully updated.' }\n format.json { render :show, status: :ok, location: @fr_tweet }\n else\n format.html { render :edit }\n format.json { render json: @fr_tweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @twee.update(twee_params)\n format.html { redirect_to @twee, notice: 'Twee was successfully updated.' }\n format.json { render :show, status: :ok, location: @twee }\n else\n format.html { render :edit }\n format.json { render json: @twee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet_post.update(tweet_post_params)\n format.html { redirect_to @tweet_post, notice: \"Tweet post was successfully updated.\" }\n format.json { render :show, status: :ok, location: @tweet_post }\n \n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @tweet_post.errors, status: :unprocessable_entity }\n \n end\n end\n end",
"def update\n @search_tweet = SearchTweet.find(params[:id])\n\n respond_to do |format|\n if @search_tweet.update_attributes(params[:search_tweet])\n format.html { redirect_to(@search_tweet, :notice => 'Search tweet was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @search_tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if params == [:tweet_id,:id]\n @tweet = Tweet.find(params[:tweet_id])\n @actor_tweet = ActorTweet.find(params[:id])\n respond_to do |format|\n if @actor_tweet.update(actor_tweet_params)\n format.html { redirect_to @actor_tweets, notice: 'Actor tweet actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @actor_tweet }\n else\n format.html { render :edit }\n format.json { render json: @actor_tweet.errors, status: :unprocessable_entity }\n end\n end\n end\n if params == [:actor_id,:id]\n @actors = Actor.find(params[:actor_id])\n @actor_tweet = ActorTweet.find(params[:id])\n respond_to do |format|\n if @actor_tweet.update(actor_tweet_params)\n format.html { redirect_to @actor_tweets, notice: 'Actor tweet actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @actor_tweet }\n else\n format.html { render :edit }\n format.json { render json: @actor_tweet.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"def update\n respond_to do |format|\n if @tweet_collection.update(tweet_collection_params)\n format.html { redirect_to @tweet_collection, notice: 'Tweet collection was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet_collection }\n else\n format.html { render :edit }\n format.json { render json: @tweet_collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tweet(id)\n RawTweet.update(id, is_processed: true)\n end",
"def update\n respond_to do |format|\n if @change_table_tweet_info.update(change_table_tweet_info_params)\n format.html { redirect_to @change_table_tweet_info, notice: 'Change table tweet info was successfully updated.' }\n format.json { render :show, status: :ok, location: @change_table_tweet_info }\n else\n format.html { render :edit }\n format.json { render json: @change_table_tweet_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @twittter.update(twittter_params)\n format.html { redirect_to @twittter, notice: 'Twittter was successfully updated.' }\n format.json { render :show, status: :ok, location: @twittter }\n else\n format.html { render :edit }\n format.json { render json: @twittter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweeter.update(tweeter_params)\n format.html { redirect_to @tweeter, notice: 'Tweeter was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweeter }\n else\n format.html { render :edit }\n format.json { render json: @tweeter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @avatar_tweet = AvatarTweet.find(params[:id])\n\n respond_to do |format|\n if @avatar_tweet.update_attributes(params[:avatar_tweet])\n format.html { redirect_to(@avatar_tweet, :notice => 'Avatar tweet was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @avatar_tweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @twet.update(twet_params)\n format.html { redirect_to @twet, notice: \"Twet was successfully updated.\" }\n format.json { render :show, status: :ok, location: @twet }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @twet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @twet.update(twet_params)\n format.html { redirect_to @twet, notice: 'Twet was successfully updated.' }\n format.json { render :show, status: :ok, location: @twet }\n else\n format.html { render :edit }\n format.json { render json: @twet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @twitter_list = TwitterList.find(params[:id])\n\n respond_to do |format|\n if @twitter_list.update_attributes(params[:twitter_list])\n format.html { redirect_to @twitter_list, notice: 'Twitter list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @twitter_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"def tweet_new_tweet(tweet)\n #setup twitter client\n client = Twitter::REST::Client.new do |config|\n config.consumer_key = $consumer_key\n config.consumer_secret = $consumer_secret\n config.access_token = $access_token\n config.access_token_secret = $access_token_secret\n end\n\n $log.debug(tweet)\n client.update(tweet)\n $log.info(\"Successfully tweeted!\")\nend",
"def tweet(tweet)\n\t\tclient = Twitter::REST::Client.new do |config|\n\t\tconfig.consumer_key = Rails.application.config.twitter_key\n\t\tconfig.consumer_secret = Rails.application.config.twitter_secret\n\t\tconfig.access_token = oauth_token\n\t\tconfig.access_token_secret = oauth_secret\n\tend\n\tclient.update(tweet)\n\tend",
"def update\n\t\t@tweet.update(tweet_params)\n\n\t\tif @tweet.valid?\n\t\t\tredirect_to_tweet('Your tweet was sucessfully updated!')\n\t\telse\n\t\t\trender(:edit)\n\t\tend\n\tend",
"def update\n @tweets_chosen_thread = TweetsChosenThread.find(params[:id])\n\n respond_to do |format|\n if @tweets_chosen_thread.update_attributes(params[:tweets_chosen_thread])\n format.html { redirect_to(@tweets_chosen_thread, :notice => 'TweetsChosenThread was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tweets_chosen_thread.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tweets_chosen_thread = TweetsChosenThread.find(params[:id])\n\n respond_to do |format|\n if @tweets_chosen_thread.update_attributes(params[:tweets_chosen_thread])\n format.html { redirect_to(@tweets_chosen_thread, :notice => 'TweetsChosenThread was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tweets_chosen_thread.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @twizzle.update(twizzle_params)\n format.html { redirect_to @twizzle, notice: 'Twizzle was successfully updated.' }\n format.json { render :show, status: :ok, location: @twizzle }\n else\n format.html { render :edit }\n format.json { render json: @twizzle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if current_user.id==@tweet.user_id\n \n \n respond_to do |format|\n if @tweet.update(tweet_params)\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n elsif current_user.id!=@tweet.user_id\n \n\n \n redirect_to tweets_url, {notice: 'You Cannot update the tweet since you are not the author :p .'}\n end\n\n end",
"def update\n\t\t# find our post\n\t\tid = params[:id]\n\t\t@post = Post.find(id)\n\n\t\t# increment the number of votes\n\t\tif params[:tweet] == \"true\"\n\t\t\t@post.votes = @post.votes + 1\n\t\t\t@post.save\n\t\telsif params[:flagged] == \"true\"\n\t\t\t@post.flagged = @post.flagged + 1\n\t\t\t@post.save\n\t\tend\n\t\t\n\t\t# TODO: ask Tom what this does again\n\t\trender :json => @post\n\tend",
"def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n #if the tweet was updated, redirects to the show page and issues a notice to the user\n if @tweet.update( tweet_params )\n format.html {redirect_to @tweet, notice: 'Post was successfully updated'}\n else\n #if the tweet does not update, user will stay on the edit page\n format.html {render :edit}\n end\n end\n\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n @twitterfeed = Twitterfeed.find(params[:id])\n\n respond_to do |format|\n if @twitterfeed.update_attributes(params[:twitterfeed])\n flash[:notice] = 'Twitterfeed was successfully updated.'\n format.html { redirect_to(@twitterfeed) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @twitterfeed.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n Twitter.user_timeline(params[:foodtruck][:handle])\n foodtruck = Foodtruck.find(params[:id])\n foodtruck.update_attributes(params[:foodtruck])\n redirect_to '/foodtrucks'\n rescue\n redirect_to \"/foodtrucks/#{params[:id]}\"\n end\n end",
"def update\n @todo = Todo.find(params[:id])\n if @todo.update(todo_params)\n render json: @todo\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @bottle.update(bottle_params)\n format.html { redirect_to user_path(current_user.id), notice: 'Bottle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bottle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end",
"def update\n respond_to do |format|\n if @timeline.update(timeline_params)\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @favoritetweet = Favoritetweet.find(params[:id])\n\n respond_to do |format|\n if @favoritetweet.update_attributes(params[:favoritetweet])\n format.html { redirect_to(@favoritetweet, :notice => 'Favoritetweet was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @favoritetweet.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:todo][:id])\n if @todo.update_attributes(user_params)\n render json: @todo\n else\n render nothing: true, status: :bad_request\n end\n end",
"def update\n @old_twit = OldTwit.find(params[:id])\n\n respond_to do |format|\n if @old_twit.update_attributes(params[:old_twit])\n format.html { redirect_to(@old_twit, :notice => 'Old twit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @old_twit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n put :update\n end",
"def update\n respond_to do |format|\n if @zweet.update(zweet_params)\n format.html { redirect_to @zweet, notice: 'Zweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @zweet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tweeter_queue = TweeterQueue.find(params[:id])\n\n respond_to do |format|\n if @tweeter_queue.update_attributes(params[:tweeter_queue])\n format.html { redirect_to @tweeter_queue, notice: 'Tweeter queue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tweeter_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @timeline = Timeline.find(params[:id])\n\n respond_to do |format|\n if @timeline.update_attributes(params[:timeline])\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @timeline = Timeline.find(params[:id])\n\n respond_to do |format|\n if @timeline.update_attributes(params[:timeline])\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tweet_db.update(tweet_db_params)\n format.html { redirect_to @tweet_db, notice: 'Tweet db was successfully updated.' }\n format.json { render :show, status: :ok, location: @tweet_db }\n else\n format.html { render :edit }\n format.json { render json: @tweet_db.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n req = ActiveSupport::JSON.decode(request.body)\n @bookmark = Bookmark.find(req)\n\n respond_to do |format|\n if @bookmark.update_attributes(params[:id])\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully updated.' }\n format.json { render json: @bookmark, status: :created, location: @bookmarks }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n if @trend.update_attributes(params[:trend])\n format.html { redirect_to @trend, :notice => 'Trend was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @trend.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @timeline.update(timeline_params)\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { render :show, status: :ok, location: @timeline }\n else\n format.html { render :edit }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @timeline.update(timeline_params)\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { render :show, status: :ok, location: @timeline }\n else\n format.html { render :edit }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @t = T.find(params[:id])\n\n respond_to do |format|\n if @t.update_attributes(params[:t])\n format.html { redirect_to @t, notice: 'T was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tw_stat.update(tw_stat_params)\n format.html { redirect_to @tw_stat, notice: 'Tw stat was successfully updated.' }\n format.json { render :show, status: :ok, location: @tw_stat }\n else\n format.html { render :edit }\n format.json { render json: @tw_stat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n if @trend.update_attributes(params[:trend])\n format.html { redirect_to @trend, notice: 'Trend was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trend.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @avatar_twitter = AvatarTwitter.find(params[:id])\n\n respond_to do |format|\n if @avatar_twitter.update_attributes(params[:avatar_twitter])\n format.html { redirect_to(@avatar_twitter, :notice => 'Avatar twitter was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @avatar_twitter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n #current_user.twitter.update(@account.content) if params[:twitter] == 'yes'\n #if params[:facebook] == 'yes'\n # current_user.facebook.feed!(:message => \"test\",\n # :link => \"http://moonkey.jp\",\n # :name => \"TEST\",\n # :description => \"test\")\n #end\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def set_tweet\n @tweet = Tweet.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @tweet_store.update(tweet_store_params)\n format.html { redirect_to @tweet_store, notice: 'Tweet store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tweet_store.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_tweet\n \t\t@tweet = Tweet.find(params[:id])\n \tend",
"def update\n document = Document.find(params[:id])\n document.update!(update_params)\n render json: {}\n end",
"def postTweet(status)\n\t\t\t@client.update(status)\n\t\tend",
"def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"def sendtweet\n text=params[:tuit]\n client.update(text) unless text == nil\n respond_to do |format|\n format.html { }\n\t format.json { head :no_content }\n\t format.js\n end\n end",
"def set_tweet\n @tweet = Tweet.find(params[:id])\n end",
"def set_tweet\n @tweet = Tweet.find(params[:id])\n end",
"def set_tweet\n @tweet = Tweet.find(params[:id])\n end"
] | [
"0.7197328",
"0.7197328",
"0.7197328",
"0.7190091",
"0.7104329",
"0.70864266",
"0.70808625",
"0.7032461",
"0.6948526",
"0.6948526",
"0.6948526",
"0.6948526",
"0.69477296",
"0.69121426",
"0.69121426",
"0.69121426",
"0.68921447",
"0.6882045",
"0.6846168",
"0.6831158",
"0.6798198",
"0.6794621",
"0.6789822",
"0.6749444",
"0.6744176",
"0.67319506",
"0.6677573",
"0.66624177",
"0.6662011",
"0.66279685",
"0.66039807",
"0.659633",
"0.65769494",
"0.6554227",
"0.65319914",
"0.65079015",
"0.64166033",
"0.639572",
"0.6314787",
"0.6307187",
"0.6258904",
"0.62522215",
"0.62257534",
"0.62151647",
"0.6209262",
"0.6198359",
"0.6194853",
"0.61908877",
"0.6182406",
"0.6169695",
"0.6169367",
"0.61620057",
"0.61604977",
"0.6140721",
"0.6129248",
"0.6096546",
"0.6086447",
"0.6086447",
"0.6071291",
"0.6061063",
"0.6060784",
"0.6041331",
"0.6030455",
"0.6010393",
"0.59754425",
"0.59573424",
"0.5938325",
"0.5924107",
"0.5922197",
"0.59095067",
"0.58934915",
"0.5887939",
"0.58630276",
"0.5843223",
"0.5840863",
"0.5826056",
"0.58105785",
"0.5802898",
"0.5802898",
"0.58028615",
"0.5802684",
"0.5800576",
"0.5799505",
"0.5799505",
"0.5798855",
"0.5794574",
"0.57896864",
"0.57779765",
"0.5777681",
"0.577453",
"0.5770839",
"0.57665926",
"0.57562083",
"0.5755837",
"0.57457364",
"0.5742057",
"0.5737563",
"0.5732065",
"0.5732065",
"0.5732065"
] | 0.6423269 | 36 |
DELETE /tweets/1 DELETE /tweets/1.json | def destroy
@tweet.destroy
respond_to do |format|
format.js
format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n user = user_from_token\n user.tweets.destroy(params[:id])\n head :no_content\n end",
"def destroy\n @tweet = Tweet.find(params[:id])\n @tweet.destroy\n\n respond_to do |format|\n format.html { redirect_to tweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet = Tweet.find(params[:id])\n @tweet.destroy\n\n respond_to do |format|\n format.html { redirect_to tweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n\n respond_to do |format|\n format.html { redirect_to tweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @interesting_tweet.destroy\n respond_to do |format|\n format.html { redirect_to interesting_tweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: '削除しました' }\n format.json { head :no_content }\n end\n end",
"def destroy\n tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_path, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet = Tweet.find(params[:id])\n @tweet.destroy\n\n respond_to do |format|\n format.html { redirect_to(tweets_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n respond_to do |format|\n begin\n @tweet = TweetApp::ClientContext.status(:delete, params[:id])\n flash[:message] = \"Tweet with id #{params[:id]} was deleted from Twitter\"\n format.html { redirect_to tweets_url }\n format.json { head :ok }\n format.xml { head :ok }\n rescue Twitter::RESTError => re\n handle_rest_error(re, format)\n end\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweeeet.destroy\n respond_to do |format|\n format.html { redirect_to tweeeets_url, notice: 'Tweet eliminado con éxito!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: \"Tweet was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: \"Tweet was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: \"Tweet was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: \"Tweet was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: \"Tweet was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n death = []\r\n death << Retweet.where(tweet_id: @tweet.id)\r\n death.flatten!\r\n death.each do |die|\r\n die.destroy\r\n end\r\n\r\n @tweet.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to tweets_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\r\n @tweet.destroy\r\n respond_to do |format|\r\n format.html { redirect_to tweets_url, notice: \"Tweet was successfully destroyed.\" }\r\n format.json { head :no_content }\r\n end \r\n end",
"def destroy\n @tweet = Tweet.find(params[:id])\n @tweet.delete_tweet_keep_sub_tweets\n @tweet.reload\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_back fallback_location: root_path, notice: 'ツーイトの削除が完了しました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trash_tweet.destroy\n respond_to do |format|\n format.html { redirect_to trash_tweets_url, notice: 'Trash tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twitter_id = TwitterId.find(params[:id])\n @twitter_id.destroy\n\n respond_to do |format|\n format.html { redirect_to twitter_ids_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n redirect_to tweets_path\n #respond_to do |format|\n #format.html { redirect_to tweets_url }\n #format.json { head :no_content }\n #end\n end",
"def destroy\n check_tweet_for_user\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @retweet = Retweet.find(params[:id])\n @retweet.destroy\n\n respond_to do |format|\n format.html { redirect_to retweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweetaros_url, notice: 'Tweetを削除しました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @new_tweet.destroy\n respond_to do |format|\n format.html { redirect_to new_tweets_url, notice: 'New tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet = Tweet.find(params[:id])\n\n if @tweet.user_id == session[:user_id]\n @tweet.retweets.destroy_all\n\n @tweet.destroy\n else\n flash[:notice] = \"Tweet can not be deleted\"\n end\n\n respond_to do |format|\n format.html { redirect_to tweets_url }\n format.json { head :no_content }\n end \n end",
"def destroy\n @actor_tweet.destroy\n respond_to do |format|\n format.html { redirect_to @tweet, notice: 'Actor tweet eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweett.destroy\n respond_to do |format|\n format.html { redirect_to tweetts_url, notice: 'Tweett was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n respond_with(@tweet)\n end",
"def destroy\n @tweeter = Tweeter.find(params[:id])\n @tweeter.destroy\n\n respond_to do |format|\n format.html { redirect_to tweeters_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @zweet.destroy\n respond_to do |format|\n format.html { redirect_to zweets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@tweet.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def destroy\n @avatar_tweet = AvatarTweet.find(params[:id])\n @avatar_tweet.destroy\n\n respond_to do |format|\n format.html { redirect_to(avatar_tweets_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fr_tweet.destroy\n respond_to do |format|\n format.html { redirect_to fr_tweets_url, notice: 'Fr tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweetsandwich = Tweetsandwich.find(params[:id])\n @tweetsandwich.destroy\n\n respond_to do |format|\n format.html { redirect_to tweetsandwiches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @search_tweet = SearchTweet.find(params[:id])\n @search_tweet.destroy\n\n respond_to do |format|\n format.html { redirect_to(search_tweets_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @retweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Retweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n run Tweet::Delete\n\n flash[:alert] = \"Tweet deleted\"\n redirect_to tweets_path\n end",
"def destroy\n #deletes selected tweet\n @tweet.destroy\n\n #After tweet is deleted, redirects back to the main tweet URL\n #Also, adds a notice to let the user know the tweet was deleted\n respond_to do |format |\n format.html {redirect_to tweets_url, notice: \"Post was deleted\" }\n end\n\n end",
"def destroy\n @twitter_user = TwitterUser.find(params[:id])\n @twitter_user.destroy\n\n respond_to do |format|\n format.html { redirect_to twitter_users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tweet_db.destroy\n respond_to do |format|\n format.html { redirect_to tweet_dbs_url, notice: 'Tweet db was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n TwitterSyncWorker.new.delete(session[:user_id], @favorite_tweet.id)\n @favorite_tweet.destroy\n respond_to do |format|\n format.html { redirect_to request.referer }\n format.json { head :no_content }\n end\n end",
"def destroy\n @favoritetweet = Favoritetweet.find(params[:id])\n @favoritetweet.destroy\n\n respond_to do |format|\n format.html { redirect_to(favoritetweets_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tweet_post.destroy\n respond_to do |format|\n format.html { redirect_to tweet_posts_url, notice: \"Tweet post was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n # Add in this #MDM\n # Use current_user below, so that new tweets are only created by the logged in user #MDM\n # @tweet = Tweet.find(params[:id])\n @tweet = current_user.tweets.find(params[:id])\n \n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twitter_list = TwitterList.find(params[:id])\n @twitter_list.destroy\n\n respond_to do |format|\n format.html { redirect_to twitter_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twee.destroy\n respond_to do |format|\n format.html { redirect_to twees_url, notice: 'Twee was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @tweet_store.destroy\n respond_to do |format|\n format.html { redirect_to tweet_stores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twet.destroy\n respond_to do |format|\n format.html { redirect_to twets_url, notice: \"Twet was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twet.destroy\n respond_to do |format|\n format.html { redirect_to twets_url, notice: 'Twet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_tweets!\n self.twittertexts.destroy_all\n end",
"def destroy\n @qweet.destroy\n respond_to do |format|\n format.html { redirect_to qweets_url, notice: \"Qweet was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet_collection.destroy\n respond_to do |format|\n format.html { redirect_to tweet_collections_url, notice: 'Tweet collection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twitterfeed = Twitterfeed.find(params[:id])\n @twitterfeed.destroy\n\n respond_to do |format|\n format.html { redirect_to(twitterfeeds_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tw_stat.destroy\n respond_to do |format|\n format.html { redirect_to tw_stats_url, notice: 'Tw stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twenty.destroy\n respond_to do |format|\n format.html { redirect_to twenties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweet.destroy\n\n head :no_content\n end",
"def destroy\n @bookmark.destroy\n respond_to do |format|\n format.html { redirect_to \"/timeline\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twizzle.destroy\n respond_to do |format|\n format.html { redirect_to twizzles_url, notice: 'Twizzle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweeter.destroy\n respond_to do |format|\n format.html { redirect_to tweeters_url, notice: 'Tweeter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tweets_chosen_thread = TweetsChosenThread.find(params[:id])\n @tweets_chosen_thread.destroy\n\n respond_to do |format|\n format.html { redirect_to(tweets_chosen_threads_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tweets_chosen_thread = TweetsChosenThread.find(params[:id])\n @tweets_chosen_thread.destroy\n\n respond_to do |format|\n format.html { redirect_to(tweets_chosen_threads_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @timeline.destroy\n respond_to do |format|\n format.html { redirect_to timelines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @tweet.client == current_client\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url }\n format.json { head :no_content }\n format.js {render :js=>\"$.notify('Tweet deleted', 'success');removeTweet(#{@tweet.id})\"}\n end\n else\n respond_to do |format|\n format.html { redirect_to tweets_url, :status => :forbidden, notice: 'Unauthized.' }\n format.json {render json: {:error=>\"forbidden\"},:status=> :forbidden }\n end\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n signin_apikey\n if session[:user_id] != nil\n if @tweet.user_id.to_s == session[:user_id].to_s\n @tweet.destroy\n respond_to do |format|\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully destroyed.' }\n format.json { render json: {message: 'Contribution destroyed!' } }\n end\n else\n respond_to do |format|\n format.json { render json: {message: 'Forbidden, you can\\'t delete a tweet that is not yours' }, status: 403 }\n end\n end\n else\n respond_to do |format|\n format.json { render json: {message: 'Unauthorized, you don\\'t have a valid api_key' }, status: 401 }\n end\n end\n end",
"def delete\n render json: Like.delete(params[\"id\"])\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_follower = UserFollower.find(:first, :conditions => {:user_id => params[:id], :follower_id => params[:user_id]})\n @user_follower.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_tweets_path(current_user)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @timeline = Timeline.find(params[:id])\n @timeline.destroy\n\n respond_to do |format|\n format.html { redirect_to timelines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @twittter.destroy\n respond_to do |format|\n format.html { redirect_to twittters_url, notice: 'Twittter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @example_two.destroy\n respond_to do |format|\n format.html { redirect_to example_twos_url }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @twentyeight.destroy\n respond_to do |format|\n format.html { redirect_to twentyeights_url }\n format.json { head :no_content }\n end\n end",
"def destroy1\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @twentytwo.destroy\n respond_to do |format|\n format.html { redirect_to twentytwos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @avatar_twitter = AvatarTwitter.find(params[:id])\n @avatar_twitter.destroy\n\n respond_to do |format|\n format.html { redirect_to(avatar_twitters_url) }\n format.xml { head :ok }\n end\n end",
"def delete_status(id)\n delete(\"/statuses/#{id}\")\n end",
"def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n render json: nil, status: :ok\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\t\t\n\t\tbegin\n\t\t\t@retweet = current_user.tweets_users.find(params[:id])\n\t\trescue ActiveRecord::RecordNotFound\n\t\t\trender :text => \"Record Not Found\"\n\t\tend\n\t\t\n\t\trender :text => \"Retweet not posted successfully\" && return if !@retweet.destroy\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html {redirect_to tweets_path}\n\t\tend\n\tend",
"def destroy\n @weibo = Weibo.find(params[:id])\n @weibo.destroy\n\n respond_to do |format|\n format.html { redirect_to weibos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n Feed.find(params[:id]).destroy\n render :json => {:ok => true}, :head => :no_content\n end",
"def destroy\n @trend = Trend.find(params[:id])\n @trend.destroy\n\n respond_to do |format|\n format.html { redirect_to trends_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @change_table_tweet_info.destroy\n respond_to do |format|\n format.html { redirect_to change_table_tweet_infos_url, notice: 'Change table tweet info was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @old_twit = OldTwit.find(params[:id])\n @old_twit.destroy\n\n respond_to do |format|\n format.html { redirect_to(old_twits_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @trend = Trend.find(params[:id])\n @trend.destroy\n\n respond_to do |format|\n format.html { redirect_to trends_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @treq = Treq.find(params[:id])\n @treq.destroy\n\n respond_to do |format|\n format.html { redirect_to treqs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @word_count = WordCount.find(params[:id])\n @word_count.destroy\n\n respond_to do |format|\n format.html { redirect_to word_counts_url }\n format.json { head :no_content }\n end\n end"
] | [
"0.7619746",
"0.74507135",
"0.74507135",
"0.744736",
"0.7429372",
"0.7330026",
"0.73022366",
"0.7290246",
"0.7261834",
"0.72386956",
"0.7213443",
"0.7213443",
"0.7213443",
"0.7213443",
"0.7213443",
"0.7213443",
"0.72114694",
"0.7209884",
"0.7209884",
"0.7209884",
"0.7209884",
"0.7209884",
"0.71980757",
"0.7171928",
"0.71486807",
"0.7134567",
"0.7133032",
"0.71254337",
"0.7120646",
"0.7113727",
"0.7083738",
"0.7079978",
"0.70734334",
"0.7049098",
"0.70414776",
"0.70056546",
"0.69562286",
"0.69516087",
"0.6927957",
"0.6918265",
"0.6906977",
"0.6903995",
"0.68894696",
"0.6860258",
"0.68584275",
"0.6829423",
"0.6813769",
"0.6783842",
"0.67775244",
"0.6772021",
"0.67717683",
"0.6754796",
"0.66976976",
"0.6678888",
"0.6653601",
"0.6638969",
"0.66326994",
"0.6622",
"0.6600921",
"0.65950525",
"0.6590237",
"0.6564649",
"0.65519947",
"0.65258515",
"0.6519942",
"0.6512236",
"0.64992326",
"0.64978987",
"0.6497597",
"0.64974856",
"0.64906985",
"0.64610934",
"0.6460836",
"0.6454775",
"0.6451706",
"0.64324856",
"0.64318466",
"0.6427965",
"0.640239",
"0.6398443",
"0.6397377",
"0.6383254",
"0.6382141",
"0.63752836",
"0.6356488",
"0.63522667",
"0.63492393",
"0.63406146",
"0.6339609",
"0.63341075",
"0.63321877",
"0.63245547",
"0.63145196",
"0.63144594",
"0.63097006",
"0.6307906",
"0.6307283",
"0.6306849",
"0.6296381",
"0.62952834"
] | 0.6557595 | 62 |
Use callbacks to share common setup or constraints between actions. | def set_tweet
@tweet = Tweet.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def tweet_params
params.require(:tweet).permit(:company_id, :text, :username, :useful, :bayesfilter)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] | 0.0 | -1 |
Custom sort method for AJAX sortability POST /feeds/sort | def sort
params[:feeds].each_with_index do |id, index|
Feed.update_all(['position=?', index+1], ['id=?', id])
end
render :nothing => true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort_params; end",
"def sort_params; end",
"def sort_entries; end",
"def sort(collection)\n sort = params[:sort]\n return collection unless sort\n\n sort_fields = Jaf::SortFields.deserialize(sort)\n collection.order(sort_fields)\n end",
"def sortable_sort\n @sortable_sort\n end",
"def apply_sorting(query, sort_params)\n (sort_params[:sort] || {}).each do |idx, order|\n order = (order.to_i % 2 == 0) ? :asc : :desc\n filter = ajax_filters.find { |f| f.position == idx.to_i }\n\n next if filter.blank?\n\n klass = filter.klass || query.klass\n column = filter.column\n\n if filter.sorter_query.present?\n query = filter.sorter_query.call(query, order)\n else\n query = query.reorder(\"#{klass.table_name}.#{column} #{order} NULLS LAST\")\n end\n end\n\n query\n end",
"def sort\n # Force back to page 1\n @page = 1\n @data_management_plans = paginate_response(results: search_filter_and_sort)\n render layout: false\n end",
"def sort\n if (defined? params[:moved] and defined? params[:test_case])\n # moved will look like 'test_case_3.0', make it '3.0' instead\n params[:moved].gsub!(/.*_(\\d+\\.\\d+)$/, '\\1')\n # find the new position for this item\n pos = params[:test_case].index(params[:moved]) + 1\n tc_id, tc_pos = params[:moved].split('.', 2)\n if (defined? pos and pos != tc_pos.to_i)\n stc = SuiteTestCase.where(:suite_id => params[:id], :test_case_id => tc_id).first\n if stc.insert_at(pos) != false\n flash[:notice] = \"Successfully saved sort order.\"\n end\n end\n end\n @suite = Suite.find(params[:id])\n # must redraw list with updated id #'s\n @current_cases = @suite.test_cases\n respond_with @suite do |format|\n format.js { render 'sort.js' }\n end\n end",
"def list_entries_with_sort\n if params[:sort].present? && sortable?(params[:sort])\n list_entries_without_sort.except(:order).order(sort_expression)\n else\n list_entries_without_sort\n end\n end",
"def add_sort_field(*) super end",
"def sort_data\n store.sort_data!\n end",
"def sort\n (@params[:sort] || :created_at).to_sym\n end",
"def sort_items\n @items = @items.sort_by(&:created_at) if params[:order] == 'date'\n @items = @items.sort_by(&:created_at).reverse if params[:order] == 'date desc'\n @items = @items.sort_by(&:payee) if params[:order] == 'payee'\n @items = @items.sort_by(&:payee).reverse if params[:order] == 'payee desc'\n @items = @items.sort_by(&:description) if params[:order] == 'descr'\n @items = @items.sort_by(&:description).reverse if params[:order] == 'descr desc'\n @items = @items.sort_by(&:amount) if params[:order] == 'saldo'\n @items = @items.sort_by(&:amount).reverse if params[:order] == 'saldo desc'\n @items = @items.sort_by(&:category_id) if params[:order] == 'cat'\n @items = @items.sort_by(&:category_id).reverse if params[:order] == 'cat desc'\n end",
"def get_sort(collection, params)\n if params[:sort] && sort = cached_source(params[:sort])\n collection.joins(:results)\n .where(\"results.source_id = ?\", sort.id)\n .order(\"results.total DESC\")\n elsif params[:sort] == \"created_at\"\n collection.order(\"works.created_at ASC\")\n else\n collection.order(\"works.issued_at DESC\")\n end\n end",
"def sort_entries=(_arg0); end",
"def sort_by\n unless params[:sort].blank?\n params[:sort] if params[:sort] == 'created_at' || 'vote_score' || 'replies'\n else\n 'created_at'\n end\n end",
"def convert_sort_params\n @sort_params = []\n #convert sort params to database columns\n if params[:sorting] && params[:sorting].is_a?(Array)\n params[:sorting].each do |p|\n\n sort = sort.reject{|k, v| !@resource.attribute_method?(k) || !['asc', 'desc'].include?(v.downcase)}\n\n @sort_params.push(sort)\n end\n end\n @sort_params\n end",
"def sort_link_helper(text,param,action)\n key = param\n key += \"_reverse\" if params[:sort] == param\n options = {\n :url => {:action => action, :params => params.merge({:sort => key, :page => nil})},\n :method=>\"POST\"\n }\n html_options = {\n :title => \"Sort by this field\",\n :href => url_for(:action => 'list', :params => params.merge({:sort => key, :page => nil})),\n :class=> \"sort\"\n }\n link_to(text, options, html_options)\n end",
"def sort\n notice = 'Categories successfully sorted.'\n error = 'Could not sort Categories.'\n \n begin \n ShopCategory.sort(CGI::parse(params[:categories])[\"categories[]\"])\n \n respond_to do |format|\n format.html {\n redirect_to admin_shop_products_path\n }\n format.js { render :text => notice, :status => :ok }\n format.json { render :json => { :notice => notice }, :status => :ok }\n end\n rescue\n respond_to do |format|\n format.html {\n flash[:error] = error\n redirect_to admin_shop_products_path\n }\n format.js { render :text => error, :status => :unprocessable_entity }\n format.json { render :json => { :error => error }, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n sort = case params[:sort]\n when \"title\" then \"title\"\n when \"started\" then \"started\"\n when \"done\" then \"done\"\n when \"initial_estimate\" then \"initial_estimate\"\n when \"title_reverse\" then \"title DESC\"\n when \"started_reverse\" then \"started DESC\"\n when \"done_reverse\" then \"done DESC\"\n when \"initial_estimate_reverse\" then \"initial_estimate DESC\"\n else \"title\"\n end\n \n @tasks = Task.all :order => sort\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :partial => \"tasks_list\", :layout => false }\n end\n end",
"def sort_methods\n [\n 'score desc',\n 'authors_sort asc',\n 'authors_sort desc',\n 'title_sort asc',\n 'title_sort desc',\n 'journal_sort asc',\n 'journal_sort desc',\n 'year_sort asc',\n 'year_sort desc'\n ]\n end",
"def api_sort(params)\n dataset = self.clone\n\n # Sort attribute\n if sort = params['sort']\n if model.attr_orders.include?(sort.to_sym)\n dataset = dataset.order sort.to_sym\n else\n raise ApiException.new(\"invalid sort attribute (#{sort})\")\n end\n elsif dataset.opts[:order].nil?\n # Order by ID.\n dataset = dataset.order(:\"#{model.table_name}__id\")\n end\n \n # Sort order\n if dir = params['order']\n order = dataset.opts[:order].map do |term|\n if dir == 'asc'\n if term.kind_of? Sequel::SQL::OrderedExpression\n # This is already ordered; modify the direction\n term.expression.asc\n else\n term.asc\n end\n elsif dir == 'desc'\n if term.kind_of? Sequel::SQL::OrderedExpression\n # This is already ordered; modify the direction\n term.expression.desc\n else\n term.desc\n end\n else\n raise ApiException, \"invalid order (#{params['order']}) is not 'asc' or 'desc'\"\n end\n end\n # Apply order\n dataset = dataset.order(*order)\n end\n\n dataset\n end",
"def sort_params=(_arg0); end",
"def sort_params=(_arg0); end",
"def index\n sort = case params[:sort]\n when \"title\" then \"title\"\n when \"theme\" then \"theme\"\n when \"start_date\" then \"start_date\"\n when \"number_of_days\" then \"number_of_days\"\n when \"title_reverse\" then \"title DESC\"\n when \"theme_reverse\" then \"theme DESC\"\n when \"start_date_reverse\" then \"start_date DESC\"\n when \"number_of_days_reverse\" then \"number_of_days DESC\"\n else \"title\"\n end\n \n @sprints = Sprint.find :all, :order => sort\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :partial => \"sprints_list\", :layout => false }\n end\n end",
"def sort sortfield = :id, descending = false\n @sortfield = sortfield.to_sym\n reverse = descending ? -1 : 1\n @data = @data.compact.sort { |us1, us2|\n comp =\n if us1[@sortfield] && us2[@sortfield]\n us1[@sortfield] <=> us2[@sortfield]\n elsif us1[@sortfield]\n 1\n elsif us2[@sortfield]\n -1\n else\n 0\n end\n comp * reverse\n }\n end",
"def sort\n params[:dept].each_with_index {|val, index|\n obj = Department.find_by_apikey(val)\n obj.update_attribute(:sort_order, index)\n }\n render :text => \"\"\n end",
"def sort\n return @sort\n end",
"def index\n\n # TODO: Refactor this!!!\n sort_function = (params[:sort] == 'name' ? :name : :count)\n\n @tags = Factoid.tag_counts.sort_by {|tag| tag.send(sort_function)}.reverse\n\n if params[:direction] == 'desc'\n @tags.reverse!\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tags }\n end\n end",
"def sort_link_helper(text, param, action, title = I18n.t('Sistema.Body.General.ordenar_por_este_campo'))\n key = param\n if params[:sort] == param\n title.concat(I18n.t('Sistema.Body.General.de_forma_descendente'))\n key += \" DESC\"\n else\n title.concat(I18n.t('Sistema.Body.General.de_forma_ascendente'))\n end\n params.delete(:controller);\n\n options = {\n :loading =>'image_load()',\n :loaded => 'image_unload()',\n :url => {:action => action, :params => params.merge({:sort => key, :page => nil, :method => :get })}\n\n }\n html_options = {\n :title => title,\n :href => \"/\" + url_for(:action => action, :params => params.merge({:sort => key, :page => nil, :method => :get}))\n }\n link_to_remote(text, options, html_options)\n end",
"def sort\r\n ContentImage.sort(params[:content_image])\r\n render :nothing => true\r\n end",
"def sort\n @student_entities = StudentEntity.all\n @student_entities = @student_entities.sort_by { |stu| stu.created_at }\n render json: @student_entities, status: 200\n end",
"def index\n @listings = Listing.order(params[:sort])\n end",
"def perform\n kahn_sorting if @sorted_list.empty?\n\n @sorted_list\n end",
"def sort\n params[:backlog_entry].each_with_index do |id, index|\n BacklogEntry.update_all({position: index+1}, {id: id})\n end\n render nothing: true\n end",
"def recognize_sort(input)\n sort_products = condition_sort(input[:requested])\n\n Success(sort_products)\n rescue StandardError\n Failure(Response::ApiResult.new(status: :internal_error, message: DB_ERR_MSG))\n end",
"def sort_link_helper(text, param)\n params.delete(:action)\n key = param\n key += \"_reverse\" if params[:sort] == param\n options = {\n :url => {:action => 'list', :params => params.merge({:id=> current_user.id,:sort => key, :page => nil, :folder_name => @folder_name})},\n :update => 'pms_tabs_contents',\n }\n html_options = {\n :title => \"Sort by this field\",\n }\n link_to_remote(text, options, html_options)\n end",
"def sort_by_title\n @links = Link.all.order(:title)\n both = separate_public_and_private(links)\n link_pub = both.first\n link_priv = both.last\n respond_to do |format|\n format.html\n format.json { render json: { links: link_pub.as_json } }\n end\n end",
"def sort_pages\n params[:page].each_with_index {|val, index|\n obj = Page.find_by_apikey(val)\n obj.update_attribute(:sort_order, index)\n }\n render :text => \"\"\n end",
"def sorting_logic\n if params[:sort_by] == \"score\"\n @reviews = @city.department_reviews.sort_by { |dr| dr.score }\n @reviews.reverse!\n render action: :index\n elsif params[:sort_by] == \"date\"\n @reviews = @city.department_reviews.order('created_at DESC')\n render action: :index\n elsif params[:sort_by] == \"endorsements\"\n @reviews = @city.department_reviews.sort_by { |dr| dr.votes_for.size }\n @reviews.reverse!\n render action: :index\n elsif params[:sort_by] == \"comments\"\n @reviews = @city.department_reviews.sort_by { |dr| dr.count_comments }\n @reviews.reverse!\n render action: :index\n elsif params[:sort_by] == \"trending\"\n @reviews = @city.department_reviews.sort_by { |dr| dr.hits }\n @reviews.reverse!\n render action: :index\n else \n @reviews = @city.department_reviews.sort_by { |dr| dr.hits }\n @reviews.reverse!\n render action: :index\n end \n end",
"def get_sorting (default_sort_key)\n \n # Allowed sort fields, can sort by only these fields (are indexed) \n sort_keys = ['name', 'a_id', 'pub_id' , 'popularity_weight', 'category', \n 'sub_category', 'interests', 'release_date', \n 'total_ratings_count', 'total_average_rating',\n 'current_ratings_count', 'current_average_rating',\n 'new_apps', 'new_free_apps', 'new_paid_apps', \n 'top_free_apps_iphone', 'top_paid_apps_iphone',\n 'top_gros_apps_iphone', 'top_free_apps_ipad',\n 'top_paid_apps_ipad', 'top_gros_apps_ipad', 'amount',\n 'pub_name']\n \n # Get the sort_by parameter if it exists, otherwise use the default\n sort_param = request.query_parameters['sort_by'] || default_sort_key\n \n # Make sure the sort parameter is in our allowed list \n sort_key = sort_param if sort_keys.include?sort_param \n return sort_key\n \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def index\n @tasks = Task.sort(params[:sort])\n \n @numRows = 0\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tasks }\n end\n end",
"def sort_links\n resource_service.sortable_fields.collect do |key,value|\n \tlink_to key, params.dup.update(:sort => key), :class => ((params[:sort].to_s==key.to_s) ? 'current' : '')\n end.join(' | ')\n end",
"def sorting\n @records = Record.all #Get existing records\n @sortType = params[:sortType] #Get parameters from the form on index\n @sortField = params[:sortField]\n\n @limit = params[:sortNum].to_i # params must be converted from string\n\n if @sortType == \"Decending\" # check if sort direction is decending\n case @sortField #check what header to sort by\n when \"id\" # when table header is ID sort by ID descending\n @sortedSet = Record.order(id: :desc).limit(@limit)\n when \"REF_DATE\"\n @sortedSet = Record.order(REF_DATE: :desc).limit(@limit)\n when \"GEO\"\n @sortedSet = Record.order(GEO: :desc).limit(@limit)\n when \"DGUID\"\n @sortedSet = Record.order(DGUID: :desc).limit(@limit)\n when \"Sex\"\n @sortedSet = Record.order(Sex: :desc).limit(@limit)\n when \"Age_group\"\n @sortedSet = Record.order(Age_group: :desc).limit(@limit)\n when \"Student_response\"\n @sortedSet = Record.order(Student_response: :desc).limit(@limit)\n when \"UOM\"\n @sortedSet = Record.order(UOM: :desc).limit(@limit)\n when \"UOM_ID\"\n @sortedSet = Record.order(UOM_ID: :desc).limit(@limit)\n when \"SCALAR_FACTOR\"\n @sortedSet = Record.order(SCALAR_FACTOR: :desc).limit(@limit)\n when \"SCALAR_ID\"\n @sortedSet = Record.order(SCALAR_ID: :desc).limit(@limit)\n when \"VECTOR\"\n @sortedSet = Record.order(VECTOR: :desc).limit(@limit)\n when \"COORDINATE\"\n @sortedSet = Record.order(COORDINATE: :desc).limit(@limit)\n when \"VALUE\"\n @sortedSet = Record.order(VALUE: :desc).limit(@limit)\n when \"STATUS\"\n @sortedSet = Record.order(STATUS: :desc).limit(@limit)\n when \"SYMBOL\"\n @sortedSet = Record.order(SYMBOL: :desc).limit(@limit)\n when \"TERMINATED\"\n @sortedSet = Record.order(TERMINATED: :desc).limit(@limit)\n when \"DECIMALS\"\n @sortedSet = Record.order(DECIMALS: :desc).limit(@limit)\n \n end # end case/when\n else # if not decending its ascending\n case @sortField # check header to sort by\n when \"id\" # when table header is ID sort by ID ascending\n @sortedSet = Record.order(id: :asc).limit(@limit)\n when \"REF_DATE\"\n @sortedSet = Record.order(REF_DATE: :asc).limit(@limit)\n when \"GEO\"\n @sortedSet = Record.order(GEO: :asc).limit(@limit)\n when \"DGUID\"\n @sortedSet = Record.order(DGUID: :asc).limit(@limit)\n when \"Sex\"\n @sortedSet = Record.order(Sex: :asc).limit(@limit)\n when \"Age_group\"\n @sortedSet = Record.order(Age_group: :asc).limit(@limit)\n when \"Student_response\"\n @sortedSet = Record.order(Student_response: :asc).limit(@limit)\n when \"UOM\"\n @sortedSet = Record.order(UOM: :asc).limit(@limit)\n when \"UOM_ID\"\n @sortedSet = Record.order(UOM_ID: :asc).limit(@limit)\n when \"SCALAR_FACTOR\"\n @sortedSet = Record.order(SCALAR_FACTOR: :asc).limit(@limit)\n when \"SCALAR_ID\"\n @sortedSet = Record.order(SCALAR_ID: :asc).limit(@limit)\n when \"VECTOR\"\n @sortedSet = Record.order(VECTOR: :asc).limit(@limit)\n when \"COORDINATE\"\n @sortedSet = Record.order(COORDINATE: :asc).limit(@limit)\n when \"VALUE\"\n @sortedSet = Record.order(VALUE: :asc).limit(@limit)\n when \"STATUS\"\n @sortedSet = Record.order(STATUS: :asc).limit(@limit)\n when \"SYMBOL\"\n @sortedSet = Record.order(SYMBOL: :asc).limit(@limit)\n when \"TERMINATED\"\n @sortedSet = Record.order(TERMINATED: :asc).limit(@limit)\n when \"DECIMALS\"\n @sortedSet = Record.order(DECIMALS: :asc).limit(@limit) \n end\n end\n \n end",
"def sort_param_with_url(sortable_name, *args)\n params.delete(:sortasc)\n params.delete(:sortdesc)\n params.merge(sort_param_without_url(sortable_name, *args))\n end",
"def index\n if order = params[\"sort\"]\n @bibliography_items = BibliographyItem.all.order(author: order)\n @next_sort_order = order == \"asc\" ? \"desc\" : \"asc\"\n else\n @bibliography_items = BibliographyItem.all\n @next_sort_order = \"asc\"\n end\n end",
"def tie_breaking_sort\n { \"content_id\" => { order: \"asc\" } }\n end",
"def sort\n self[:sort]\n end",
"def sort\n @sort ||= if order_by_primary_key?\n # Default order is by id DESC\n :desc\n else\n # API defaults to DESC order if param `sort` not present\n request_context.params[:sort]&.to_sym || :desc\n end\n end",
"def index\n @sortable = SortIndex::Sortable.new(params, INDEX_SORT)\n @assets = Asset.find(:all, :order => (params[:sort_by] || \"TRIM(LOWER(tag))\") + \" \" + (params[:sort_direction] || \"asc\"))\n # @assets.sort! {|x,y| x.tag.to_i <=> y.tag.to_i }\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assets }\n end\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def set_Sort(value)\n set_input(\"Sort\", value)\n end",
"def bigSorting(unsorted)\n\nend",
"def sortinate(sort_param)\n\tfoodstores = FoodStore.all\t\n\tif sort_param == \"sarapp_rating\"\n\t\treturn foodstores.sort_by(&:sarapp_rating)\n\telsif sort_param == \"ambience\"\n\t\treturn foodstores.sort_by(&:ambience_average)\t\n\telsif sort_param == \"foodquality\"\n\t\treturn foodstores.sort_by(&:foodquality_average)\t\n\telsif sort_param == \"service\"\n\t\treturn foodstores.sort_by(&:service_average)\t\n\telsif sort_param == \"pricing\"\n\t\treturn foodstores.sort_by(&:pricing_average)\t\n\telsif sort_param == \"ratings\"\n\t\treturn foodstores.sort_by(&:num_of_rating)\t\n end\n end",
"def sort\n @entries = DependencySorter.new(@entries).sorted_items\n end",
"def sort(items)\n if params[:sort]\n items.order_by(params[:sort])\n else\n items.reorder(title: :asc)\n end\n end",
"def extjs_sorting?\n params[:sort] && params[:dir]\n end",
"def check_sort_options() #:nodoc:\r\n table_name = @tables.first[1]\r\n old_sort = session[table_name][:sort].to_s\r\n sort, direction = old_sort.split(' ')\r\n# sort is requested\r\n if params['sort']\r\n # reverse sort if same selected\r\n if params['sort'] == sort\r\n direction = (direction == '1') ? '-1' : '1'\r\n end\r\n direction ||= 1\r\n sort = params[:sort]\r\n session[table_name][:sort] = \"#{params['sort']} #{direction}\"\r\n session[table_name][:page] = 1\r\n end\r\n @records.sort( sort => direction.to_i ) if session[table_name][:sort]\r\n params['sort'] = nil # otherwise there is problem with other links\r\nend",
"def order_collection!\n sort_field = (params[:sort] || '').underscore\n sort_direction_key = (params[:sortDirection] || '').downcase\n sort_direction = SortDirection::LIST[sort_direction_key]\n return if sort_field.blank? || sort_direction.blank?\n\n self.collection = collection.order(\n sort_field => sort_direction\n )\n end",
"def sortable(default_order: {})\n # get the parameter\n sort_by = params[:sort] || params[:sort_by]\n\n if sort_by.is_a?(String)\n # split it\n sort_by_attrs = sort_by.gsub(/[^a-zA-Z0-9\\-_,]/, '').split(',')\n\n # save it\n @sortable_sort = {}\n sort_by_attrs.each do |attrb|\n if attrb.match(/^-/)\n @sortable_sort[attrb.gsub(/^-/, '')] = :desc\n else\n @sortable_sort[attrb] = :asc\n end\n end\n else\n @sortable_sort = default_order\n end\n end",
"def do_params_sort scope\n if self.class.custom_sort_fields[sort_column].present?\n scope = self.class.custom_sort_fields[sort_column].call scope, sort_direction\n elsif resource_class.column_names.include? sort_column\n scope.reorder(resource_class.table_name+\".\"+sort_column + \" \" + sort_direction)\n end\n end",
"def sort_column\n Comment.column_names.include?(params[:sort]) ? params[:sort] : \"posted_on\"\n end",
"def apply_sorting(relation)\n relation.order(@q.sorting.to_sql)\n end",
"def sort\n @content_type.sort_contents!(params[:order])\n respond_with(@content_type, :location => admin_contents_url(@content_type.slug))\n end",
"def index\n type = params[:type]\n field = params[:field]\n\n @items = Item.all.order(\"updated_at desc\")\n if type == \"sort\"\n @items = Item.all.order(\"#{field} asc\")\n end\n\n\n end",
"def set_listing_sort_order(search_object, default_val)\n if params[:sort]\n sort_order = params[:sort].downcase\n case sort_order\n when \"manu\"\n search_object.sort_order = SortOrder::SORT_BY_MANU_ASC\n when \"manud\"\n search_object.sort_order = SortOrder::SORT_BY_MANU_DESC\n when \"size\"\n search_object.sort_order = SortOrder::SORT_BY_SIZE_ASC\n when \"sized\"\n search_object.sort_order = SortOrder::SORT_BY_SIZE_DESC\n when \"upd\"\n search_object.sort_order = SortOrder::SORT_BY_UPDATED_ASC\n when \"updd\"\n search_object.sort_order = SortOrder::SORT_BY_UPDATED_DESC\n when \"qty\"\n search_object.sort_order = SortOrder::SORT_BY_QTY_ASC\n when \"type\"\n search_object.sort_order = SortOrder::SORT_BY_TYPE_ASC\n when \"treadd\"\n search_object.sort_order = SortOrder::SORT_BY_TREADLIFE_DESC\n when \"distance\"\n search_object.sort_order = SortOrder::SORT_BY_DISTANCE_ASC\n when \"cost\"\n search_object.sort_order = SortOrder::SORT_BY_COST_PER_TIRE_ASC\n when \"costd\"\n search_object.sort_order = SortOrder::SORT_BY_COST_PER_TIRE_DESC\n when \"name\"\n search_object.sort_order = SortOrder::SORT_BY_MODEL_NAME_ASC\n when \"named\"\n search_object.sort_order = SortOrder::SORT_BY_MODEL_NAME_DESC\n when \"store\"\n search_object.sort_order = SortOrder::SORT_BY_STORE_NAME_ASC\n when \"stored\"\n search_object.sort_order = SortOrder::SORT_BY_STORE_NAME_DESC\n else\n search_object.sort_order = default_val\n end\n else\n search_object.sort_order = default_val\n end\n end",
"def sort_direction\n params[:direction] || \"asc\"\n end",
"def index\n @ingredients = Ingredient.order(sort_type + \" \" + sort_direction)\n @activeSort = sort_type\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ingredients }\n end\n end",
"def process_sort_by\n case public_plans_params.fetch(:sort_by, 'featured')\n when 'created_at'\n 'plans.created_at desc'\n when 'title'\n 'TRIM(plans.title) asc'\n else\n 'plans.featured desc, plans.created_at desc'\n end\n end",
"def tvSort _args\n \"tvSort _args;\" \n end",
"def sort_column\n News.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"def sort_link_for(title, sort_method, action=:list)\n link_to title, {:action => action, :order_by => sort_method, :order => (@order_by == sort_method) ? 'desc' : 'asc'},\n {:class => 'tooltip', :title => \"Sort By #{title}\", :id => \"header-#{title.downcase.gsub(' ', '-')}\"}\n end",
"def index\n sort_group = [\"id\",\"realname\",\"vote_count\"];\n @sorted = {};\n sort_group.each do |x|\n @sorted[x.to_sym]=0\n end\n if !params[:sort_by].nil?\n sort(params[:sort_by],params[:sort_type])\n else\n @manage_users = Manage::User.all\n end\n\n end",
"def advancedSort\n @sortField = params[:sortField]#field to search on \n @searchField =params[:searchField]# value to search for\n @sortField2 = params[:sortField2]\n @searchField2 =params[:searchField2]\n @graphField = params[:graphField] #datapoint to build graph around\n \n if @sortField2 == \" \"#check if default second value was changed\n @records = Record.where(@sortField => @searchField) #if not only use the first search field\n else#otherwise use both seach fields\n @records = Record.where(@sortField => @searchField, @sortField2 => @searchField2 )\n end\n @sortedSet = @records.order(@graphField)\n end",
"def apply_sorting_to_relation(rel)\n return rel if !params[:sort]\n\n sorts = params[:sort].split(',')\n\n sorts.each do |sort|\n if sort =~ /^([-+]?)(.*)$/\n desc = ($1 && $1 == '-')\n attrname = $2\n\n (attr, path) = rel.nested_attribute(attrname)\n\n rel = rel.joins { path[1..-1].inject(self.__send__(path[0]).outer) { |a,x| a.__send__(x).outer } } if path.any?\n\n # Call .asc explicitly to overcome a bug in pgsql adapter leading to undefined method to_sql\n attr = desc ? attr.desc : attr.asc\n\n rel = rel.order(attr)\n end\n end\n\n rel\n end",
"def sort_files!; end",
"def grand_sorting_machine(array)\n\n\n\nend",
"def sort(*sorts)\n query('sort' => sorts)\n end",
"def all_posts\n # alle posts mit gewuenschter sortierung aus der DB holen\n @posts = Post.find(:all, :order => \"#{params[:sort]} DESC\")\n \n # aktuelle sortierung rausgeben um sie im view anzeigen zu koennen\n @active_sort = [\n params[:sort] == \"created_at\" ? \"act_sort\" : \"not_act_sort\",\n params[:sort] == \"rating\" ? \"act_sort\" : \"not_act_sort\",\n params[:sort] == \"user_id\" ? \"act_sort\" : \"not_act_sort\"\n ]\n end"
] | [
"0.7070612",
"0.7070612",
"0.6880337",
"0.6647745",
"0.65386146",
"0.64456457",
"0.6409838",
"0.6408613",
"0.6372644",
"0.63698274",
"0.6353738",
"0.63450414",
"0.6343259",
"0.6328054",
"0.6317993",
"0.6307229",
"0.62989444",
"0.62744915",
"0.6272533",
"0.6264759",
"0.624176",
"0.6220535",
"0.62150913",
"0.62150913",
"0.62112635",
"0.619933",
"0.6193657",
"0.6178013",
"0.61712474",
"0.6157102",
"0.61550325",
"0.6148602",
"0.6114364",
"0.6110451",
"0.61063904",
"0.6102997",
"0.6099615",
"0.6085473",
"0.607407",
"0.606678",
"0.6065369",
"0.6064826",
"0.6064826",
"0.6064826",
"0.6064826",
"0.6064826",
"0.6064826",
"0.6056104",
"0.6056104",
"0.6056104",
"0.6056104",
"0.6056104",
"0.6056104",
"0.6056104",
"0.6048113",
"0.60443777",
"0.6022847",
"0.60171306",
"0.6009206",
"0.6003514",
"0.5997212",
"0.59833455",
"0.59781253",
"0.59569865",
"0.59569865",
"0.59569865",
"0.59569865",
"0.59569865",
"0.59569865",
"0.59569865",
"0.59569865",
"0.59569865",
"0.5954719",
"0.5953406",
"0.5943356",
"0.59119296",
"0.5906548",
"0.59021896",
"0.59005606",
"0.5894221",
"0.5887429",
"0.5877107",
"0.5875071",
"0.58748204",
"0.5872871",
"0.5865223",
"0.5857694",
"0.5852271",
"0.5851577",
"0.58508015",
"0.5849411",
"0.5844198",
"0.5842504",
"0.5839456",
"0.5837403",
"0.58361405",
"0.58314794",
"0.5821019",
"0.58185893",
"0.5816728"
] | 0.6709892 | 3 |
Use callbacks to share common setup or constraints between actions. | def set_group
@group = Group.find_by(cod_id: params['id'])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] | 0.0 | -1 |
Only allow a trusted parameter "white list" through. | def group_params
params.require(:group).permit(:cod_id, :descr, :nom, :geometry)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def filtered_parameters; end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def valid_params?; end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def filter_parameters; end",
"def filter_parameters; end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def check_params; true; end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def list_params\n params.permit(:name)\n end",
"def check_params\n true\n end",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def additional_permitted_params\n []\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end",
"def allow_params_authentication!; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end",
"def quote_params\n params.permit!\n end",
"def list_params\n params.permit(:list_name)\n end",
"def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"def all_params; end",
"def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"def source_params\n params.require(:source).permit(all_allowed_params)\n end",
"def user_params\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end",
"def permitted_params\n @wfd_edit_parameters\n end",
"def user_params\r\n end",
"def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"def params_permit\n params.permit(:id)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def filter_params\n params.permit(*resource_filter_permitted_params)\n end",
"def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end",
"def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def argument_params\n params.require(:argument).permit(:name)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"def parameters\n nil\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end",
"def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end",
"def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end"
] | [
"0.7121987",
"0.70541996",
"0.69483954",
"0.6902367",
"0.6733912",
"0.6717838",
"0.6687021",
"0.6676254",
"0.66612333",
"0.6555296",
"0.6527056",
"0.6456324",
"0.6450841",
"0.6450127",
"0.6447226",
"0.6434961",
"0.64121825",
"0.64121825",
"0.63913447",
"0.63804525",
"0.63804525",
"0.6373396",
"0.6360051",
"0.6355191",
"0.62856233",
"0.627813",
"0.62451434",
"0.6228103",
"0.6224965",
"0.6222941",
"0.6210244",
"0.62077755",
"0.61762565",
"0.61711127",
"0.6168448",
"0.6160164",
"0.61446255",
"0.6134175",
"0.6120522",
"0.6106709",
"0.60981655",
"0.6076113",
"0.60534036",
"0.60410434",
"0.6034582",
"0.6029977",
"0.6019861",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.6019158",
"0.60184896",
"0.60157263",
"0.6005857",
"0.6003803",
"0.60012573",
"0.59955895",
"0.5994598",
"0.5993604",
"0.5983824",
"0.5983166",
"0.5977431",
"0.597591",
"0.5968824",
"0.5965953",
"0.59647584",
"0.59647584",
"0.59566855",
"0.59506303",
"0.5950375",
"0.59485626",
"0.59440875",
"0.5930872",
"0.5930206",
"0.5925668",
"0.59235454",
"0.5917905",
"0.59164816",
"0.5913821",
"0.59128743",
"0.5906617",
"0.59053683",
"0.59052664",
"0.5901591",
"0.58987755",
"0.5897456",
"0.58970183",
"0.58942604"
] | 0.0 | -1 |
GET /folha/fonte_recursos/1 GET /folha/fonte_recursos/1.xml | def show
@folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @folha_fonte_recurso }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @folha_fonte_recurso = Folha::FonteRecurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @folha_fonte_recurso }\n end\n end",
"def index\n @fontes_de_recurso = FonteDeRecurso.all\n end",
"def index\n @ficha_tematicas = FichaTematica.busqueda(params[:page], params[:generico], params[:buscar])\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ficha_tematicas }\n end\n end",
"def lista\n @receitas = Receita.all\n\n respond_to do |format|\n format.html # lista.html.erb\n format.xml { render :xml => @receitas }\n end\n end",
"def index\n @feria2010observaciones = Feria2010observacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2010observaciones }\n end\n end",
"def index\n @legislacions = Legislacion.busqueda(params[:page], params[:generico], params[:buscar], 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @legislacions }\n end\n end",
"def index\n @cuentas = Cuenta.all\n\n @cadena = getcuentasxml\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cadena }\n end\n end",
"def index\n @texte_accueils = TexteAccueil.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @texte_accueils }\n end\n end",
"def index\n @feria2009calificaciones = Feria2009calificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2009calificaciones }\n end\n end",
"def index\n @glosarios = Glosario.busqueda(params[:page],params[:generico], params[:buscar], 20)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @glosarios }\n end\n end",
"def index\n debugger\n @receitas = Receita.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @receitas }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_recibo }\n end\n end",
"def create\n @folha_fonte_recurso = Folha::FonteRecurso.new(params[:folha_fonte_recurso])\n\n respond_to do |format|\n if @folha_fonte_recurso.save\n format.html { redirect_to(@folha_fonte_recurso, :notice => 'Fonte recurso cadastrado com sucesso.') }\n format.xml { render :xml => @folha_fonte_recurso, :status => :created, :location => @folha_fonte_recurso }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @folha_fonte_recurso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @feria2009beneficiarios = Feria2009beneficiario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2009beneficiarios }\n end\n end",
"def index\n @clienteles = @paramun.clienteles\n\n respond_to do |format|\n if @clienteles.empty?\n format.xml { render request.format.to_sym => \"ccliErreurA\" } ## Aucune Clientele\n else \n format.xml { render xml: @clienteles }\n end\n end\n end",
"def show\n @orc_ficha = OrcFicha.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @orc_ficha }\n end\n end",
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @premios }\n end\n end",
"def show\n @compras_documento = ComprasDocumento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @compras_documento }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ciclos }\n end\n end",
"def index\n @tipo_restaurantes = TipoRestaurante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_restaurantes }\n end\n end",
"def index\n @feria2010beneficiarios = Feria2010beneficiario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feria2010beneficiarios }\n end\n end",
"def show\n @receita = Receita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @receita }\n end\n end",
"def show\n @receita = Receita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @receita }\n end\n end",
"def show\n @regiaos = Regiao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @regiaos }\n end\n end",
"def set_fonte_de_recurso\n @fonte_de_recurso = FonteDeRecurso.find(params[:id])\n end",
"def show\n @repasse_fabrica = RepasseFabrica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @repasse_fabrica }\n end\n end",
"def index\n @tipo_lancamentos = TipoLancamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_lancamentos }\n end\n end",
"def show\n @faixa_de_desconto = FaixaDeDesconto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @faixa_de_desconto }\n end\n end",
"def index\n @tipo_contas = TipoConta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_contas }\n end\n end",
"def show\n @ficha_tematica = FichaTematica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ficha_tematica }\n end\n end",
"def show\n @reclamacao = Reclamacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reclamacao }\n end\n end",
"def show\n @feria2010observacion = Feria2010observacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feria2010observacion }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @documentos }\n end\n end",
"def show\n @categoria_do_recebimento = CategoriaDoRecebimento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @categoria_do_recebimento }\n end\n end",
"def destroy\n @folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])\n @folha_fonte_recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(folha_fonte_recursos_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @tiposcontratos = Tiposcontrato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tiposcontratos }\n end\n end",
"def show\n @reputacao_veiculo = ReputacaoVeiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reputacao_veiculo }\n end\n end",
"def download_xml\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/tiendas_v1_es.xml\")\n\t\tresponse = Net::HTTP.get_response(uri)\n\t\tcontent = response.body\n\n\t\txml = REXML::Document.new(content)\n\n\t\treturn xml\n\tend",
"def show\n @reclamo = Reclamo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reclamo }\n end\n end",
"def show\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @situacoes_juridica }\n end\n end",
"def show\n @protocolo = Protocolo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @protocolo }\n end\n end",
"def show\n @texte_accueil = TexteAccueil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @texte_accueil }\n end\n end",
"def show\n @remocao = Remocao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @remocao }\n end\n end",
"def index\n @retiradas = Retirada.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @retiradas }\n end\n end",
"def index\n @lancamentos = Lancamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lancamentos }\n end\n end",
"def index\n @compras = Compra.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compras }\n end\n end",
"def show\n @reputacao_carona = ReputacaoCarona.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reputacao_carona }\n end\n end",
"def index\n @documentos = @externo.documentos.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @documentos }\n end\n end",
"def show\n @tipo_fuente = TipoFuente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_fuente }\n end\n end",
"def create\n @resultadoconsultum = Resultadoconsultum.new(resultadoconsultum_params)\n\t\n\n\trequire 'nokogiri'\n\t\n\t@doc = Nokogiri::XML(File.open(\"exemplos/emplo.xml\"))\n\n\tcar_tires = @doc.xpath(\"//firstname\")\n\t\n\tdoc = Nokogiri::XML(File.open(\"emplo.xml\"))\n\tdoc.xpath('firstname').each do\n\t\tcar_tires\n\tend\n\n\t \n respond_to do |format|\n if @resultadoconsultum.save\n format.html { redirect_to @resultadoconsultum, notice: car_tires }\n format.json { render :show, status: :created, location: @resultadoconsultum }\n else\n format.html { render :new }\n format.json { render json: @resultadoconsultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @repasse_fabrica = RepasseFabrica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repasse_fabrica }\n end\n end",
"def show\n @relatestagiario = Relatestagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @alimentos }\n end\n end",
"def show\n @tipo_restaurante = TipoRestaurante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_restaurante }\n end\n end",
"def show\n @lance_unico = LanceUnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lance_unico }\n end\n end",
"def show\n @tipo_de_documento = TipoDeDocumento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_de_documento }\n end\n end",
"def index\n @asistencias = Asistencia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @asistencias }\n end\n end",
"def show\n @arrendamientosprorroga = Arrendamientosprorroga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @arrendamientosprorroga }\n end\n end",
"def index\n @vehiculoscancelaciones = Vehiculoscancelacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vehiculoscancelaciones }\n end\n end",
"def new\n @orc_ficha = OrcFicha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @orc_ficha }\n end\n end",
"def index\n @calendarios_entrega = CalendarioEntrega.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @calendarios_entrega }\n end\n end",
"def show\n @feria2009calificacion = Feria2009calificacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feria2009calificacion }\n end\n end",
"def index\n @datos = Dato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @datos }\n end\n end",
"def show\n @frequencia_orgao = Frequencia::Orgao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb.erb\n format.xml { render :xml => @frequencia_orgao }\n end\n end",
"def show\n @contratosinterventoria = Contratosinterventoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contratosinterventoria }\n end\n end",
"def index\n @tipos_pagamentos = TiposPagamento.find(:all, :order => \"nome\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipos_pagamentos }\n end\n end",
"def index\n @categoria_comidas = CategoriaComida.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @categoria_comidas }\n end\n end",
"def show\n @convenio_financiamiento = ConvenioFinanciamiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @convenio_financiamiento }\n end\n end",
"def index\n \n @bibliografias = Bibliografia.busqueda(params[:page], params[:generico], params[:buscar], 20)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bibliografias }\n end\n end",
"def index\n @tarefas = @projeto.tarefas.all(:order => \"DtTermino\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tarefas }\n end\n end",
"def index\n @funcionarios = Funcionario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @funcionarios }\n end\n end",
"def show\n @calidadtiposdocumento = Calidadtiposdocumento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calidadtiposdocumento }\n end\n end",
"def index\n @familiares = @usuario.familiares.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @familiares }\n end\n end",
"def index # exibe todos os itens\n @restaurantes = Restaurante.all.order :id\n #Restaurante.order :id\n respond_to do |format|\n format.html\n format.xml{render xml: @restaurantes}\n format.json{render json: @restaurantes}\n end\n end",
"def show\n @crianca = Crianca.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @crianca }\n end\n end",
"def show\n @folha_financeiro = Folha::Financeiro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @folha_financeiro }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ciclo }\n end\n end",
"def new\n @reclamo = Reclamo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reclamo }\n end\n \n end",
"def index\n @typetaches = @paramun.typetaches\n\n respond_to do |format|\n if @typetaches.empty?\n format.xml { render request.format.to_sym => \"ttypErreurA0\" } ## Aucun Typetache collecté\n else\n format.xml { render xml: @typetaches }\n end\n end\n end",
"def index\n @search = TipoRecibo.search(params[:search])\n @tipo_recibos = @search.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erbb\n format.xml { render :xml => @tipo_recibos }\n end\n end",
"def index\n @frequencia_setores = Frequencia::Setor.order('updated_at ASC').paginate :page => params[:page], :per_page => 10\n @total = Frequencia::Setor.all.count\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @frequencia_setores }\n end\n end",
"def gerar_nfse\n #puts load_xml\n self.cliente_soap.call(:gerar_nfse, soap_action: \"http://nfse.goiania.go.gov.br/ws/GerarNfse\", message: { arquivo_xml: self.load_xml.to_s })\n end",
"def new\n @reclamacao = Reclamacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reclamacao }\n end\n end",
"def index\n @frequencia_orgaos = Frequencia::Orgao.order('updated_at ASC').paginate :page => params[:page], :per_page => 10\n @total = Frequencia::Orgao.all.count\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @frequencia_orgaos }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @departamento }\n end\n end",
"def show\n @requisicao = Requisicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @requisicao }\n end\n end",
"def new\n @ficha_tematica = FichaTematica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ficha_tematica }\n end\n end",
"def index\n @uitgelichts = Uitgelicht.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @uitgelichts }\n end\n end",
"def new\n @faixa_de_desconto = FaixaDeDesconto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @faixa_de_desconto }\n end\n end",
"def show\n @tipo_lancamento = TipoLancamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_lancamento }\n end\n end",
"def index\n @corporacion_policiacas = CorporacionPoliciaca.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @corporacion_policiacas }\n end\n end",
"def show\n @carrera = Carrera.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carrera }\n format.xml { render :xml => @carrera.to_xml }\n end\n end",
"def show\n @revenu = @foyer.revenus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revenu }\n end\n end",
"def index\n @poblacionesespeciales = Poblacionesespecial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @poblacionesespeciales }\n end\n end",
"def show\n @documento = @externo.documentos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @documento }\n end\n end",
"def show\n @coleccionista = Coleccionista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @coleccionista }\n end\n end",
"def respuesta_externa\n @comentario_root = @comentario.root\n @comentario_root.completa_info(@comentario_root.usuario_id)\n @especie_id = params[:especie_id] || 0 # Si es cero, es porque era un comentario general y lo cambiaron de tipo de comentario\n @ficha = (params[:ficha].present? && params[:ficha] == '1')\n\n # Si es una respuesta de usuario o es para mostrar en la ficha\n if (params[:created_at].present? && @comentario_root.created_at.strftime('%d-%m-%y_%H-%M-%S') != params[:created_at])\n render :file => '/public/404.html', :status => 404, :layout => false\n else\n\n @comentario_resp = @comentario\n cuantos = @comentario_root.descendant_ids.count\n categoriaContenido = @comentario.categorias_contenido_id\n\n #Esto es para que en el show se muestre el primer comentario ALWAYS (el seguro está en preguntar si resp.present?)\n @comentario_root.completa_info(@comentario_root.usuario_id)\n resp = [@comentario_root]\n\n if cuantos > 0\n resp = resp + @comentario.descendants.map{ |c|\n c.completa_info(@comentario_root.usuario_id)\n c\n }\n end\n\n # Como resp ya esta seteado desde arriba, ya no es necesario mandar uno distinto si cuantos == 0\n @comentarios = {estatus:1, cuantos: cuantos, resp: resp}\n\n # Para crear el comentario si NO es el render de la ficha\n if @ficha\n render 'show', layout: false\n else\n\n if Comentario::RESUELTOS.include?(@comentario_root.estatus) #Marcado como resuleto\n @sin_caja = true\n elsif Comentario::OCULTAR == @comentario_root.estatus # Marcado como eliminado\n @eliminado = true\n elsif Comentario::MODERADOR == @comentario_root.estatus # Marcado como eliminado\n @moderador = true\n else\n # Para saber el id del ultimo comentario, antes de sobreescribir a @comentario\n ultimo_comentario = @comentario_resp.subtree.order('ancestry ASC').map(&:id).reverse.first\n\n # Crea el nuevo comentario con las clases de la gema ancestry\n @comentario = Comentario.children_of(ultimo_comentario).new\n\n # Datos del usuario\n @comentario.usuario_id = @comentario_resp.usuario_id\n @comentario.nombre = @comentario_resp.nombre\n @comentario.correo = @comentario_resp.correo\n @comentario.institucion = @comentario.institucion\n\n # Estatus 6 quiere decir que es parte del historial de un comentario\n @comentario.estatus = Comentario::RESPUESTA\n\n # Categoria comentario ID\n @comentario.categorias_contenido_id = categoriaContenido\n\n # Caseta de verificacion\n @comentario.con_verificacion = true\n\n # Proviene de un administrador\n @comentario.es_admin = false\n\n # Si es una respuesta de un usuario\n @comentario.es_respuesta = true\n\n # Asigna la especie\n @comentario.especie_id = @comentario_resp.especie_id\n end # end si no es un comenatrio resuelto\n\n render 'show'\n\n end\n\n end\n end",
"def new\n @receita = Receita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @receita }\n end\n end",
"def new\n @feria2010observacion = Feria2010observacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feria2010observacion }\n end\n end",
"def index\n @recurso_servidors = RecursoServidor.all\n\n respond_to do |format| \n format.html\n format.pdf { \n render pdf: \"recursos\",\n footer: { center: \"[page] de [topage]\" },\n encoding: 'utf8',\n orientation: 'Landscape',\n page_size: 'A4',\n default_header: false,\n grayscale: false,\n enable_plugins: true,\n keep_relative_links: true,\n dpi: '300',\n print_media_type: true,\n no_pdf_compression: true,\n image_quality: 10,\n font_size: '30'\n }\n end\n end"
] | [
"0.67986166",
"0.6510254",
"0.64190376",
"0.6332299",
"0.62508994",
"0.6156716",
"0.61154336",
"0.6066128",
"0.6064156",
"0.6020125",
"0.5996897",
"0.5989245",
"0.5948115",
"0.5941834",
"0.59392554",
"0.5932778",
"0.592614",
"0.5925721",
"0.59229153",
"0.59220743",
"0.5918553",
"0.5909855",
"0.5909855",
"0.5898605",
"0.5877381",
"0.5866907",
"0.58653396",
"0.5857479",
"0.58407146",
"0.58351594",
"0.5832031",
"0.5814001",
"0.5811099",
"0.58019423",
"0.5784764",
"0.57770383",
"0.5772746",
"0.57705665",
"0.5761281",
"0.57458806",
"0.57384014",
"0.57362074",
"0.5733945",
"0.57236665",
"0.57175165",
"0.5712606",
"0.57000816",
"0.56867087",
"0.56848353",
"0.56804556",
"0.5673046",
"0.5670023",
"0.56643146",
"0.5660921",
"0.5659581",
"0.56593263",
"0.5651658",
"0.5647686",
"0.5647411",
"0.56450003",
"0.5642455",
"0.5640083",
"0.5639251",
"0.5622735",
"0.5613394",
"0.56074435",
"0.5605402",
"0.5605151",
"0.5602806",
"0.559277",
"0.5592463",
"0.55909014",
"0.5585216",
"0.55850625",
"0.55833495",
"0.55831254",
"0.55777335",
"0.55680346",
"0.5565793",
"0.5564952",
"0.5559348",
"0.55582345",
"0.55520666",
"0.55485505",
"0.554567",
"0.5539216",
"0.5537987",
"0.55283225",
"0.5525549",
"0.55250174",
"0.55206424",
"0.55188257",
"0.55177313",
"0.5513077",
"0.55127925",
"0.55112934",
"0.55082554",
"0.55064744",
"0.5506237",
"0.5502803"
] | 0.7212535 | 0 |
GET /folha/fonte_recursos/new GET /folha/fonte_recursos/new.xml | def new
@folha_fonte_recurso = Folha::FonteRecurso.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @folha_fonte_recurso }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @folha_fonte_recurso = Folha::FonteRecurso.new(params[:folha_fonte_recurso])\n\n respond_to do |format|\n if @folha_fonte_recurso.save\n format.html { redirect_to(@folha_fonte_recurso, :notice => 'Fonte recurso cadastrado com sucesso.') }\n format.xml { render :xml => @folha_fonte_recurso, :status => :created, :location => @folha_fonte_recurso }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @folha_fonte_recurso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @receita = Receita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @receita }\n end\n end",
"def new\n @regiaos = Regiao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @regiaos }\n end\n end",
"def new\n @repasse_fabrica = RepasseFabrica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repasse_fabrica }\n end\n end",
"def new\n @remocao = Remocao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @remocao }\n end\n end",
"def new\n @ficha_tematica = FichaTematica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ficha_tematica }\n end\n end",
"def new\n @protocolo = Protocolo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @protocolo }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nomina }\n end\n end",
"def new\n @reclamacao = Reclamacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reclamacao }\n end\n end",
"def new\n @orc_ficha = OrcFicha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @orc_ficha }\n end\n end",
"def new\n @compras_documento = ComprasDocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @compras_documento }\n end\n end",
"def new\n @feria2010observacion = Feria2010observacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feria2010observacion }\n end\n end",
"def new\n @tipo_fuente = TipoFuente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_fuente }\n end\n end",
"def new\n @tipo_contrato = TipoContrato.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_contrato }\n end\n end",
"def new\n @poblacionesespecial = Poblacionesespecial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poblacionesespecial }\n end\n end",
"def new\n @situacoes_juridica = SituacoesJuridica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @situacoes_juridica }\n end\n end",
"def new\n @crianca = Crianca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @crianca }\n end\n end",
"def new\n @contrato = Contrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contrato }\n end\n end",
"def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end",
"def new\n @faixa_de_desconto = FaixaDeDesconto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @faixa_de_desconto }\n end\n end",
"def new\n @reputacao_veiculo = ReputacaoVeiculo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reputacao_veiculo }\n end\n end",
"def new\n @reclamo = Reclamo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reclamo }\n end\n \n end",
"def new\n @coleccionista = Coleccionista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @coleccionista }\n end\n end",
"def new\n @contratosinterventoria = Contratosinterventoria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contratosinterventoria }\n end\n end",
"def new\n @texte_accueil = TexteAccueil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @texte_accueil }\n end\n end",
"def new\n @relatestagiario = Relatestagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def new\n @tiposcontrato = Tiposcontrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tiposcontrato }\n end\n end",
"def new\n @nostro = Nostro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nostro }\n end\n end",
"def new\n @tipo_de_documento = TipoDeDocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_de_documento }\n end\n end",
"def new\n @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @precio }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ciclo }\n end\n end",
"def new\n @curta = Curta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @curta }\n end\n end",
"def new\n @tipo_curso = TipoCurso.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_curso }\n end\n end",
"def new\n $flaggravaprof = 1\n @temposervico = TempoServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @temposervico }\n end\n end",
"def new\n @feria2009calificacion = Feria2009calificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feria2009calificacion }\n end\n end",
"def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @premio }\n end\n end",
"def new\n @reputacao_carona = ReputacaoCarona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reputacao_carona }\n end\n end",
"def new\n @tipo_conta = TipoConta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_conta }\n end\n end",
"def new\n @tipo_lancamento = TipoLancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_lancamento }\n end\n end",
"def new\n @tipo_recibo = TipoRecibo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_recibo }\n end\n end",
"def new\n @tservicio = Tservicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tservicio }\n end\n end",
"def new\n @arrendamientosprorroga = Arrendamientosprorroga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @arrendamientosprorroga }\n end\n end",
"def new\n @categoria_do_recebimento = CategoriaDoRecebimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @categoria_do_recebimento }\n end\n end",
"def new\n @titulacionesdoctipo = Titulacionesdoctipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @titulacionesdoctipo }\n end\n end",
"def new\n @documento = Documento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documento }\n end\n end",
"def new\n @ponto = Ponto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ponto }\n end\n end",
"def new\n @factura = Factura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @factura }\n end\n end",
"def new\n @tipo_restaurante = TipoRestaurante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_restaurante }\n end\n end",
"def new\n @tabela_preco_produto = TabelaPrecoProduto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tabela_preco_produto }\n end\n end",
"def new\n @prueba = Prueba.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prueba }\n end\n end",
"def new\n @calidadtiposdocumento = Calidadtiposdocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @calidadtiposdocumento }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"def new\n @pizarra = Pizarra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pizarra }\n end\n end",
"def new\n @colo = Colo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @colo }\n end\n end",
"def new\n @curso = Curso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @curso }\n end\n end",
"def new\n @pagare = Pagare.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagare }\n end\n end",
"def new\n @nossos_servico = NossosServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def new\n @formato = Formato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @formato }\n end\n end",
"def new\n @tiposproceso = Tiposproceso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tiposproceso }\n end\n end",
"def new\n @inscripcione = Inscripcione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inscripcione }\n end\n end",
"def new\n @questao = Questao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questao }\n end\n end",
"def new\n @proceso = Proceso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proceso }\n end\n end",
"def new\n @movimento = Movimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movimento }\n end\n end",
"def new\n @movimento = Movimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movimento }\n end\n end",
"def new\n @retirada = Retirada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retirada }\n end\n end",
"def new\n @pagamento = Pagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagamento }\n end\n end",
"def new\n @pagos_detalhe = PagosDetalhe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagos_detalhe }\n end\n end",
"def new\n @tcliente = Tcliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tcliente }\n end\n end",
"def new\n @lance_unico = LanceUnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lance_unico }\n end\n end",
"def new\n @folha_financeiro = Folha::Financeiro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @folha_financeiro }\n end\n end",
"def new\n @tipo_nota = TipoNota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_nota }\n end\n end",
"def new\n @tipo_proy = TipoProy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_proy }\n end\n end",
"def new\n @voto = Voto.new\n\n # respond_to do |format|\n # format.html # new.html.erb\n # format.xml { render :xml => @ponto }\n #end\n end",
"def new\n @convenio_financiamiento = ConvenioFinanciamiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @convenio_financiamiento }\n end\n end",
"def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end",
"def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end",
"def new\n @periodista = Periodista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @periodista }\n end\n end",
"def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"def new\n @lancamento = Lancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lancamento }\n end\n end",
"def new\n @documentoclasificacion = Documentoclasificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documentoclasificacion }\n end\n end",
"def new\n @tipo_controles = TipoControle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_controles }\n end\n end",
"def new\n @carro = Carro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @carro }\n end\n end",
"def new\n @historico = Historico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @historico }\n end\n end",
"def new\n @catena = Catena.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catena }\n end\n end",
"def new\n @tipo_iva = TipoIva.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_iva }\n end\n end",
"def new\n @tipo_pago = TipoPago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_pago }\n end\n end",
"def new\n @hcontrato = Hcontrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hcontrato }\n end\n end",
"def new\n @promocao = Promocao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @promocao }\n end\n end",
"def new\n @tipos_pagamento = TiposPagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipos_pagamento }\n end\n end",
"def create\n @fonte_de_recurso = FonteDeRecurso.new(fonte_de_recurso_params)\n\n respond_to do |format|\n if @fonte_de_recurso.save\n addlog(\"Fonte e recurso criada\")\n format.html { redirect_to @fonte_de_recurso, notice: 'Fonte de recurso criado com sucesso.' }\n format.json { render :show, status: :created, location: @fonte_de_recurso }\n else\n format.html { render :new }\n format.json { render json: @fonte_de_recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @tipo_lista = TipoLista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_lista }\n end\n end",
"def new\n @marcacaoponto = Marcacaoponto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @marcacaoponto }\n end\n end",
"def new\n @asambleista = Asambleista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asambleista }\n end\n end",
"def new\n @tipo_de_exercicio = TipoDeExercicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_de_exercicio }\n end\n end",
"def new\n @pagina = Pagina.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pagina }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @noticia = Noticia.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noticia }\n end\n end",
"def new\n @feria2014jefe = Feria2014jefe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feria2014jefe }\n end\n end",
"def create\n @regiaos = Regiao.new(params[:regiao])\n\n respond_to do |format|\n if @regiaos.save\n flash[:notice] = 'REGIÃO SALVA COM SUCESSO'\n format.html { redirect_to(new_regiao_path)}\n format.xml { render :xml => @regiaos, :status => :created, :location => @regiaos }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @regiaos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @glosario = Glosario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @glosario }\n end\n end"
] | [
"0.7165466",
"0.7123394",
"0.70717293",
"0.7062308",
"0.7053969",
"0.7014244",
"0.70023257",
"0.6994842",
"0.69882905",
"0.6973694",
"0.69653803",
"0.69608945",
"0.6924424",
"0.69081575",
"0.6904836",
"0.68923503",
"0.6881837",
"0.6872291",
"0.6868262",
"0.6864104",
"0.6863368",
"0.6858305",
"0.684157",
"0.68382907",
"0.6834788",
"0.6830247",
"0.68276364",
"0.6817086",
"0.68147457",
"0.68130195",
"0.6812638",
"0.6803004",
"0.6796771",
"0.6795973",
"0.67956",
"0.6794056",
"0.6792755",
"0.679063",
"0.6788388",
"0.6787697",
"0.6786892",
"0.6770249",
"0.676977",
"0.6759806",
"0.6759447",
"0.67585367",
"0.6757892",
"0.67506444",
"0.6749582",
"0.6748429",
"0.6748115",
"0.6743826",
"0.67413276",
"0.6734533",
"0.6733804",
"0.6733068",
"0.67298543",
"0.6729676",
"0.67275506",
"0.67181605",
"0.67170733",
"0.67119896",
"0.6709815",
"0.6709815",
"0.6705795",
"0.6703264",
"0.6697151",
"0.6695532",
"0.6688855",
"0.66873354",
"0.668178",
"0.6680898",
"0.66784936",
"0.6676485",
"0.66755396",
"0.66755396",
"0.66751385",
"0.66709465",
"0.667058",
"0.6668037",
"0.66665196",
"0.66568756",
"0.6654749",
"0.66536295",
"0.6648018",
"0.6647884",
"0.6646373",
"0.66456085",
"0.66399926",
"0.66303635",
"0.66274416",
"0.66230273",
"0.66217905",
"0.662052",
"0.661907",
"0.6618831",
"0.66120523",
"0.6611916",
"0.66114324",
"0.6611343"
] | 0.78595954 | 0 |
POST /folha/fonte_recursos POST /folha/fonte_recursos.xml | def create
@folha_fonte_recurso = Folha::FonteRecurso.new(params[:folha_fonte_recurso])
respond_to do |format|
if @folha_fonte_recurso.save
format.html { redirect_to(@folha_fonte_recurso, :notice => 'Fonte recurso cadastrado com sucesso.') }
format.xml { render :xml => @folha_fonte_recurso, :status => :created, :location => @folha_fonte_recurso }
else
format.html { render :action => "new" }
format.xml { render :xml => @folha_fonte_recurso.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @fonte_de_recurso = FonteDeRecurso.new(fonte_de_recurso_params)\n\n respond_to do |format|\n if @fonte_de_recurso.save\n addlog(\"Fonte e recurso criada\")\n format.html { redirect_to @fonte_de_recurso, notice: 'Fonte de recurso criado com sucesso.' }\n format.json { render :show, status: :created, location: @fonte_de_recurso }\n else\n format.html { render :new }\n format.json { render json: @fonte_de_recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @folha_fonte_recurso = Folha::FonteRecurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @folha_fonte_recurso }\n end\n end",
"def set_fonte_de_recurso\n @fonte_de_recurso = FonteDeRecurso.find(params[:id])\n end",
"def destroy\n @folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])\n @folha_fonte_recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(folha_fonte_recursos_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @fontes_de_recurso = FonteDeRecurso.all\n end",
"def destroy\n @fonte_de_recurso.destroy\n addlog(\"Fonte de recurso apagada\")\n respond_to do |format|\n format.html { redirect_to fontes_de_recurso_url, notice: 'Fonte de recurso apagado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def create\n @resultadoconsultum = Resultadoconsultum.new(resultadoconsultum_params)\n\t\n\n\trequire 'nokogiri'\n\t\n\t@doc = Nokogiri::XML(File.open(\"exemplos/emplo.xml\"))\n\n\tcar_tires = @doc.xpath(\"//firstname\")\n\t\n\tdoc = Nokogiri::XML(File.open(\"emplo.xml\"))\n\tdoc.xpath('firstname').each do\n\t\tcar_tires\n\tend\n\n\t \n respond_to do |format|\n if @resultadoconsultum.save\n format.html { redirect_to @resultadoconsultum, notice: car_tires }\n format.json { render :show, status: :created, location: @resultadoconsultum }\n else\n format.html { render :new }\n format.json { render json: @resultadoconsultum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @folha_fonte_recurso }\n end\n end",
"def create\n @regiaos = Regiao.new(params[:regiao])\n\n respond_to do |format|\n if @regiaos.save\n flash[:notice] = 'REGIÃO SALVA COM SUCESSO'\n format.html { redirect_to(new_regiao_path)}\n format.xml { render :xml => @regiaos, :status => :created, :location => @regiaos }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @regiaos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def fonte_de_recurso_params\n params.require(:fonte_de_recurso).permit(:nome)\n end",
"def update\n respond_to do |format|\n if @fonte_de_recurso.update(fonte_de_recurso_params)\n addlog(\"Fonte de recurso atualizada\")\n format.html { redirect_to @fonte_de_recurso, notice: 'Fonte de recurso atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @fonte_de_recurso }\n else\n format.html { render :edit }\n format.json { render json: @fonte_de_recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def lista\n @receitas = Receita.all\n\n respond_to do |format|\n format.html # lista.html.erb\n format.xml { render :xml => @receitas }\n end\n end",
"def create\n @reclamacao = Reclamacao.new(params[:reclamacao])\n\n respond_to do |format|\n if @reclamacao.save\n format.html { redirect_to(@reclamacao, :notice => 'Reclamacao was successfully created.') }\n format.xml { render :xml => @reclamacao, :status => :created, :location => @reclamacao }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reclamacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])\n\n respond_to do |format|\n if @folha_fonte_recurso.update_attributes(params[:folha_fonte_recurso])\n format.html { redirect_to(@folha_fonte_recurso, :notice => 'Fonte recurso atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @folha_fonte_recurso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @orc_ficha = OrcFicha.new(params[:orc_ficha])\n\n respond_to do |format|\n if @orc_ficha.save\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@orc_ficha) }\n format.xml { render :xml => @orc_ficha, :status => :created, :location => @orc_ficha }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @orc_ficha.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @objeto = Caracteristica.new(caracteristica_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Caracteristica was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def troca\n @remetente = Sobrevivente.where(id: params[:de]).first\n @destinatario = Sobrevivente.where(id: params[:para]).first\n\n enviar = {agua: 1, comida: 2, medicamento: 3, municao: 4}\n receber = {agua: 0, comida: 2, medicamento: 3, municao: 8}\n\n trocou = @remetente.troca(@destinatario, enviar, receber)\n\n render json: { status: trocou }\n end",
"def index\n @ficha_tematicas = FichaTematica.busqueda(params[:page], params[:generico], params[:buscar])\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ficha_tematicas }\n end\n end",
"def create\n @texte_accueil = TexteAccueil.new(params[:texte_accueil])\n\n respond_to do |format|\n if @texte_accueil.save\n flash[:notice] = 'TexteAccueil was successfully created.'\n format.html { redirect_to(root_path) }\n format.xml { render :xml => @texte_accueil, :status => :created, :location => @texte_accueil }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @texte_accueil.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @frais_repa = FraisRepa.new(params[:frais_repa])\n\n respond_to do |format|\n if @frais_repa.save\n format.html { redirect_to @frais_repa, :notice => 'Le frais de repas a bien été créé' }\n format.json { render :json => @frais_repa, :status => :created, :location => @frais_repa }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @frais_repa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @recurso = Recurso.new(recurso_params)\n\n respond_to do |format|\n if @recurso.save\n # flash.now[:notice] = 'El recurso fue creado con éxito.'\n @recursos = Recurso.order(\"descripcion\").to_a \n format.html { redirect_to :action => \"index\" }\n format.xml { render :xml => @recurso, :status => :created, :location => @recurso }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @recurso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@comprobante_de_compra = ComprobanteDeCompra.new(params[:comprobante_de_compra])\n\t\n\t\trespond_to do |format|\n\t\t\tif @comprobante_de_compra.save\n\t\t\t\tlinea = CuentaDeProveedor.new(\n\t\t\t\t\t:comprobante_de_compra_id => @comprobante_de_compra.id,\n\t\t\t\t\t:fecha => @comprobante_de_compra.fecha,\n\t\t\t\t\t:tipo => @comprobante_de_compra.tipo,\n\t\t\t\t\t:centro => @comprobante_de_compra.centro,\n\t\t\t\t\t:numero => @comprobante_de_compra.numero,\n\t\t\t\t\t:proveedor_id => @comprobante_de_compra.proveedor_id,\n\t\t\t\t\t:clase_valor => '',\n\t\t\t\t\t:lote_valor => 0,\n\t\t\t\t\t:numero_valor => 0,\n\t\t\t\t\t:fecha_valor => @comprobante_de_compra.fecha,\n\t\t\t\t\t:importe => @comprobante_de_compra.total,\n\t\t\t\t\t:tipo_aplicado => @comprobante_de_compra.tipo,\n\t\t\t\t\t:centro_aplicado => @comprobante_de_compra.centro,\n\t\t\t\t\t:numero_aplicado => @comprobante_de_compra.numero,\n\t\t\t\t\t:fecha_aplicado => @comprobante_de_compra.fecha,\n\t\t\t\t\t:vencimiento => @comprobante_de_compra.fecha,\n\t\t\t\t\t:detalle => @comprobante_de_compra.proveedor.nombre,\n\t\t\t\t\t:fec_grab => Date.today,\n\t\t\t\t\t:hor_grab => '',\n\t\t\t\t\t:wks_grab => '',\n\t\t\t\t\t:tip_grab => '',\n\t\t\t\t\t:usr_grab => '',\n\t\t\t\t\t:rec_grab => '')\n\t\t\t\tlinea.save\n\t\t\t\tformat.html { redirect_to(@comprobante_de_compra, :notice => 'ComprobanteDeCompra was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @comprobante_de_compra, :status => :created, :location => @comprobante_de_compra }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @comprobante_de_compra.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def gerar_nfse\n #puts load_xml\n self.cliente_soap.call(:gerar_nfse, soap_action: \"http://nfse.goiania.go.gov.br/ws/GerarNfse\", message: { arquivo_xml: self.load_xml.to_s })\n end",
"def create\n @situacoes_juridica = SituacoesJuridica.new(params[:situacoes_juridica])\n\n respond_to do |format|\n if @situacoes_juridica.save\n format.html { redirect_to(@situacoes_juridica, :notice => 'Situação jurídica cadastrada com sucesso.') }\n format.xml { render :xml => @situacoes_juridica, :status => :created, :location => @situacoes_juridica }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @situacoes_juridica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @reputacao_veiculo = ReputacaoVeiculo.new(params[:reputacao_veiculo])\n\n respond_to do |format|\n if @reputacao_veiculo.save\n format.html { redirect_to(@reputacao_veiculo, :notice => 'Voce reputou o veiculo com sucesso.') }\n format.xml { render :xml => @reputacao_veiculo, :status => :created, :location => @reputacao_veiculo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reputacao_veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @receita = Receita.new(params[:receita])\n\n respond_to do |format|\n if @receita.save\n flash[:notice] = 'Receita was successfully created.'\n format.html { redirect_to(@receita) }\n format.xml { render :xml => @receita, :status => :created, :location => @receita }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @receita.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n \n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n respond_to do |format|\n unless @selecciones.empty?\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n @orden = Orden.new(:direccion_entrega=>usuario_actual.direccion)\n t = Time.now\n fecha = t.strftime(\"%Y-%m-%d\")\n client = Savon::Client.new(\"http://192.168.1.121/DistribuidorFIF/webservices/servicio.php?wsdl\")\n preorden = \"<solicitud_pedido>\n <num_orden>001</num_orden>\n <nombre_comercio>Tukiosquito</nombre_comercio>\n <fecha_solicitud>\"+fecha.to_s+\"</fecha_solicitud>\n <nombre_cliente>\"+usuario_actual.nombre+\" \"+usuario_actual.apellido+\"</nombre_cliente>\n <direccion_comercio>\n <avenida>Sucre</avenida>\n <calle>-</calle>\n <edificio_casa>CC Millenium</edificio_casa>\n <local_apt>C1-15</local_apt>\n <parroquia>Leoncio Martinez</parroquia>\n <municipio>Sucre</municipio>\n <ciudad>Caracas</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_comercio>\n <direccion_destino>\n <avenida>Santa Rosa</avenida>\n <calle>Tierras Rojas</calle>\n <edificio_casa>Villa Magica</edificio_casa>\n <local_apt>69</local_apt>\n <parroquia> </parroquia>\n <municipio>Zamora</municipio>\n <ciudad>Cua</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_destino>\"\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n preorden = preorden+\"\n <articulo>\n <id>\"+p.id.to_s+\"</id>\n <descripcion>\"+p.descripcion+\"</descripcion>\n <peso>\"+p.peso.to_s+\"</peso>\n <cantidad>\"+seleccion.cantidad.to_s+\"</cantidad>\n <precio>\"+p.precio.to_s+\"</precio>\n </articulo>\"\n end\n preorden = preorden+\"</solicitud_pedido>\"\n response = client.request :ejemplo, body: { \"value\" => preorden } \n if response.success? \n respuesta = response.to_hash[:ejemplo_response][:return]\n datos = XmlSimple.xml_in(respuesta)\n end\n\n @precio_envio = datos[\"num_orden\"][0]\n #@arreglo = XmlSimple.xml_in('')\n #@xml = XmlSimple.xml_out(@arreglo, { 'RootName' => 'solicitud_pedido' })\n #url = 'http://192.168.1.101/Antonio/tukyosquito/proyecto/servicio/servicio.php'\n #cotizacion = SOAP::RPC::Driver.new(url)\n #cotizacion.add_method('obtener','asd')\n #tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n #@respuesta = cotizacion.obtener('123')\n format.html # new.html.erb\n else\n format.html { redirect_to carrito_path, notice: 'No tiene productos agregados al carro de compras para generar una orden.' }\n end\n end\n end",
"def create\n \n @ficha_doc = FichaDoc.new(ficha_doc_params)\n\n respond_to do |format|\n if @ficha_doc.save\n format.html { redirect_to @ficha_doc, notice: 'Creado ' }\n format.json { render :show, status: :created, location: @ficha_dos }\n else\n format.html { render :show }\n format.json { render json: @ficha_doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n \n #Cobro en el banco\n client = Savon::Client.new(\"http://localhost:3001/servicios/wsdl\")\n tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n total_pagar = params[:orden][:total]\n pago = '<Message>\n <Request>\n <numero_tdc>'+tdc.numero+'</numero_tdc>\n <nombre_tarjetahabiente>'+tdc.tarjetahabiente+'</nombre_tarjetahabiente>\n <fecha_vencimiento>'+tdc.mes_vencimiento+'/'+tdc.ano_vencimiento+'</fecha_vencimiento>\n <codigo_seguridad>'+tdc.codigo+'</codigo_seguridad>\n <tipo_tarjeta>'+tdc.tipo+'</tipo_tarjeta>\n <direccion_cobro>'+tdc.direccion+'</direccion_cobro>\n <total_pagar>'+total_pagar+'</total_pagar>\n <cuenta_receptora>'+cuenta_receptora+'</cuenta_receptora>\n </Request>\n </Message>'\n #response = client.request :verificar_pago, body: { \"value\" => pago } \n #if response.success?\n # data = response.to_hash[:verificar_pago_response][:value][:response].first\n # @respuesta = XmlSimple.xml_in(data)\n #end\n\n #NAMESPACE = 'pagotdc'\n #URL = 'http://localhost:8080/'\n #banco = SOAP::RPC::Driver.new(URL, NAMESPACE)\n #banco.add_method('verificar_pago', 'numero_tdc', 'nombre_tarjetahabiente', 'fecha_vencimiento', 'codigo_seguridad', 'tipo_tarjeta', 'direccion_cobro', 'total_pagar', 'cuenta_receptora')\n #\n \n #respuesta = banco.verificar_pago(tdc.numero, tdc.tarjetahabiente, tdc.mes_vencimiento.to_s+'/'+tdc.ano_vencimiento.to_s, tdc.codigo, tdc.tipo, params[:orden][:total], tdc.direccion)\n \n if true #respuesta.ack.eql?(0)\n params[:orden][:cliente_id] = usuario_actual.id\n params[:orden][:total] = Seleccion.precio_total(usuario_actual.id)\n params[:orden][:fecha_entrega] = \"0000-00-00\"\n @orden = Orden.new(params[:orden])\n \n if @orden.save\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n @venta = Venta.new(:producto_id=>p.id, \n :orden_id=>@orden.id,\n :categoria_id=>p.categoria_id, \n :cantidad=>seleccion.cantidad,\n :costo=>p.precio)\n @venta.save\n end\n \n Seleccion.vaciar_carro(usuario_actual.id)\n respond_to do |format|\n format.html { redirect_to ver_ordenes_path, notice: 'Orden generada correctamente.' }\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n end\n end\n else\n respond_to do |format|\n format.html { render action: \"new\", notice: respuesta.mensaje }\n end\n end\n end",
"def create\n @relatorios = Relatorio.new(params[:relatorio])\n\n respond_to do |format|\n if @relatorios.save\n flash[:notice] = 'RELATÓRIO CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@relatorios) }\n format.xml { render :xml => @relatorios, :status => :created, :location => @relatorios }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @relatorios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @reputacao_carona = ReputacaoCarona.new(params[:reputacao_carona])\n\n respond_to do |format|\n if @reputacao_carona.save\n format.html { redirect_to(@reputacao_carona, :notice => 'Voce reputou o carona com sucesso!') }\n format.xml { render :xml => @reputacao_carona, :status => :created, :location => @reputacao_carona }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reputacao_carona.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @restricao = Restricao.new(restricao_params)\n\n respond_to do |format|\n if @restricao.save\n format.html { redirect_to restricaos_path, notice: 'Restrição foi Criada com Sucesso!' }\n # format.json { render :show, status: :created, location: @restricao }\n else\n format.html { render :new }\n format.json { render json: @restricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @faixa_de_desconto = FaixaDeDesconto.new(params[:faixa_de_desconto])\n\n respond_to do |format|\n if @faixa_de_desconto.save\n flash[:notice] = 'FaixaDeDesconto was successfully created.'\n format.html { redirect_to(@faixa_de_desconto) }\n format.xml { render :xml => @faixa_de_desconto, :status => :created, :location => @faixa_de_desconto }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @faixa_de_desconto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @repasse_fabrica = RepasseFabrica.new(params[:repasse_fabrica])\n\n respond_to do |format|\n if @repasse_fabrica.save\n format.html { redirect_to(@repasse_fabrica, :notice => 'RepasseFabrica was successfully created.') }\n format.xml { render :xml => @repasse_fabrica, :status => :created, :location => @repasse_fabrica }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @repasse_fabrica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def eligiendo_documento\n screen_name(\"#{@task.class.to_s}/eligiendo_documento\")\n\n @frbr_work = create_source_document_template\n\n respond_to do |format|\n format.html { render action: \"eligiendo_documento\" }\n format.json { head :ok }\n end\n end",
"def corrigiendo_manualmente\n screen_name(\"#{@task.class.to_s}/corrigiendo_manualmente\")\n\n # Need a document\n check_for_target_document\n\n # Read it so we can display it\n @xml_text = get_dummy_text\n\n @am_result = AmResult.where(\"ot_id = #{@ot.id}\").order(\"run_date DESC\").first\n\n respond_to do |format|\n format.html { render action: \"corrigiendo_manualmente\" }\n format.json { head :ok }\n end\n end",
"def index\n @legislacions = Legislacion.busqueda(params[:page], params[:generico], params[:buscar], 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @legislacions }\n end\n end",
"def create\n @regraponto = Regraponto.new(regraponto_params)\n\n respond_to do |format|\n if @regraponto.save\n format.html { redirect_to @regraponto, notice: 'Regraponto was successfully created.' }\n format.json { render :show, status: :created, location: @regraponto }\n else\n format.html { render :new }\n format.json { render json: @regraponto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end",
"def pregoestitulosgrafico_params\n params.require(:pregoestitulosgrafico).permit(:pregoestitulo_id, :arquivo_id, :tempografico_id)\n end",
"def create\n @relatestagiario = Relatestagiario.new(params[:relatestagiario])\n\n respond_to do |format|\n if @relatestagiario.save\n flash[:notice] = 'RELATÓRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@relatestagiario) }\n format.xml { render :xml => @relatestagiario, :status => :created, :location => @relatestagiario }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @relatestagiario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n @frasco = Frasco.new(frasco_params)\n\n respond_to do |format|\n if @frasco.save\n format.html { redirect_to @frasco, notice: 'Frasco was successfully created.' }\n format.json { render :show, status: :created, location: @frasco }\n else\n format.html { render :new }\n format.json { render json: @frasco.errors, status: :unprocessable_entity }\n end\n end\n end",
"def especies\n\t\tbr = BusquedaRegion.new\n\t\tbr.params = params\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\tbr_guia = BusquedaRegion.new\n\t\t\t\tbr_guia.params = params\n\t\t\t\tbr_guia.valida_descarga_guia\n\t\t\t\t\n\t\t\t\tcache_filtros_ev\n\t\t\t\tbr.especies\n\t\t\t\t@resp = br.resp\n\t\t\t\t@valida_guia = br_guia.resp[:estatus]\n\t\t\tend\n\t\t\tformat.xlsx do\n\t\t\t\tbr.original_url = request.original_url\n\t\t\t\tbr.descarga_taxa_excel\n\t\t\t\trender json: br.resp\n\t\t\tend\n\t\t\tformat.json do\n\t\t\t\tif params[:guia] = \"1\"\n\t\t\t\t\tbr.original_url = request.original_url\n\t\t\t\t\tbr.valida_descarga_guia\n\t\t\t\t\t\n\t\t\t\t\tif br.resp[:estatus]\n\t\t\t\t\t\tbr.descarga_taxa_pdf\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\trender json: br.resp and return\n\t\t\t\telse\n\t\t\t\t\tbr.especies\n\t\t\t\t\trender json: br.resp and return\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tformat.pdf do\n\t\t\t\tbr = BusquedaRegion.new\n\t\t\t\tbr.params = params\n\t\t\t\t\n\t\t\t\tif params[:job].present? && params[:job] == \"1\"\n\t\t\t\t\tbr.original_url = request.original_url\n\t\t\t\t\tbr.valida_descarga_guia\n\t\t\t\t\t\n\t\t\t\t\tif br.resp[:estatus]\n\t\t\t\t\t\tbr.descarga_taxa_pdf\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\trender json: br.resp and return\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\tbr.descarga_taxa_pdf\n\t\t\t\t\t@resp = br.resp\n\t\t\t\t\t@url_enciclovida = request.url.gsub('/especies.pdf', '')\n\t\t\t\t\t\n\t\t\t\t\trender pdf: 'Guía de especies',\n\t\t\t\t\t layout: 'guias.pdf.erb',\n\t\t\t\t\t template: 'busquedas_regiones/guias/especies.pdf.erb',\n\t\t\t\t\t encoding: 'UTF-8',\n\t\t\t\t\t wkhtmltopdf: CONFIG.wkhtmltopdf_path,\n\t\t\t\t\t save_to_file: Rails.root.join('public','descargas_guias', params[:fecha], \"#{params[:nombre_guia]}.pdf\"),\n\t\t\t\t\t save_only: true,\n\t\t\t\t\t page_size: 'Letter',\n\t\t\t\t\t page_height: 279,\n\t\t\t\t\t page_width: 215,\n\t\t\t\t\t orientation: 'Portrait',\n\t\t\t\t\t disposition: 'attachment',\n\t\t\t\t\t disable_internal_links: false,\n\t\t\t\t\t disable_external_links: false,\n\t\t\t\t\t header: {\n\t\t\t\t\t\t\t html: {\n\t\t\t\t\t\t\t\t\t template: 'busquedas_regiones/guias/header.html.erb'\n\t\t\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t footer: {\n\t\t\t\t\t\t\t html: {\n\t\t\t\t\t\t\t\t\t template: 'busquedas_regiones/guias/footer.html.erb'\n\t\t\t\t\t\t\t },\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\trender json: { estatus: true } and return\n\t\t\t\tend\n\t\t\tend\n\t\t\n\t\tend\n\tend",
"def create\n @rego = Rego.new(rego_params)\n\n respond_to do |format|\n if @rego.save\n format.html { redirect_to @rego, notice: 'Rego was successfully created.' }\n format.json { render :show, status: :created, location: @rego }\n else\n format.html { render :new }\n format.json { render json: @rego.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n debugger\n @receita = Receita.new(params[:receita])\n\n respond_to do |format|\n if @receita.save\n flash[:notice] = 'Receita was successfully created.'\n format.html { redirect_to(@receita) }\n format.xml { render :xml => @receita, :status => :created, :location => @receita }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @receita.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @az_tr_text = AzTrText.new(params[:az_tr_text])\n @title = 'Новый шаблон текста технического задания'\n\n respond_to do |format|\n if @az_tr_text.save\n format.html { redirect_to(@az_tr_text, :notice => 'Шаблон текста успешно создан.') }\n format.xml { render :xml => @az_tr_text, :status => :created, :location => @az_tr_text }\n else\n prepare_default_data()\n format.html { render :action => \"new\" }\n format.xml { render :xml => @az_tr_text.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ficha_recinto = FichaRecinto.new(ficha_recinto_params)\n\n respond_to do |format|\n if @ficha_recinto.save\n format.html { redirect_to @ficha_recinto, notice: 'Ficha recinto was successfully created.' }\n format.json { render :show, status: :created, location: @ficha_recinto }\n else\n format.html { render :new }\n format.json { render json: @ficha_recinto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ficha_tematica = FichaTematica.new(params[:ficha_tematica])\n\n respond_to do |format|\n if @ficha_tematica.save\n flash[:notice] = 'FichaTematica se ha creado con exito.'\n format.html { redirect_to(admin_ficha_tematicas_url) }\n format.xml { render :xml => @ficha_tematica, :status => :created, :location => @ficha_tematica }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ficha_tematica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @cuitcheque = Cuitcheque.new(params[:cuitcheque])\n\n respond_to do |format|\n if @cuitcheque.save\n flash[:notice] = 'El los datos pertenecientes a dicho CUIT han sido cargados.'\n format.html { redirect_to(:controller => 'chequeterceros', :action => 'index', :page => (params[:valor][:page].to_i < 1 ? 1 : params[:valor][:page]), :monto => params[:valor][:monto]) } # vuelve a la pagina de consulta de cheques\n format.xml { render :xml => @cuitcheque, :status => :created, :location => @cuitcheque }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cuitcheque.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @receita = current_usuario.receitas.new(receita_params)\n\n respond_to do |format|\n if @receita.save\n format.html { redirect_to @receita, notice: 'Receita cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @receita }\n else\n format.html { render :new }\n format.json { render json: @receita.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @reuniao = Reuniao.new(reuniao_params)\n @pautum=Pautum.new\n @reuniao.pautum =@pautum\n @reuniao.atum=Atum.new\n @reuniao.status=\"Preparação\"\n @pautum.status=\"Preparação\"\n \n respond_to do |format|\n if @reuniao.save\n @pautum.titulo=@reuniao.titulo\n @pautum.save\n format.html { redirect_to @reuniao, notice: 'Reuniao was successfully created.' }\n format.json { render :show, status: :created, location: @reuniao }\n else\n format.html { render :new }\n format.json { render json: @reuniao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @detalle_documento_de_compra = DetalleDocumentoDeCompra.new(detalle_documento_de_compra_params)\n\n respond_to do |format|\n if @detalle_documento_de_compra.save\n format.html { redirect_to @detalle_documento_de_compra, notice: 'Detalle documento de compra was successfully created.' }\n format.json { render :show, status: :created, location: @detalle_documento_de_compra }\n else\n format.html { render :new }\n format.json { render json: @detalle_documento_de_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @repasse_fabrica = RepasseFabrica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repasse_fabrica }\n end\n end",
"def regraponto_params\n params.require(:regraponto).permit(:nome_regra)\n end",
"def new\n @orc_ficha = OrcFicha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @orc_ficha }\n end\n end",
"def index\n @texte_accueils = TexteAccueil.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @texte_accueils }\n end\n end",
"def cofre_params\n params.require(:cofre).permit(:data, :dineiro, :moeda, :chqvista, :dolares, :euros)\n end",
"def new\n @texte_accueil = TexteAccueil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @texte_accueil }\n end\n end",
"def ajouterTexte(font,texte,couleur,position)\r\n\t\ttexte = GLib.convert(texte, \"ISO-8859-15\", \"UTF-8\") #Conversion de l'UTF8 vers ISO-8859-15\r\n\t\tposition = @justification[position]\r\n\t\t\r\n\t\tr = couleur.red.to_i / 256\r\n\t\tv = couleur.green.to_i / 256\r\n\t\tb = couleur.blue.to_i / 256\r\n\t\t\r\n\t\tvaleur = ((b * 256) + v) * 256 + r\t\r\n\t\t\r\n\t\t\r\n\t\tf = font.split()\r\n\t\t\r\n\t\ttaille = f.pop().to_i\r\n\t\tstylePolice = f.pop() if f.include?(\"Bold\") || f.include?(\"Italic\") || f.include?(\"Bold Italic\")\r\n\t\tpolice = f.join(\" \")\r\n\t\t\r\n\t\ttailleDefaut = taille\r\n\t\t\r\n\t\ttab = []\r\n\t\t\r\n\t\tr = %r{(<big>.*</big>)|(<small>.*</small>)|(<span size=.*>.*</span>)}\r\n\t\ttexte.split(r).each do |c|\r\n\t\t\tif %r{<big>(.*)</big>}.match(c)\r\n\t\t\t\ttexte = $1\r\n\t\t\t\ttaille = tailleDefaut + 2\r\n\t\t\telsif %r{<small>(.*)</small>}.match(c)\r\n\t\t\t\ttexte = $1\r\n\t\t\t\ttaille = tailleDefaut - 2\r\n\t\t\telsif %r{<span size=\\\"(x{1,2})-large\\\">(.*)</span>}.match(c)\r\n\t\t\t\tcase $1\r\n\t\t\t\t\twhen \"x\"\r\n\t\t\t\t\t\ttaille = 22\r\n\t\t\t\t\twhen \"xx\"\r\n\t\t\t\t\t\ttaille = 26\r\n\t\t\t\tend\r\n\t\t\t\ttexte = $2\r\n\t\t\telse\r\n\t\t\t\ttaille = tailleDefaut\r\n\t\t\t\ttexte = c\r\n\t\t\tend\r\n\t\t\ttab << [texte,taille]\r\n\t\tend\r\n\t\r\n\t\tre = %r{(<u>.*</u>)|(<b>.*</b>)|(<i>.*</i>)|(<s>.*</s>)}\r\n\t\ttab.each do |t|\r\n\t\t\tt[0].split(re).each do |d|\r\n\t\t\t\tif %r{<u>(.*)</u>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.Underline = true\r\n\t\t\t\telsif %r{<b>(.*)</b>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.Bold = true\r\n\t\t\t\telsif %r{<i>(.*)</i>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.Italic = true\r\n\t\t\t\telsif %r{<s>(.*)</s>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.StrikeThrough = true\r\n\t\t\t\telse\r\n\t\t\t\t\ts = d\r\n\t\t\t\t\t@word.Selection.Font.Underline = false\r\n\t\t\t\t\t@word.Selection.Font.Bold = false\r\n\t\t\t\t\t@word.Selection.Font.Italic = false\r\n\t\t\t\t\t@word.Selection.Font.StrikeThrough = false\r\n\t\t\t\tend\r\n\t\t\t\t\r\n\t\t\t\t@word.Selection.Font.Bold = true if stylePolice == \"Bold\" || stylePolice == \"Bold Italic\"\r\n\t\t\t\t@word.Selection.Font.Italic = true if stylePolice == \"Italic\" || stylePolice == \"Bold Italic\"\r\n\t\t\t\t@word.Selection.Font.Name = police\r\n\t\t\t\t@word.Selection.Font.Size = t[1]\r\n\t\t\t\t@word.Selection.Font.Color = valeur\r\n\t\t\t\t@word.Selection.ParagraphFormat.Alignment = position\r\n\t\t\t\t@word.Selection.TypeText(s)\r\n\t\t\t\t\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"def setorden\n @xml = params[:solicitud]\n @arreglo = Orden.validarRemota(@xml)\n if !(@arreglo.nil?)\n # @cliente = Persona.new(@xml[:cliente])\n # @cliente.save\n\n # @tarjeta = @xml[:tarjeta]\n # @tarjeta = TipoPago.new(@tarjeta)\n # @tarjeta.personas_id = @cliente.id\n # @tarjeta.save\n\n # @recoleccion = Direccion.new(@xml[:direccionrecoleccion])\n @entrega = Direccion.new(@xml[:direccionentrega])\n # @recoleccion.save\n @entrega.save\n\n @orden = Orden.new(@xml[:orden])\n @orden.estado = 'Pendiente por recolectar'\n @orden.personas_id= @arreglo[0]\n @orden.save\n\n @paquete = Paquete.new(@xml[:paquete])\n @paquete.ordens_id = @orden.id\n @paquete.personas_id = @arreglo[0]\n @paquete.save\n\n @historico1= Historico.new(:ordens_id => @orden.id, :direccions_id => @arreglo[2], :tipo => 'Recolectada')\n @historico= Historico.new(:ordens_id => @orden.id, :direccions_id => @entrega.id, :tipo => 'Entregada')\n @historico1.save\n @historico.save\n \n @monto = Enviar.montoTotal(@orden.id)\n @iva = (@monto * 0.12).round(2)\n @montototal = @monto + @iva\n Enviar.compania\n @factura = Factura.new(:companias_id => 1, :ordens_id =>@orden.id , :tipo_pagos_id => @arreglo[1] , :costoTotal => @monto ,:iva => @iva)\n @factura.save\n else\n render \"errorxml\"\n end\n end",
"def create\n @objeto = Carpeta.new(carpeta_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Carpeta was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @feria2010observacion = Feria2010observacion.new(params[:feria2010observacion])\n\n respond_to do |format|\n if @feria2010observacion.save\n format.html { redirect_to(@feria2010observacion, :notice => 'Feria2010observacion was successfully created.') }\n format.xml { render :xml => @feria2010observacion, :status => :created, :location => @feria2010observacion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @feria2010observacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @glosarios = Glosario.busqueda(params[:page],params[:generico], params[:buscar], 20)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @glosarios }\n end\n end",
"def create\n @restaurantes_proximo = RestaurantesProximo.new(restaurantes_proximo_params)\n\n respond_to do |format|\n if @restaurantes_proximo.save\n format.html { redirect_to @restaurantes_proximo, notice: 'Restaurantes proximo was successfully created.' }\n format.json { render :show, status: :created, location: @restaurantes_proximo }\n else\n format.html { render :new }\n format.json { render json: @restaurantes_proximo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @recaudacion = Recaudacion.new(recaudacion_params)\n\n respond_to do |format|\n if @recaudacion.save\n format.html { redirect_to @recaudacion, notice: 'Recaudacion was successfully created.' }\n format.json { render :show, status: :created, location: @recaudacion }\n else\n format.html { render :new }\n format.json { render json: @recaudacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reclamacao_params\r\n params.require(:reclamacao).permit(:titulo, :texto, :cat_problema, :nome_empresa)\r\n end",
"def marcarubro \n @marcarubro = Listaprecio.agrupamiento\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @marcarubro }\n format.pdf { render :layout => false }\n end\n end",
"def create\n\n respond_to do |format|\n if @nomina.save\n @nomina.generate_pdf_text(self)\n @nomina.save\n format.html { redirect_to(@nomina, :notice => t(\"screens.notice.successfully_created\")) }\n format.xml { render :xml => @nomina, :status => :created, :location => @nomina }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nomina.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @rendezvouz = Rendezvouz.new(params[:rendezvouz])\n\n respond_to do |format|\n if @rendezvouz.save\n flash[:notice] = 'Rendezvouz was successfully created.'\n format.html { redirect_to(@rendezvouz) }\n format.xml { render :xml => @rendezvouz, :status => :created, :location => @rendezvouz }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rendezvouz.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @recoleccion = Recoleccion.new(recoleccion_params)\n\n respond_to do |format|\n if @recoleccion.save\n format.html { redirect_to @recoleccion, notice: 'Recoleccion was successfully created.' }\n format.json { render :show, status: :created, location: @recoleccion }\n else\n format.html { render :new }\n format.json { render json: @recoleccion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def recaudacion_params\n params.require(:recaudacion).permit(:fechar, :horar, :nromaquinar, :rellenoini, :valorr, :monedafr, :rellenofin, :totalr, :totalfr)\n end",
"def create\n @remocao = Remocao.new(params[:remocao])\n @remocao.ano_letivo = $data\n @remocao.professor_id = $id_professor\n respond_to do |format|\n if @remocao.save\n flash[:notice] = 'PROFESSOR INSERIDO EM REMOÇÃO.'\n format.html { redirect_to(@remocao) }\n format.xml { render :xml => @remocao, :status => :created, :location => @remocao }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @remocao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_de_documento = TipoDeDocumento.new(params[:tipo_de_documento])\n\n respond_to do |format|\n if @tipo_de_documento.save\n format.html { redirect_to(@tipo_de_documento, :notice => 'Tipo de documento cadastrado com sucesso.') }\n format.xml { render :xml => @tipo_de_documento, :status => :created, :location => @tipo_de_documento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tipo_de_documento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @reparticao = Reparticao.new(reparticao_params)\n\n respond_to do |format|\n if @reparticao.save\n format.html { redirect_to @reparticao, notice: 'Reparticao was successfully created.' }\n format.json { render :show, status: :created, location: @reparticao }\n else\n format.html { render :new }\n format.json { render json: @reparticao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @regiaos = Regiao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @regiaos }\n end\n end",
"def create\n @feria2009calificacion = Feria2009calificacion.new(params[:feria2009calificacion])\n\n respond_to do |format|\n if @feria2009calificacion.save\n format.html { redirect_to(@feria2009calificacion, :notice => 'Feria2009calificacion was successfully created.') }\n format.xml { render :xml => @feria2009calificacion, :status => :created, :location => @feria2009calificacion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @feria2009calificacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @ficha_tematica = FichaTematica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ficha_tematica }\n end\n end",
"def create\r\n\r\n respond_to do |format|\r\n if @electronica_consejero.save\r\n format.html { redirect_to @electronica_consejero, notice: 'Se añadió un nombre de consejero de ingeniería electrónica correctamente.' }\r\n format.json { render :show, status: :created, location: @electronica_consejero }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @electronica_consejero.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @entradas = Entrada.new(params[:entrada])\n\n respond_to do |format|\n if @entradas.save\n flash[:notice] = 'LANÇAMENTO ENTRADA EFETUADO'\n format.html { redirect_to(homes_path) }\n format.xml { render :xml => @entradas, :status => :created, :location => @entradas }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entradas.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n#@parametro = params[:image_file].original_filename\n\n @documento = Documento.new(params[:documento])\n @documento.estado = 'INCOMPLETO'\n\n # Si el documento no es evaluado, eliminar la nota\n unless params[:documento][:tipo_documento_id].to_i.between?(1,2)\n @documento.calificacion = 0 \n end\n\n # Crear autores, tutores y jurados\n crear_autores(@documento,params)\n crear_tutores(@documento,params)\n crear_jurados(@documento,params)\n\n # Inicializar el estado del documento a NUEVO\n @documento.estado_documento_id = NUEVO\n\n # Almacenar titulo_texto_plano\n @documento.titulo_texto_plano = ActionController::Base.helpers.strip_tags(params[:documento][:titulo])\n\n # Almacenar resumen_texto_plano\n @documento.resumen_texto_plano = ActionController::Base.helpers.strip_tags(params[:documento][:resumen])\n\n # Variables para preservar los valores de los text-field autocompletados\n @autor1 = @documento.personas_autor.first\n @autor2 = @documento.personas_autor.second\n @tutor1 = @documento.personas_tutor.first\n @tutor2 = @documento.personas_tutor.second\n @jurado1 = @documento.personas_jurado.first\n @jurado2 = @documento.personas_jurado.second\n\n @documento.descargas = 0\n\n respond_to do |format|\n if @documento.save\n #@documento.update_attributes( :paginas => Utilidades::contar_paginas(@documento.publicacion.path))\n #format.html { redirect_to @documento, notice: 'Documento creado' }\n format.html { redirect_to \"/subir_archivo/#{@documento.id}\" }\n format.json { render json: @documento, status: :created, location: @documento }\n else\n format.html { render :action => \"new\", :layout => !request.xhr? }\n #render action: \"new\", notice: \"prueba_notice\", }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @compras_documento = ComprasDocumento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @compras_documento }\n end\n end",
"def create\n @revenu = @foyer.revenus.build(params[:revenu])\n\n respond_to do |format|\n if @revenu.save\n flash[:notice] = 'Revenu a bien été rajouté.'\n format.html { redirect_to foyer_revenus_url(@foyer) }\n format.xml { render :xml => @revenu, :status => :created, :location => @revenu }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @revenu.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def grabar_concesionario\n # puts 'AQUI'\n @concesionario = Concesionario_vehiculos.new\n @usuario = Usuario.new\n @rif=params[:rif]\n @nombre=params[:nombre]\n @correo=params[:correo]\n @telefono=params[:telefono]\n @ciudad=params[:ciudad]\n @direccion=params[:direccion]\n @marca=params[:marca]\n #------\n @nombre_usuario=params[:nombre_usuario]\n @contrasena=params[:contrasena]\n # puts ''+@nombre_usuario+''\n @usuario.grabar_usuario_concesionario(@nombre_usuario, @contrasena);\n # puts '+++++++++++++++++++++++++++++++++++++++++++++++++++++++metio usuario'\n @concesionario.grabar_concesionario(@rif,@nombre,@correo,@telefono,@ciudad,@direccion,@marca,@nombre_usuario)\n render :text => $tirajson\n end",
"def create\n #Parámetros permitidos.\n pago_params\n\n #Asignación de variables.\n fact = params[:pago][:factura_id]\n fecha = params[:pago][:fechapago]\n factura = Factura.find_by(id: fact)\n\n #Editar pago.\n @pago = Pago.new\n @pago.factura_id = fact\n @pago.fechapago = fecha\n @pago.monto = factura.total\n\n respond_to do |format|\n if @pago.save\n #Inserción en la cuenta corriente cliente por el haber.\n ctactecli = Ctactecli.find_by(cliente_id: factura.cliente_id)\n detallectactecli = Detallectactecli.new\n detallectactecli.ctactecli_id = factura.cliente_id\n detallectactecli.fechadetalle = Date.today\n detallectactecli.tipodetalle = 'Crédito por factura'\n detallectactecli.haber = factura.total\n detallectactecli.save\n ctactecli.saldo = ctactecli.saldo - factura.total\n ctactecli.save\n\n format.json { render :show, status: :created, location: @pago }\n puts'Pago guardado'\n #format.html { redirect_to @pago, notice: 'Pago was successfully created.' }\n else\n format.json { render json: @pago.errors, status: :unprocessable_entity }\n puts'Pago no guardado'\n #format.html { render :new }\n end\n end\n end",
"def create\n @tipo_restaurante = TipoRestaurante.new(params[:tipo_restaurante])\n\n respond_to do |format|\n if @tipo_restaurante.save\n format.html { redirect_to(@tipo_restaurante, :notice => 'Tipo restaurante was successfully created.') }\n format.xml { render :xml => @tipo_restaurante, :status => :created, :location => @tipo_restaurante }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tipo_restaurante.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @protocolo = Protocolo.new(params[:protocolo])\n\n respond_to do |format|\n if @protocolo.save\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@protocolo) }\n format.xml { render :xml => @protocolo, :status => :created, :location => @protocolo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @protocolo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def responder_documento_analista\n sleep (3)\n\n responder_button.click\n\n @responsavel_envio = \"VERONIQUE\"\n\n puts 'Respondendo documento'\n \n @tipo = \"E-mail\"\n @unidade = \"INTERPOL/CGCI/DIREX/PF\"\n @sigilo = \"Ostensivo\"\n @email = \"meramos@stefanini.com\"\n @assunto = \"Teste\"\n @texto = \"Teste\"\n @responsavel_envio = \"VERONIQUE\"\n @providencia = \"Teste\"\n sleep(0.5)\n tipo_select.select(@tipo)\n sleep(0.5)\n unidade_select.click.select(@unidade)\n sleep(1)\n sigilo_select.select(@sigilo)\n sleep(0.5)\n\n email_input.set(@email).send_keys(:tab)\n sleep(1)\n adicionar_destinatario.click\n wait_until_aguardar_load_invisible\n sleep(0.5)\n anexar_arquivo\n sleep(0.5)\n assunto_textarea.set(@assunto)\n texto_textarea.set(@texto)\n sleep(0.5)\n\n responsavel_envio_select2.select(@responsavel_envio)\n assinatura_radio2[0].click\n sleep(0.5)\n providencia_textarea.set(@providencia)\n salvar_button.click\n sleep(1)\n wait_until_aguardar_load_invisible\n botao_ok\n sair\n sleep(1)\n end",
"def create\n @prueba = Prueba.new(prueba_params)\n\n cantidadAlmacenada = @prueba.cantidad_almacenada\n cantidadDesechada = @prueba.cantidad_desechada\n\n @prueba.cantidad = cantidadAlmacenada + cantidadDesechada \n\n respond_to do |format|\n if @prueba.save\n\n @etiqueta = Etiqueta.new\n\n etiquetaAnalisis = @prueba.etiqueta.etiqueta\n idAnalisis = @prueba.id\n idAnalisisString = idAnalisis.to_s\n\n @etiqueta.etiqueta = etiquetaAnalisis + idAnalisisString + \"-\"\n @etiqueta.formato_id = 2\n @etiqueta.save\n\n format.html { redirect_to etiqueta_mostrar_path(@etiqueta.id), notice: 'Prueba was successfully created.' }\n format.json { render :show, status: :created, location: @prueba }\n else\n format.html { render :new }\n format.json { render json: @prueba.errors, status: :unprocessable_entity }\n end\n end\n end",
"def inicio\n cadena = 'Content-Type: text/html; charset=utf-8\\n\\n'\n cadena << '<!DOCTYPE html>'\n cadena << \"<html lang='es'>\"\n end",
"def create\n @orc_nota_fiscal_iten = OrcNotaFiscalIten.new(params[:orc_nota_fiscal_iten])\n\n respond_to do |format|\n if @orc_nota_fiscal_iten.save\n flash[:notice] = 'SALVO COM SUCESSO..'\n format.html { redirect_to(@orc_nota_fiscal_iten) }\n format.xml { render :xml => @orc_nota_fiscal_iten, :status => :created, :location => @orc_nota_fiscal_iten }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @orc_nota_fiscal_iten.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n\r\n respond_to do |format|\r\n if @electrica_consejero.save\r\n format.html { redirect_to @electrica_consejero, notice: 'Se añadió un nombre de consejero de ingeniería eléctrica correctamente.' }\r\n format.json { render :show, status: :created, location: @electrica_consejero }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @electrica_consejero.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def new\n @reclamacao = Reclamacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reclamacao }\n end\n end",
"def create\n @retirada = Retirada.new(params[:retirada])\n\n respond_to do |format|\n if @retirada.save\n flash[:notice] = 'Retirada incluida com sucesso.'\n format.html { redirect_to(@retirada) }\n format.xml { render :xml => @retirada, :status => :created, :location => @retirada }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @retirada.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def repasgcc_params\n params.require(:repasgcc).permit(:titre, :adresse, :date_repas, :date_lim, :repas1_enf, :r1e_tarif, :repas2_enf, :r2e_tarif, :repas1_ad, :r1a_tarif, :repas2_ad, :r2a_tarif)\n end",
"def create\n @regra = Regra.new(regra_params)\n\n respond_to do |format|\n if @regra.save\n format.html { redirect_to @regra, notice: 'Regra was successfully created.' }\n format.json { render :show, status: :created, location: @regra }\n else\n format.html { render :new }\n format.json { render json: @regra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @rubro.save\n format.html { redirect_to(@rubro, :notice => \"Se creó el rubro #{@rubro.nombre}.\") }\n format.xml { render :xml => @rubro, :status => :created, :location => @rubro }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rubro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @arrendamientosprorroga = Arrendamientosprorroga.new(params[:arrendamientosprorroga])\n\n respond_to do |format|\n if @arrendamientosprorroga.save\n format.html { redirect_to(@arrendamientosprorroga, :notice => 'Arrendamientosprorroga was successfully created.') }\n format.xml { render :xml => @arrendamientosprorroga, :status => :created, :location => @arrendamientosprorroga }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @arrendamientosprorroga.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @requisicion = Requisicion.new(params[:requisicion])\n\n respond_to do |format|\n if @requisicion.save\n format.html { redirect_to(@requisicion, :notice => 'Requisicion was successfully created.') }\n format.xml { render :xml => @requisicion, :status => :created, :location => @requisicion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @requisicion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @reputacao_carona = ReputacaoCarona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reputacao_carona }\n end\n end",
"def create\n @tipo_controles = TipoControle.new(params[:tipo_controle])\n\n respond_to do |format|\n if @tipo_controles.save\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@tipo_controles) }\n format.xml { render :xml => @tipo_controles, :status => :created, :location => @tipo_controle }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tipo_controles.errors, :status => :unprocessable_entity }\n end\n end\n end"
] | [
"0.6576212",
"0.6546346",
"0.5989254",
"0.59138715",
"0.5829405",
"0.5679341",
"0.5659937",
"0.5561227",
"0.5525281",
"0.54951185",
"0.5408069",
"0.54039514",
"0.5390445",
"0.53696644",
"0.53580695",
"0.5331035",
"0.53213084",
"0.5311783",
"0.52930653",
"0.52399963",
"0.52396196",
"0.5234692",
"0.52198726",
"0.5203162",
"0.5203001",
"0.51813614",
"0.5171325",
"0.5167327",
"0.51659226",
"0.5148551",
"0.5133178",
"0.51171577",
"0.51106375",
"0.510566",
"0.5096751",
"0.5096354",
"0.5084675",
"0.5081573",
"0.5079378",
"0.50738823",
"0.50593233",
"0.505616",
"0.5054392",
"0.503909",
"0.5038619",
"0.5031567",
"0.50189734",
"0.501322",
"0.5011068",
"0.5005424",
"0.49965167",
"0.4986243",
"0.4980829",
"0.49622273",
"0.49615732",
"0.49581218",
"0.49558637",
"0.49539196",
"0.49380177",
"0.49335137",
"0.49313313",
"0.49294445",
"0.4913005",
"0.4909837",
"0.49098098",
"0.49072832",
"0.49070823",
"0.49000856",
"0.4899756",
"0.48912874",
"0.48888716",
"0.48789832",
"0.48766828",
"0.4874769",
"0.48626885",
"0.48588088",
"0.48542783",
"0.48525673",
"0.48458862",
"0.48432264",
"0.48339805",
"0.48326403",
"0.48256758",
"0.48172525",
"0.48166677",
"0.48149008",
"0.48114535",
"0.480875",
"0.48082957",
"0.48074526",
"0.4803331",
"0.4800729",
"0.4796232",
"0.4791787",
"0.47915316",
"0.47864547",
"0.47854525",
"0.4780642",
"0.47798997",
"0.47730345"
] | 0.7028034 | 0 |
PUT /folha/fonte_recursos/1 PUT /folha/fonte_recursos/1.xml | def update
@folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])
respond_to do |format|
if @folha_fonte_recurso.update_attributes(params[:folha_fonte_recurso])
format.html { redirect_to(@folha_fonte_recurso, :notice => 'Fonte recurso atualizado com sucesso.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @folha_fonte_recurso.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @fonte_de_recurso.update(fonte_de_recurso_params)\n addlog(\"Fonte de recurso atualizada\")\n format.html { redirect_to @fonte_de_recurso, notice: 'Fonte de recurso atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @fonte_de_recurso }\n else\n format.html { render :edit }\n format.json { render json: @fonte_de_recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @folha_fonte_recurso = Folha::FonteRecurso.new(params[:folha_fonte_recurso])\n\n respond_to do |format|\n if @folha_fonte_recurso.save\n format.html { redirect_to(@folha_fonte_recurso, :notice => 'Fonte recurso cadastrado com sucesso.') }\n format.xml { render :xml => @folha_fonte_recurso, :status => :created, :location => @folha_fonte_recurso }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @folha_fonte_recurso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_fonte_de_recurso\n @fonte_de_recurso = FonteDeRecurso.find(params[:id])\n end",
"def destroy\n @folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])\n @folha_fonte_recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(folha_fonte_recursos_url) }\n format.xml { head :ok }\n end\n end",
"def new\n @folha_fonte_recurso = Folha::FonteRecurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @folha_fonte_recurso }\n end\n end",
"def update\n respond_to do |format|\n if @pregoestitulosgrafico.update(pregoestitulosgrafico_params)\n format.html { redirect_to @pregoestitulosgrafico, notice: 'Pregoestitulosgrafico was successfully updated.' }\n format.json { render :show, status: :ok, location: @pregoestitulosgrafico }\n else\n format.html { render :edit }\n format.json { render json: @pregoestitulosgrafico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @orc_ficha = OrcFicha.find(params[:id])\n\n respond_to do |format|\n if @orc_ficha.update_attributes(params[:orc_ficha])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@orc_ficha) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @orc_ficha.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(caracteristica_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Caracteristica was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @regiaos = Regiao.find(params[:id])\n\n respond_to do |format|\n if @regiaos.update_attributes(params[:regiao])\n flash[:notice] = 'REGIÃO SALVA COM SUCESSO'\n format.html { redirect_to(@regiaos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @regiaos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @folha_fonte_recurso }\n end\n end",
"def create\n @fonte_de_recurso = FonteDeRecurso.new(fonte_de_recurso_params)\n\n respond_to do |format|\n if @fonte_de_recurso.save\n addlog(\"Fonte e recurso criada\")\n format.html { redirect_to @fonte_de_recurso, notice: 'Fonte de recurso criado com sucesso.' }\n format.json { render :show, status: :created, location: @fonte_de_recurso }\n else\n format.html { render :new }\n format.json { render json: @fonte_de_recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @detalle_documento_de_compra.update(detalle_documento_de_compra_params)\n format.html { redirect_to @detalle_documento_de_compra, notice: 'Detalle documento de compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @detalle_documento_de_compra }\n else\n format.html { render :edit }\n format.json { render json: @detalle_documento_de_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @protocolo = Protocolo.find(params[:id])\n\n respond_to do |format|\n if @protocolo.update_attributes(params[:protocolo])\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@protocolo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @protocolo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_de_documento = TipoDeDocumento.find(params[:id])\n\n respond_to do |format|\n if @tipo_de_documento.update_attributes(params[:tipo_de_documento])\n format.html { redirect_to(@tipo_de_documento, :notice => 'Tipo de documento atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_de_documento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @arquivo = Arquivo.find(params[:id])\n\n respond_to do |format|\n if @arquivo.update_attributes(params[:arquivo])\n format.html { redirect_to @arquivo, notice: 'Arquivo foi atualiazado com sucesso.' }\n format.json { head :no_content }\n\n comentario = Comentario.new\n comentario.user = current_user\n comentario.comentavel_id = @arquivo.id\n comentario.comentavel_type = \"Arquivo\"\n comentario.conteudo = \"Arquivo atualizadp\"\n comentario.titulo = \"Arquivo atualizado\"\n\n comentario.save\n else\n format.html { render action: \"edit\" }\n format.json { render json: @arquivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_fuente = TipoFuente.find(params[:id])\n\n respond_to do |format|\n if @tipo_fuente.update_attributes(params[:tipo_fuente])\n format.html { redirect_to(@tipo_fuente, :notice => 'TipoFuente was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_fuente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(etiqueta_params)\n format.html { redirect_to @objeto, notice: 'Etiqueta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def override\n document_id = params[:document_id]\n document = params[:document]\n document_type = params[:document_type]\n ticket = Document.ticket(Alfresco::Document::ALFRESCO_USER, Alfresco::Document::ALFRESCO_PASSWORD)\n\n builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|\n xml.entry(:xmlns => \"http://www.w3.org/2005/Atom\",\n \"xmlns:cmisra\" => \"http://docs.oasis-open.org/ns/cmis/restatom/200908/\",\n \"xmlns:cmis\" => \"http://docs.oasis-open.org/ns/cmis/core/200908/\") {\n xml.title document.original_filename if document\n xml.summary document_type\n if document\n xml.content(:type => document.content_type) {\n xml.text Base64.encode64(document.read)\n }\n end\n }\n end\n\n url = Document::PATH + \"cmis/i/#{document_id}?alf_ticket=\" + ticket\n\n begin\n RestClient.put url, builder.to_xml, {:content_type => 'application/atom+xml;type=entry'}\n rescue => e\n Rails.logger.info \"#\"*50\n Rails.logger.info \"Error updating file\"\n Rails.logger.info e.message\n Rails.logger.info \"#\"*50\n end\n\n redirect_to :controller => 'related_service_requests', :action => 'show', :anchor => 'documents', :service_request_id => params[:friendly_id], :id => params[:ssr_id]\n end",
"def update\n respond_to do |format|\n if @objeto.update(carpeta_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Carpeta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @fonte_de_recurso.destroy\n addlog(\"Fonte de recurso apagada\")\n respond_to do |format|\n format.html { redirect_to fontes_de_recurso_url, notice: 'Fonte de recurso apagado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def update\n @ficha = Ficha.find(params[:id])\n\n respond_to do |format|\n if @ficha.update_attributes(params[:ficha])\n format.html { redirect_to @ficha, notice: 'Ficha alterada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ficha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def putFactura(oc)\n\n facturax= JSON.parse(HTTP.headers(:\"Content-Type\" => \"application/json\").put(\"http://\"+ $url +\"/facturas/\", :json => {:oc => oc}).to_s, :symbolize_names => true)\n return facturax\n end",
"def update\n\n respond_to do |format|\n if @cfo.update_attributes(params[:cfo])\n format.html { redirect_to cfos_url, notice: 'ЦФО обновлён.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @factura.update_attributes(params[:factura])\n format.html { redirect_to([@cliente, @factura], :notice => t('flash.actions.update.notice', :resource_name => Factura.model_name.human)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @factura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @frequencia_orgao = Frequencia::Orgao.find(params[:id])\n\n respond_to do |format|\n if @frequencia_orgao.update_attributes(params[:frequencia_orgao])\n format.html { redirect_to(@frequencia_orgao, :notice => 'Orgão atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @frequencia_orgao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ficheiro.update(ficheiro_params)\n format.html { redirect_to @ficheiro, notice: 'File was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ficheiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @reputacao_veiculo = ReputacaoVeiculo.find(params[:id])\n\n respond_to do |format|\n if @reputacao_veiculo.update_attributes(params[:reputacao_veiculo])\n format.html { redirect_to(@reputacao_veiculo, :notice => 'A reputacao do veiculo foi atualizada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reputacao_veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_documento.update(tipo_documento_params)\n format.html { redirect_to @tipo_documento, notice: 'Se ha actualizado el Tipo de documento.' }\n format.json { render :show, status: :ok, location: @tipo_documento }\n else\n format.html { render :edit }\n format.json { render json: @tipo_documento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @remocao = Remocao.find(params[:id])\n respond_to do |format|\n if @remocao.update_attributes(params[:remocao])\n flash[:notice] = 'Remocao efetuada com sucesso.'\n format.html { redirect_to(@remocao) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @remocao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ficha_tematica = FichaTematica.find(params[:id])\n\n respond_to do |format|\n if @ficha_tematica.update_attributes(params[:ficha_tematica])\n flash[:notice] = 'FichaTematica se ha actualizado con exito.'\n format.html { redirect_to(admin_ficha_tematicas_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ficha_tematica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @fio_titulo.update(fio_titulo_params)\r\n format.html { redirect_to fio_titulo_path(@fio_titulo), notice: 'Materia prima atualizada com sucesso.' }\r\n format.json { render :show, status: :ok, location: @fio_titulo }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @fio_titulo.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @inventario = Inventario.find(params[:id])\n @foto = @inventario.foto\n \n @service = InventarioService.new(@inventario, @foto)\n respond_to do |format|\n\n if @inventario.update_attributes(params[:inventario],params[:foto_file])\n format.html { redirect_to(@inventario, :notice => 'Inventario was successfully updated.') }\n format.xml { head :ok }\n else\n\t @foto = @service.foto\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cambio_director_tesis_registro.update(cambio_director_tesis_registro_params)\n format.html { redirect_to @cambio_director_tesis_registro, notice: 'Su petición para cambiar de director(es) de tesis fue actualizada.' }\n format.json { render :show, status: :ok, location: @cambio_director_tesis_registro }\n else\n format.html { render :edit }\n format.json { render json: @cambio_director_tesis_registro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tamanho.update(tamanho_params)\n format.html { redirect_to @tamanho, notice: 'Tamanho was successfully updated.' }\n format.json { render :show, status: :ok, location: @tamanho }\n else\n format.html { render :edit }\n format.json { render json: @tamanho.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @socio_doc_fiscais_coring.update(socio_doc_fiscais_coring_params)\n format.html { redirect_to @socio_doc_fiscais_coring, notice: 'Socio doc fiscais coring was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_doc_fiscais_coring.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @reparticao.update(reparticao_params)\n format.html { redirect_to @reparticao, notice: 'Reparticao was successfully updated.' }\n format.json { render :show, status: :ok, location: @reparticao }\n else\n format.html { render :edit }\n format.json { render json: @reparticao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ficha_recinto.update(ficha_recinto_params)\n format.html { redirect_to @ficha_recinto, notice: 'Ficha recinto was successfully updated.' }\n format.json { render :show, status: :ok, location: @ficha_recinto }\n else\n format.html { render :edit }\n format.json { render json: @ficha_recinto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @titulacao.update(titulacao_params)\n format.html { redirect_to titulacaos_path, notice: 'Titulo atualizado com successo.' }\n format.json { render titulacaos_path, status: :ok, location: titulacaos_path }\n else\n format.html { render :edit }\n format.json { render json: @titulacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @protocolo.update(protocolo_params)\n addlog(\"Protocolo alterado\")\n format.html { redirect_to @protocolo, notice: 'Protocolo foi atualizado.' }\n format.json { render :show, status: :ok, location: @protocolo }\n else\n format.html { render :edit }\n format.json { render json: @protocolo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @registro_servicio.update(registro_servicio_params)\n format.html { redirect_to @registro_servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_servicio }\n else\n format.html { render :edit }\n format.json { render json: @registro_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_documento = TipoDocumento.find(params[:id])\n\n respond_to do |format|\n if @tipo_documento.update_attributes(params[:tipo_documento])\n format.html { redirect_to @tipo_documento, notice: 'Tipo documento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_documento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @faixa_de_desconto = FaixaDeDesconto.find(params[:id])\n\n respond_to do |format|\n if @faixa_de_desconto.update_attributes(params[:faixa_de_desconto])\n flash[:notice] = 'FaixaDeDesconto was successfully updated.'\n format.html { redirect_to(@faixa_de_desconto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @faixa_de_desconto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_controles = TipoControle.find(params[:id])\n\n respond_to do |format|\n if @tipo_controles.update_attributes(params[:tipo_controle])\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@tipo_controles) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_controles.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipos_documento.update(tipos_documento_params)\n format.html { redirect_to @tipos_documento, notice: 'El Tipo de Documento se ha actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @tipos_documento }\n else\n format.html { render :edit }\n format.json { render json: @tipos_documento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n if @safra_verdoso.update_attributes(params[:safra_verdoso])\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @reclamacao = Reclamacao.find(params[:id])\n\n respond_to do |format|\n if @reclamacao.update_attributes(params[:reclamacao])\n format.html { redirect_to(@reclamacao, :notice => 'Reclamacao was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reclamacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @factura = Factura.find(params[:id])\n @factura.cambio_moneda = 0\n\n if @factura.moneda.id.to_s != params[:factura][:moneda_id]\n @factura.cambio_moneda = @factura.moneda.tipodecambio\n end\n\n respond_to do |format|\n if @factura.update_attributes(params[:factura])\n format.html { redirect_to @factura, :notice => 'Factura was successfully updated.' }\n format.json { render json: @factura }\n else\n format.html { render :action => \"edit\" }\n format.json { render json: @factura.errors }\n end\n end\n end",
"def update\n respond_to do |format|\n\n if @os_tarefa.update(os_tarefa_params)\n #se as situacao da tarefa nao for aceita, altera a ordem_servico_pagamento para null\n if(@os_tarefa.situacao!=OsTarefa.situacoes[0] && @os_tarefa.situacao!=OsTarefa.situacoes[1])\n\n @os_tarefa.ordem_servico_pagamento=nil\n @os_tarefa.save\n end\n\n if @os_tarefa.ordem_servico.id!=nil\n format.html { redirect_to \"/ordem_servicos/\"+@os_tarefa.ordem_servico.id.to_s, notice: 'A Tarefa foi atualizado(a)' }\n format.json { head :no_content }\n else\n format.html { redirect_to @os_tarefa, notice: 'A Tarefa foi atualizado(a)' }\n format.json { render :show, status: :ok, location: @os_tarefa }\n end\n else\n format.html { render :edit }\n format.json { render json: @os_tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_compra.update(tipo_compra_params)\n format.html { redirect_to @tipo_compra, notice: 'Tipo compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_compra }\n else\n format.html { render :edit }\n format.json { render json: @tipo_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @receipe.update(receipe_params)\n format.html { redirect_to @receipe, notice: 'レシピを更新しました' }\n format.json { render :show, status: :ok, location: @receipe }\n else\n format.html { render :edit }\n format.json { render json: @receipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @rubro.update_attributes(params[:rubro])\n format.html { redirect_to(@rubro, :notice => \"Se actualizó el rubro #{@rubro.nombre}.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rubro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ficha.update(ficha_params)\n format.html { redirect_to @ficha, notice: 'Ficha was successfully updated.' }\n format.json { render :show, status: :ok, location: @ficha }\n else\n format.html { render :edit }\n format.json { render json: @ficha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ficha.update(ficha_params)\n format.html { redirect_to @ficha, notice: 'Ficha was successfully updated.' }\n format.json { render :show, status: :ok, location: @ficha }\n else\n format.html { render :edit }\n format.json { render json: @ficha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @vocabulaire.update(vocabulaire_params)\n format.html { redirect_to @vocabulaire, notice: 'Vocabulaire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vocabulaire.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tema_curso.update(tema_curso_params)\n format.html { redirect_to @tema_curso, notice: 'Tema do curso atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @tema_curso }\n else\n format.html { render :edit }\n format.json { render json: @tema_curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n set_funcionario\n if @ordem_servico.update(ordem_servico_params)\n format.html { redirect_to @ordem_servico, notice: t('messages.cadastro_atualizado') }\n format.json { render :show, status: :ok, location: @ordem_servico }\n else\n format.html { render :edit }\n format.json { render json: @ordem_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n\n respond_to do |format|\n if @situacoes_juridica.update_attributes(params[:situacoes_juridica])\n format.html { redirect_to(@situacoes_juridica, :notice => 'Situação jurídica atualizada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @situacoes_juridica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @caracteristica.update_attributes(params[:caracteristica])\n format.html { redirect_to(@caracteristica.material, :notice => 'La característica fue actualizada.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @caracteristica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empresas.update(empresa_params)\n #File.extname(params[:logo].path)\n format.html { redirect_to @empresas, notice: 'Empresa was successfully updated.' }\n format.json { render :show, status: :ok, location: @empresas }\n else\n format.html { render :edit }\n format.json { render json: @empresas.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @documentotipo = Documentotipo.find(params[:id])\n\n respond_to do |format|\n if @documentotipo.update_attributes(params[:documentotipo])\n format.html { redirect_to @documentotipo, notice: 'Documentotipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @documentotipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @recurso = Recurso.find(params[:id])\n\n respond_to do |format|\n if @recurso.update(recurso_params)\n #flash.now[:notice] = 'El recurso fue actualizado con éxito.'\n @recursos = Recurso.order(\"descripcion\").to_a \n format.html { redirect_to :action => \"index\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recurso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @relatestagiario = Relatestagiario.find(params[:id])\n\n respond_to do |format|\n if @relatestagiario.update_attributes(params[:relatestagiario])\n flash[:notice] = 'RELATÓRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@relatestagiario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @relatestagiario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to servicos_url, notice: 'Serviço atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @tipo_recibo.update_attributes(params[:tipo_recibo])\n format.html { redirect_to(@tipo_recibo, :notice => 'Tipo recibo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_recibo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @documento = Documento.find params[:documento][:id]\n Documento.transaction do \n @documento.cartorio_id = current_usuario.entidade_id\n @documento.save \n #apaga os valores atuais\n @documento.valor_campo_documentos.each {|v| v.delete}\n params[:metadados].each do |k,v|\n @documento.valor_campo_documentos.create(:campo_documento_id => k, :valor => v)\n end \n end\n\n respond_to do |format|\n if 1 == 1 # so pra ajudar nos testes\n flash[:notice] = 'Documento was successfully updated.'\n format.html { redirect_to(@documento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @documento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @frais_repa = FraisRepa.find(params[:id])\n\n respond_to do |format|\n if @frais_repa.update_attributes(params[:frais_repa])\n format.html { redirect_to @frais_repa, :notice => 'Le frais de repas a bien été modifé' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @frais_repa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @feria2010observacion = Feria2010observacion.find(params[:id])\n\n respond_to do |format|\n if @feria2010observacion.update_attributes(params[:feria2010observacion])\n format.html { redirect_to(@feria2010observacion, :notice => 'Feria2010observacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feria2010observacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @folha_financeiro = Folha::Financeiro.find(params[:id])\n\n respond_to do |format|\n if @folha_financeiro.update_attributes(params[:folha_financeiro])\n format.html { redirect_to(folha_folha_financeiros_url(@folha), :notice => 'Financeiro atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @folha_financeiro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @formarec.update(formarec_params)\n format.html { redirect_to @formarec, notice: 'Tipo de Recebimento alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @formarec }\n else\n format.html { render :edit }\n format.json { render json: @formarec.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_curso = TipoCurso.find(params[:id])\n\n respond_to do |format|\n if @tipo_curso.update_attributes(params[:tipo_curso])\n flash[:notice] = 'TipoCurso actualizado correctamente.'\n format.html { redirect_to(@tipo_curso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_curso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pago_factura.update(pago_factura_params)\n format.html { redirect_to compra_id_detalle_path(@pago_factura.compra_id), notice: 'Pago factura actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @pago_factura }\n else\n format.html { render :edit }\n format.json { render json: @pago_factura.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @operation = Operation.find(params[:id])\n cita = Cita.find(@operation.cita_id)\n respond_to do |format|\n if @operation.update_attributes(params[:operation])\n if cita.status == 'estudio_en_proceso'\n cita.concluir_estudio!\n elsif cita.status ==\"estudio_exitoso\"\n cita.interpretar!\n end\n flash[:notice] = 'El estudio ha sido actualizado'\n format.html { redirect_to :controller => 'pacientes',:action => 'show',:id => cita.paciente_id }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @operation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @categoria_do_recebimento = CategoriaDoRecebimento.find(params[:id])\n\n respond_to do |format|\n if @categoria_do_recebimento.update_attributes(params[:categoria_do_recebimento])\n format.html { redirect_to(@categoria_do_recebimento, :notice => 'Categoria do recebimento was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categoria_do_recebimento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @predio.update(predio_params)\n format.html { redirect_to @predio, notice: 'Predio foi alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @predio }\n else\n format.html { render :edit }\n format.json { render json: @predio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_contrato = TipoContrato.find(params[:id])\n respond_to do |format|\n if @tipo_contrato.update_attributes(params[:tipo_contrato])\n flash[:notice] = 'TiposContratos actualizado correctamente.'\n format.html { redirect_to(@tipo_contrato) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_contrato.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inventario_cosa.update(inventario_cosa_params)\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario_cosa }\n else\n format.html { render :edit }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n respond_to do |format|\n if @terciaria_caracteristica.update(terciaria_caracteristica_params)\n format.html { redirect_to @terciaria_caracteristica, notice: 'Terciaria caracteristica was successfully updated.' }\n format.json { render :show, status: :ok, location: @terciaria_caracteristica }\n else\n format.html { render :edit }\n format.json { render json: @terciaria_caracteristica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tipo_conta = TipoConta.find(params[:id])\n\n respond_to do |format|\n if @tipo_conta.update_attributes(params[:tipo_conta])\n flash[:notice] = 'TipoConta was successfully updated.'\n format.html { redirect_to(tipo_contas_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_conta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_servicio.update(tipo_de_servicio_params)\n format.html { redirect_to @tipo_de_servicio, notice: 'Tipo de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cegonha = Cegonha.find(params[:id])\n @cegonha.carros = @cegonha.cars.count\n\n if defined?(params[:cegonha][:pagamento_attributes])\n if !(params[:cegonha][:pagamento_attributes]).nil?\n converter_string_to_bigdecimal(@cegonha, params[:cegonha][:pagamento_attributes])\n end\n end\n if params[:salvar_localizacao]\n\n @cegonha.estado_id = params[:estado_id]\n @cegonha.estado_origem = params[:estado_origem]\n @cegonha.estado_destino = params[:estado_destino]\n\n # atençao! Ele vai pegar a cidade pelo nome, e nao separa por estado - pode ser\n # que se futuramente queira-se comprar a cidade pelo ID, pode dar erro (pegar cidade com mesmo nome mas\n # de estados diferentes )\n cidade_atual = Cidade.find_by_text(params[:cidade_id]).id\n cidade_origem = Cidade.find_by_text(params[:cidade_origem]).id\n cidade_destino = Cidade.find_by_text(params[:cidade_destino]).id\n\n @cegonha.cidade_id = cidade_atual\n @cegonha.cidade_origem = cidade_origem\n @cegonha.cidade_destino = cidade_destino\n\n\n\n # altera a localizacao de todos os carros que estao na cegonha\n unless @cegonha.cars.nil?\n @cegonha.cars.each do |car|\n car.estado_id = @cegonha.estado_id\n car.cidade_id = @cegonha.cidade_id\n car.localizacao = \"#{params[:cidade_id]}, #{Estado.find(params[:estado_id]).sigla}\"\n car.save\n end\n end\n\n @cegonha.localizacao = \"#{params[:cidade_id]}, #{Estado.find(params[:estado_id]).sigla}\"\n end\n\n respond_to do |format|\n if @cegonha.update_attributes(params[:cegonha])\n # se chegou no destino, todos os carros saem da cegonha e o status deles muda para descarregados.\n #if\n\n # redirect_to logistica_cegonha_path(@cegonha) and return\n chegou_no_destino?(@cegonha)\n ativar_status_de_carro_com_terceiros(@cegonha.id, @cegonha.class.to_s)\n if params[:salvar_localizacao]\n if checar_logistica_carros(@cegonha.id)\n redirect_to logistica_cegonha_path(@cegonha) and return\n else\n format.html { redirect_to @cegonha, notice: 'Dados da cegonha atualizados com sucesso.' }\n end\n elsif params[:editar_localizacao]\n flash[:notice] = 'Dados atualizados com sucesso!'\n redirect_to :action => :edit, :cegonha => @cegonha, :editar_localizacao => true and return\n else\n format.html { redirect_to @cegonha, notice: 'Dados da cegonha atualizados com sucesso.' }\n format.json { head :no_content }\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cegonha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @texto = Texto.find(params[:id])\n\n respond_to do |format|\n if @texto.update_attributes(params[:texto])\n format.html { redirect_to(@texto, :notice => 'Texto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @texto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @foca.update(foca_params)\n format.html { redirect_to @foca, notice: 'Foca atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @foca }\n else\n format.html { render :edit }\n format.json { render json: @foca.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @restaurantes_proximo.update(restaurantes_proximo_params)\n format.html { redirect_to @restaurantes_proximo, notice: 'Restaurantes proximo was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurantes_proximo }\n else\n format.html { render :edit }\n format.json { render json: @restaurantes_proximo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @recursorevision = @solicitud.recursosrevision.find(params[:id])\n\n respond_to do |format|\n if @recursorevision.update_attributes(params[:recursorevision])\n format.html { redirect_to([@solicitud,@recursorevision], :notice => 'Recurso revisión actualizado con exito.') }\n format.xml { head :ok }\n else \n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recursorevision.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @renomear.update(renomear_params)\n format.html { redirect_to @renomear, notice: 'Renomear was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @renomear.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n guardaRelaciones(EspecieCatalogo)\n guardaRelaciones(EspecieRegion)\n guardaRelaciones(NombreRegion)\n guardaRelaciones(NombreRegionBibliografia)\n\n respond_to do |format|\n argumentosRelaciones=especie_params\n argumentosRelaciones.delete(:especies_catalogos_attributes)\n argumentosRelaciones.delete(:especies_regiones_attributes)\n argumentosRelaciones.delete(:nombres_regiones_attributes)\n argumentosRelaciones.delete(:nombres_regiones_bibliografias_attributes)\n\n if @especie.update(argumentosRelaciones) && params[:commit].eql?('Guardar')\n descripcion=\"Actualizó el taxón #{@especie.nombre_cientifico} (#{@especie.id})\"\n bitacora=Bitacora.new(:descripcion => descripcion, :usuario_id => current_usuario.id)\n bitacora.save\n format.html { redirect_to @especie, notice: \"El taxón #{@especie.nombre_cientifico} fue modificado exitosamente.\" }\n format.json { head :no_content }\n elsif @especie.update(argumentosRelaciones) && params[:commit].eql?('Guardar y seguir editando')\n descripcion=\"Actualizó el taxón #{@especie.nombre_cientifico} (#{@especie.id})\"\n bitacora=Bitacora.new(:descripcion => descripcion, :usuario_id => current_usuario.id)\n bitacora.save\n #format.html { render action: 'edit' }\n format.html { redirect_to \"/especies/#{@especie.id}/edit\", notice: \"El taxón #{@especie.nombre_cientifico} fue modificado exitosamente.\" }\n #else\n #format.html { render action: 'edit' }\n #format.json { render json: @especie.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @texte_accueil = TexteAccueil.find(params[:id])\n\n respond_to do |format|\n if @texte_accueil.update_attributes(params[:texte_accueil])\n flash[:notice] = 'TexteAccueil was successfully updated.'\n format.html { redirect_to(root_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @texte_accueil.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @restricao.update(restricao_params)\n format.html { redirect_to @restricao, notice: 'Restrição foi Editada com Sucesso!' }\n format.json { render :show, status: :ok, location: @restricao }\n else\n format.html { render :edit }\n format.json { render json: @restricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @cambiar_tema.update(cambiar_tema_params)\r\n format.html { redirect_to @cambiar_tema, notice: 'Su petición para cambiar de tema de tesis fue actualizada.' }\r\n format.json { render :show, status: :ok, location: @cambiar_tema }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @cambiar_tema.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @frequencia_setor = Frequencia::Setor.find(params[:id])\n\n respond_to do |format|\n if @frequencia_setor.update_attributes(params[:frequencia_setor])\n format.html { redirect_to(@frequencia_setor, :notice => 'Setor atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @frequencia_setor.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, notice: 'Tecnico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiarios.update_attributes(params[:estagiario])\n flash[:notice] = 'ESTAGIÁRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@estagiarios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiarios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ficha_ingreso.update(ficha_ingreso_params)\n format.html { redirect_to @ficha_ingreso, notice: 'Ficha ingreso was successfully updated.' }\n format.json { render :show, status: :ok, location: @ficha_ingreso }\n else\n format.html { render :edit }\n format.json { render json: @ficha_ingreso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @receitai.update(receitai_params)\n format.html { redirect_to proc { receita_url(@receita) }, notice: 'Item foi alterado.' }\n format.json { render :show, status: :ok, location: @receitai }\n else\n format.html { render :edit }\n format.json { render json: @receitai.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n\tFichaExer.create({ficha_musc_id: @ficha_musc.id})\n if @ficha_musc.update(ficha_musc_params)\n format.html { redirect_to @ficha_musc, notice: 'Ficha musc was successfully updated.' }\n format.json { render :show, status: :ok, location: @ficha_musc }\n else\n format.html { render :edit }\n format.json { render json: @ficha_musc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @historico_converca.update(historico_converca_params)\n format.html { redirect_to @historico_converca, notice: 'Historico converca was successfully updated.' }\n format.json { render :show, status: :ok, location: @historico_converca }\n else\n format.html { render :edit }\n format.json { render json: @historico_converca.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @receita = Receita.find(params[:id])\n\n respond_to do |format|\n if @receita.update_attributes(params[:receita])\n flash[:notice] = 'Receita was successfully updated.'\n format.html { redirect_to(@receita) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @receita.errors, :status => :unprocessable_entity }\n end\n end\n end"
] | [
"0.6718887",
"0.6204177",
"0.6086003",
"0.600813",
"0.5998788",
"0.59138423",
"0.58684003",
"0.5863639",
"0.57224727",
"0.57072246",
"0.568265",
"0.56784505",
"0.56596494",
"0.56312805",
"0.5617255",
"0.5592369",
"0.5580204",
"0.5570335",
"0.55690354",
"0.55552244",
"0.5537426",
"0.55304843",
"0.5528172",
"0.5526183",
"0.5523622",
"0.55151045",
"0.5512907",
"0.550622",
"0.5503094",
"0.5499298",
"0.549838",
"0.54961365",
"0.5495854",
"0.5495427",
"0.5486559",
"0.54855597",
"0.5475798",
"0.5467563",
"0.54663557",
"0.5465862",
"0.546233",
"0.5462082",
"0.5459262",
"0.5453659",
"0.5449039",
"0.5441509",
"0.54306567",
"0.54266834",
"0.54248387",
"0.5421192",
"0.5418217",
"0.54178894",
"0.5417689",
"0.5417689",
"0.54154235",
"0.540943",
"0.5405085",
"0.5401254",
"0.53980917",
"0.5396875",
"0.5390393",
"0.5368825",
"0.5365439",
"0.5364497",
"0.53579015",
"0.53553045",
"0.53455853",
"0.53454083",
"0.53444266",
"0.5340011",
"0.5333201",
"0.5332675",
"0.5332378",
"0.533137",
"0.5329534",
"0.532798",
"0.53274244",
"0.5326273",
"0.53259116",
"0.5324795",
"0.53241664",
"0.531914",
"0.5310648",
"0.5310205",
"0.53070545",
"0.53061295",
"0.53053993",
"0.5305304",
"0.53041553",
"0.5303032",
"0.5302159",
"0.53015286",
"0.5300362",
"0.529938",
"0.5294055",
"0.5293408",
"0.52922165",
"0.52892673",
"0.5287526",
"0.5283542"
] | 0.7004521 | 0 |
DELETE /folha/fonte_recursos/1 DELETE /folha/fonte_recursos/1.xml | def destroy
@folha_fonte_recurso = Folha::FonteRecurso.find(params[:id])
@folha_fonte_recurso.destroy
respond_to do |format|
format.html { redirect_to(folha_fonte_recursos_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @orc_ficha = OrcFicha.find(params[:id])\n @orc_ficha.destroy\n\n respond_to do |format|\n format.html { redirect_to(orc_fichas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @texte_accueil = TexteAccueil.find(params[:id])\n @texte_accueil.destroy\n\n respond_to do |format|\n format.html { redirect_to(texte_accueils_url) }\n format.xml { head :ok }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @ficha_tematica = FichaTematica.find(params[:id])\n @ficha_tematica.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_ficha_tematicas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @detalle_documento_de_compra.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Linea eliminada' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_de_documento = TipoDeDocumento.find(params[:id])\n @tipo_de_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipos_de_documento_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @reclamacao = Reclamacao.find(params[:id])\n @reclamacao.destroy\n\n respond_to do |format|\n format.html { redirect_to(reclamacaos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n arquivo = Arquivo.find(@pregoestitulosgrafico.arquivo_id)\n\n File.delete(arquivo.caminho)\n\n pregoestitulo = Pregoestitulo.find(@pregoestitulosgrafico.pregoestitulo_id)\n \n @pregoestitulosgrafico.destroy\n respond_to do |format|\n format.html { redirect_to pregoestitulo, notice: 'Arquivo excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @faixa_de_desconto = FaixaDeDesconto.find(params[:id])\n @faixa_de_desconto.destroy\n\n respond_to do |format|\n format.html { redirect_to(faixas_de_desconto_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @receita = Receita.find(params[:id])\n @receita.destroy\n\n respond_to do |format|\n format.html { redirect_to(receitas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documento = @externo.documentos.find(params[:id])\n @documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(documentos_url(@externo)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @calidadtiposdocumento = Calidadtiposdocumento.find(params[:id])\n @calidadtiposdocumento.destroy\n\n respond_to do |format|\n format.html { redirect_to(calidadtiposdocumentos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @relatestagiario = Relatestagiario.find(params[:id])\n @relatestagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(relatestagiarios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @conteudo = Conteudo.find(params[:id])\n @conteudo.destroy\nt=0\n respond_to do |format|\n format.html { redirect_to(exclusao_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @feria2010observacion = Feria2010observacion.find(params[:id])\n @feria2010observacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(feria2010observaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @repasse_fabrica = RepasseFabrica.find(params[:id])\n @repasse_fabrica.destroy\n\n respond_to do |format|\n format.html { redirect_to(repasses_fabrica_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @remocao = Remocao.find(params[:id])\n @remocao.destroy\n\n respond_to do |format|\n format.html { redirect_to(remocaos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reputacao_veiculo = ReputacaoVeiculo.find(params[:id])\n @reputacao_veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to(reputacao_veiculos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documento = Documento.find(params[:id])\n @documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(documentos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documento = Documento.find(params[:id])\n # Eliminar los registros asociativos de las tablas JOIN \n # para las asociaciones HBTM (has_and_belongs_to_many)\n #\n @documento.reconocimientos.destroy_all\n @documento.areas.destroy_all\n\n @documento.destroy\n\n respond_to do |format|\n format.html { redirect_to documentos_url, :notice => \"#{@documento.titulo} eliminado\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @regiaos = Regiao.find(params[:id])\n @regiaos.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fonte_de_recurso.destroy\n addlog(\"Fonte de recurso apagada\")\n respond_to do |format|\n format.html { redirect_to fontes_de_recurso_url, notice: 'Fonte de recurso apagado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @constancia_documento.destroy\n respond_to do |format|\n format.html { redirect_to constancia_documentos_url, notice: 'La constancia fue eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ficha_doc.destroy\n respond_to do |format|\n format.html { redirect_to ficha_docs_url, notice: 'Ficha doc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @arquivo = Arquivo.find(params[:id])\n\n @comentarios = Comentario.where(:comentavel_id => @arquivo.id)\n\n if @comentarios\n @comentarios.delete_all\n end\n\n @arquivo.destroy\n\n respond_to do |format|\n format.html { redirect_to arquivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contrato = Contrato.find(params[:id])\n @contrato.destroy\n\n respond_to do |format|\n format.html { redirect_to(contratos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @requisicao = Requisicao.find(params[:id])\n @requisicao.destroy\n\n respond_to do |format|\n format.html { redirect_to(requisicoes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reclamo = Reclamo.find(params[:id])\n @reclamo.destroy\n\n respond_to do |format|\n format.html { redirect_to(reclamos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_conta = TipoConta.find(params[:id])\n @tipo_conta.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_contas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @recebimento = Recebimento.find(params[:id])\n @recebimento.destroy\n\n respond_to do |format|\n format.html { redirect_to(recebimentos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @coleccionista = Coleccionista.find(params[:id])\n @coleccionista.destroy\n\n respond_to do |format|\n format.html { redirect_to(coleccionistas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @categoria_do_recebimento = CategoriaDoRecebimento.find(params[:id])\n @categoria_do_recebimento.destroy\n\n respond_to do |format|\n format.html { redirect_to(categoria_do_recebimentos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @correspondenciasasignada = Correspondenciasasignada.find(params[:id])\n @correspondenciasasignada.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondenciasasignadas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hcontrato = Hcontrato.find(params[:id])\n @hcontrato.destroy\n\n respond_to do |format|\n format.html { redirect_to(hcontratos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n category = Formulario::REFERENCES_CATEGORY[@formulario.categoria]\n file = File.join(\"#{Formulario::ROUTE_PATH}\",category, @formulario.title)\n FileUtils.rm file\n @formulario.destroy\n respond_to do |format|\n puts \"----------> #{formularios_url}\"\n format.html { redirect_to formularios_url, notice: 'Formulario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @convenio_financiamiento = ConvenioFinanciamiento.find(params[:id])\n @convenio_financiamiento.destroy\n\n respond_to do |format|\n format.html { redirect_to(convenio_financiamientos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @factura = Factura.find(params[:id])\n @factura.destroy\n\n respond_to do |format|\n format.html { redirect_to(facturas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documentoclasificacion = Documentoclasificacion.find(params[:id])\n @documentoclasificacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(documentoclasificaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_fuente = TipoFuente.find(params[:id])\n @tipo_fuente.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_fuentes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reputacao_carona = ReputacaoCarona.find(params[:id])\n @reputacao_carona.destroy\n\n respond_to do |format|\n format.html { redirect_to(reputacao_caronas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_restaurante = TipoRestaurante.find(params[:id])\n @tipo_restaurante.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_restaurantes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @inscripcione = Inscripcione.find(params[:id])\n @inscripcione.destroy\n\n respond_to do |format|\n format.html { redirect_to(inscripciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @entrada = Entrada.find(params[:id])\n @entrada.destroy\n\n respond_to do |format|\n format.html { redirect_to(mngr_entradas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @iguanasactualizacion = Iguanasactualizacion.find(params[:id])\n @iguanasactualizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(iguanasactualizaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_contrato = TipoContrato.find(params[:id])\n @tipo_contrato.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipos_contratos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @asistencia = Asistencia.find(params[:id])\n @asistencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(asistencias_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documentacion.destroy\n respond_to do |format|\n format.html { redirect_to @mem, notice: 'Documentación eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nomina.destroy\n\n respond_to do |format|\n format.html { redirect_to(nominas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @protocolo = Protocolo.find(params[:id])\n @protocolo.destroy\n\n respond_to do |format|\n format.html { redirect_to(protocolos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @feria2014beneficiario = Feria2014beneficiario.find(params[:id])\n @feria2014beneficiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(feria2014beneficiarios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @recurso = Recurso.find(params[:id])\n @recurso.destroy\n\n respond_to do |format|\n format.html { redirect_to(recursos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @entidadfinanciera = Entidadfinanciera.find(params[:id])\n @entidadfinanciera.destroy\n\n respond_to do |format|\n format.html { redirect_to(entidadfinancieras_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @direccion = Direccion.find(params[:id])\n @direccion.destroy\n\n respond_to do |format|\n format.html { redirect_to(direccions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @frequencia_orgao = Frequencia::Orgao.find(params[:id])\n @frequencia_orgao.destroy\n\n respond_to do |format|\n format.html { redirect_to(frequencia_orgaos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @correspondenciasclase = Correspondenciasclase.find(params[:id])\n @correspondenciasclase.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondenciasclases_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @frequencia_setor = Frequencia::Setor.find(params[:id])\n @frequencia_setor.destroy\n\n respond_to do |format|\n format.html { redirect_to(frequencia_setores_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @adjunto = Adjunto.find(params[:id])\n @adjunto.destroy\n\n respond_to do |format|\n format.html { redirect_to(adjuntos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tiposcontrato = Tiposcontrato.find(params[:id])\n @tiposcontrato.destroy\n\n respond_to do |format|\n format.html { redirect_to(tiposcontratos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @domino = Domino.find(params[:id])\n @domino.destroy\n\n respond_to do |format|\n format.html { redirect_to(dominos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @chamados = Chamado.find(params[:id])\n @chamados.destroy\n respond_to do |format|\n format.html { redirect_to(chamados_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @distribuidora = Distribuidora.find(params[:id])\n @distribuidora.destroy\n\n respond_to do |format|\n format.html { redirect_to(distribuidoras_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @unidad = Unidad.find(params[:id])\n @unidad.destroy\n\n respond_to do |format|\n format.html { redirect_to(unidades_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @lance_unico = LanceUnico.find(params[:id])\n @lance_unico.destroy\n\n respond_to do |format|\n format.html { redirect_to(lance_unicos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_documento = TipoDocumento.find(params[:id])\n @tipo_documento.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_documentos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expedicao = Expedicao.find(params[:id])\n @expedicao.destroy\n\n respond_to do |format|\n format.html { redirect_to(expedicoes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @motivo_assistencia = MotivoAssistencia.find(params[:id])\n @motivo_assistencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(motivos_assistencia_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @transferencia_contas_detalhe = TransferenciaContasDetalhe.find(params[:id])\n @transferencia_contas_detalhe.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/transferencia_contas/#{@transferencia_contas_detalhe.transferencia_conta_id}\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n @suministro = Suministro.find(params[:id])\n @suministro.destroy\n\n respond_to do |format|\n format.html { redirect_to(suministros_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @catastrosdato = Catastrosdato.find(params[:id])\n @catastrosdato.destroy\n\n respond_to do |format|\n format.html { redirect_to(catastrosdatos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @premio = Premio.find(params[:id])\n @premio.destroy\n\n respond_to do |format|\n format.html { redirect_to(premios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dokuei = Dokuei.find(params[:id])\n @dokuei.destroy\n\n respond_to do |format|\n format.html { redirect_to(dokueis_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_documento.destroy\n respond_to do |format|\n format.html { redirect_to tipo_documentos_url, notice: 'Se ha eliminado el Tipo de documento.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @utente = Segnalazione.find_by_prg_segna(params[:id])\n @utente.destroy\n\n respond_to do |format|\n format.html { redirect_to(segnalazioni_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ficha_recinto.destroy\n respond_to do |format|\n format.html { redirect_to ficha_recintos_url, notice: 'Ficha recinto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feria2014jefe = Feria2014jefe.find(params[:id])\n @feria2014jefe.destroy\n\n respond_to do |format|\n format.html { redirect_to(feria2014jefes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @contratosinterventoria = Contratosinterventoria.find(params[:id])\n @contratosinterventoria.destroy\n\n respond_to do |format|\n format.html { redirect_to(contratosinterventorias_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to(datos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to(datos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @catena = Catena.find(params[:id])\n @catena.destroy\n\n respond_to do |format|\n format.html { redirect_to(catenas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ciclo.destroy\n\n respond_to do |format|\n format.html { redirect_to(ciclos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cuadrante = Cuadrante.find(params[:id])\n @cuadrante.destroy\n\n respond_to do |format|\n format.html { redirect_to(cuadrantes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pagos_detalhe = PagosDetalhe.find(params[:id])\n @pagos_detalhe.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/pagos/#{@pagos_detalhe.pago_id}\" }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tipo_filtro = TipoFiltro.find(params[:id])\n @tipo_filtro.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_filtros_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @acre = Acre.find(params[:id])\n @acre.destroy\n\n respond_to do |format|\n format.html { redirect_to(acres_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documentotipo = Documentotipo.find(params[:id])\n @documentotipo.destroy\n\n respond_to do |format|\n format.html { redirect_to documentotipos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @finca = Finca.find(params[:id])\n @finca.destroy\n\n respond_to do |format|\n format.html { redirect_to(fincas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fb_adresa = FbAdresa.find(params[:id])\n @fb_adresa.destroy\n\n respond_to do |format|\n format.html { redirect_to(fb_adresas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @requisicion = Requisicion.find(params[:id])\n @requisicion.destroy\n\n respond_to do |format|\n format.html { redirect_to(requisicions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @siaikekka = Siaikekka.find(params[:id])\n @siaikekka.destroy\n\n respond_to do |format|\n format.html { redirect_to(siaikekkas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @prestamo = Prestamo.find(params[:id])\n @prestamo.destroy\n\n respond_to do |format|\n format.html { redirect_to(prestamos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @importacion = Importacion.find(params[:id])\n @importacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(importaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @docderivacione.destroy\n respond_to do |format|\n format.html { redirect_to docderivaciones_url, notice: 'Docderivacione was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cabasiento = Cabasiento.find(params[:id])\n @cabasiento.destroy\n\n respond_to do |format|\n format.html { redirect_to(cabasientos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tiposproceso = Tiposproceso.find(params[:id])\n @tiposproceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(tiposprocesos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @carro = Carro.find(params[:id])\n @carro.destroy\n\n respond_to do |format|\n format.html { redirect_to(carros_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to(consultas_url) }\n format.xml { head :ok }\n end\n end"
] | [
"0.70066607",
"0.68796295",
"0.6851178",
"0.6823986",
"0.6794931",
"0.6768692",
"0.6767139",
"0.6751718",
"0.6751042",
"0.67501384",
"0.6742871",
"0.6707887",
"0.67000794",
"0.667924",
"0.66605526",
"0.6650227",
"0.66497517",
"0.6629498",
"0.66248184",
"0.6623169",
"0.6609649",
"0.6608341",
"0.6606242",
"0.65975773",
"0.6594852",
"0.6594673",
"0.6592049",
"0.6581549",
"0.65808153",
"0.6575648",
"0.6575606",
"0.65569556",
"0.6554515",
"0.6550804",
"0.65345985",
"0.65325683",
"0.65279967",
"0.65276474",
"0.652249",
"0.6521653",
"0.6489164",
"0.6479169",
"0.6477504",
"0.64504075",
"0.644919",
"0.6439284",
"0.64356506",
"0.64321816",
"0.64242595",
"0.6423862",
"0.6423738",
"0.64205796",
"0.64196944",
"0.6418677",
"0.6409804",
"0.6409376",
"0.6405564",
"0.6405509",
"0.6399855",
"0.6393472",
"0.6393147",
"0.63897955",
"0.63896734",
"0.63892597",
"0.63845724",
"0.6379996",
"0.637761",
"0.63773286",
"0.6377245",
"0.63771576",
"0.6375734",
"0.63756216",
"0.63747686",
"0.6373821",
"0.6373562",
"0.6373487",
"0.63723093",
"0.6363566",
"0.63635397",
"0.63626033",
"0.63626033",
"0.6362574",
"0.6357491",
"0.63573974",
"0.6355874",
"0.63548875",
"0.6352951",
"0.6348377",
"0.6347675",
"0.6345299",
"0.634213",
"0.6341836",
"0.63414747",
"0.6339778",
"0.6335006",
"0.6333116",
"0.6332509",
"0.6331777",
"0.63295686",
"0.63295686"
] | 0.7105803 | 0 |
love this which comes from sandi metz, simply initializing with named arguments, and setting a default of zero. | def initialize(**opts)
@price_over = opts[:price_over] || 0
@basket_discount = opts[:basket_discount] || 0
@product_code = opts[:product_code] || 0
@product_quantity = opts[:product_quantity] || 0
@new_price = opts[:new_price] || 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default=(_arg0); end",
"def initialize(p0=\"\") end",
"def initial=(_arg0); end",
"def initialize(a = 0, b = 0, c = 0, d = 0)\n @a = a unless a.nil?\n @b = b unless b.nil?\n @c = c unless c.nil?\n @d = d unless d.nil?\n end",
"def def_zero major, minor\n def_value major, minor, 0\n end",
"def initialize(z=\"\") end",
"def test_set_defaults07b\n assert_raise ( RuntimeError ) {\n ArgumentManager.set_defaults(\n {\n :df_int => 999\n }\n )\n } \n end",
"def test_set_defaults09a\n assert_raise ( RuntimeError ) {\n ArgumentManager.set_defaults(\n {\n :df_str => 0\n }\n )\n } \n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n end",
"def initialize (num=200)\n @num = num\n end",
"def default=(p0) end",
"def initialize(x=0, y=0, z=0)\n set x, y, z\n end",
"def initialize( x, y, z=0 ) ; set( x, y, z ) end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n self.extra_bonus_exp ||= 0\n end",
"def mpt_init=(_arg0); end",
"def test_set_defaults07a\n assert_raise ( RuntimeError ) {\n ArgumentManager.set_defaults(\n {\n :df_int => 'i am an invalid default integer'\n }\n )\n } \n end",
"def zero_initializer\n '{}'\n end",
"def default_values\n \tself.total_worth ||= 0\n \tend",
"def initialize( s0 = 0.0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0.0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0.0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def initialize( s0 = 0 )\n super()\n self[:s0] = s0\n end",
"def zero(*args)\n return 0.0 if args.length == 0\n eval \"0 #{args[0][0]} args[0][1]\"\nend",
"def default_bare=(_arg0); end",
"def initialize default_opts = {}\n @var_map = {}\n @default_opts = default_opts\n end",
"def local_init(args)\n end",
"def default_values\n\t\tself.status = 0 unless self.status\n\t\tself.tagged = 0 unless self.tagged\n\t\tself.searched = 0 unless self.searched\n\tend",
"def two_arg_method_defaults(arg1=0, arg2=\"020202\")\n puts \"Here are my args: #{arg1}, #{arg2}\"\nend",
"def set_defaults\n self.current_score ||= 0\n self.highest_score ||= 0\n self.total_correct ||= 0\n self.total_worth_credit ||= 0\n end",
"def default(a,b,c=2)\n puts \"c should equal 3 now: \"\n puts c\nend",
"def test_set_defaults11a\n assert_raise ( RuntimeError ) {\n ArgumentManager.set_defaults(\n {\n :bind => 0\n }\n )\n } \n end",
"def test_set_defaults05b\n assert_raise ( RuntimeError ) {\n ArgumentManager.set_defaults(\n {\n :max => -10\n }\n )\n } \n end",
"def default_args(a,b,c=1)\n puts \"\\nValues of variables: \",a,b,c\nend",
"def initialize(args)\n\t\targs = defaults.merge(args)\n\t\t@rim = args[:rim]\n\t\t@tire = args[:tire]\n\tend",
"def test_set_defaults04b\n assert_raise ( RuntimeError ) {\n ArgumentManager.set_defaults(\n {\n :min => 20\n }\n )\n } \n end",
"def method (number, default1 = 1, default2 = 2)\nend",
"def set_defaults\n self.min_service_life_months ||= 0\n self.replacement_cost ||= 0\n self.lease_length_months ||= 0\n self.rehabilitation_service_month ||= 0\n self.rehabilitation_labor_cost ||= 0\n self.rehabilitation_parts_cost ||= 0\n self.extended_service_life_months ||= 0\n self.min_used_purchase_service_life_months ||= 0\n self.cost_fy_year ||= current_planning_year_year\n end",
"def set_defaults\n self.mmr ||= 1500\n self.k_value ||= 40\n self.home_mmr ||= self.mmr\n self.away_mmr ||= self.mmr\n self.active ||= true\n self.total_games ||= 0\n end",
"def initialize(*)\n super\n status.default(0)\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0, s1 = 0, s2 = 0, s3 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def set_default\n end",
"def initialize\n set_defaults\n end",
"def initialize\n set_defaults\n end",
"def initialize(args)\n @chainring = args[:chainring] || 40\n @cog = args[:cog] || 18\n @wheel = args[:wheel]\nend",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def set_defaults\n self.balance ||= 0\n end",
"def init(x=nil)\n the_state = {:cnt => 1, :vals => [x]}\n end",
"def set_defaults\n self.annual_inflation_rate ||= 1.1\n self.pcnt_residual_value ||= 0\n self.condition_rollup_weight ||= 0\n end",
"def set_defaults\n super\n self.seating_capacity ||= 0\n self.standing_capacity ||= 0\n self.wheelchair_capacity ||= 0\n end",
"def setDefault\n self.monthlyCost ||= 0.0 # will set the default value only if it's nil\n self.annualCost ||= 0.0\n end",
"def initialize(*args)\n DEFAULT_OPTIONS.each do |option|\n self.send(:\"#{option}=\", self.class.send(:class_variable_get, :\"@@default_#{option}\") )\n end\n end",
"def initialize(default)\n @value = @default = default\n end",
"def test_set_defaults06\n assert_nothing_raised( Exception ) {\n ArgumentManager.set_defaults(\n {\n :min => 20,\n :max => 30\n }\n )\n } \n end",
"def zero(currency = T.unsafe(nil)); end",
"def default _args\n \"default _args;\" \n end",
"def default_values\n self.cash ||= 0.0\n end",
"def initialize(*)\n super\n apply_defaults\n end",
"def default_values\n self.weight ||= 10.0\n end",
"def initialize(*args); end",
"def initialize(*args)\n #This is a stub, used for indexing\n end",
"def set_default_values\n if self.price.nil?\n self.price = 0.0\n end\n if self.rating.nil?\n self.rating = 0\n end\n if self.enabled.nil?\n self.enabled = false\n end\n if self.no_of_reviews.nil?\n self.no_of_reviews = 0\n end\n if self.no_of_registrations.nil?\n self.no_of_registrations = 0\n end\n end",
"def number=(_arg0); end",
"def defaultArguments (x = 22, y = x + 20, z = 50)\n puts \"x = \" + x.to_s\n puts \"y = \" + y.to_s\n puts \"z = \" + z.to_s\n end",
"def defaults!; end",
"def defaults!; end",
"def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def initialize( s0 = 0.0, s1 = 0.0, s2 = 0.0, s3 = 0.0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n self[:s2] = s2\n self[:s3] = s3\n end",
"def set_defaults\n end",
"def set_defaults\n end",
"def initialize_defaults\n %w(show_first_column show_last_column show_row_stripes show_column_stripes).each do |attr|\n send(\"#{attr}=\", 0)\n end\n end",
"def initialize(value = 0, *attrs)\n @value = value.to_f.round\n @currency = self.class.default_currency\n @precision = self.class.default_precision\n \n if attrs.length == 1 && attrs.first.is_a?(Hash)\n @currency = attrs.first[:currency]\n @precision = attrs.first[:precision]\n elsif attrs.length == 1 && attrs.is_a?(Array)\n @currency = attrs.first\n elsif attrs.length == 2\n @currency = attrs.first\n @precision = attrs[1]\n end\n end",
"def set_default(name, *args, &block)\n set(name, *args, &block) unless exists?(name)\nend",
"def set_default(name, *args, &block)\n set(name, *args, &block) unless exists?(name)\nend",
"def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end",
"def initialize( s0 = 0, s1 = 0 )\n super()\n self[:s0] = s0\n self[:s1] = s1\n end"
] | [
"0.7222659",
"0.6853572",
"0.68361557",
"0.67975974",
"0.6758735",
"0.67518103",
"0.66936755",
"0.66505426",
"0.6483156",
"0.6483156",
"0.64736325",
"0.6457962",
"0.6456074",
"0.64322966",
"0.6431414",
"0.642697",
"0.64018947",
"0.6396481",
"0.6390889",
"0.6362062",
"0.6362062",
"0.6362062",
"0.63459224",
"0.63459224",
"0.63459224",
"0.63459224",
"0.63459224",
"0.63459224",
"0.63459224",
"0.63459224",
"0.6326905",
"0.63259894",
"0.6310241",
"0.63028616",
"0.6299781",
"0.62906784",
"0.62886715",
"0.62725365",
"0.6271586",
"0.6269848",
"0.6267392",
"0.62620854",
"0.62589216",
"0.6244174",
"0.62153673",
"0.6213581",
"0.62111217",
"0.6210541",
"0.6210541",
"0.62093997",
"0.62093997",
"0.62093997",
"0.62093997",
"0.62093997",
"0.62093997",
"0.6209179",
"0.61999375",
"0.61999375",
"0.6194914",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61933297",
"0.61930656",
"0.6189515",
"0.61808324",
"0.6173173",
"0.61724347",
"0.61698127",
"0.61553663",
"0.6152924",
"0.6147638",
"0.6146264",
"0.61430115",
"0.61356115",
"0.6135225",
"0.61299354",
"0.6120966",
"0.6119001",
"0.6114507",
"0.61125106",
"0.60993993",
"0.60993993",
"0.60981125",
"0.60981125",
"0.60974216",
"0.6091727",
"0.6091727",
"0.6090864",
"0.6077645",
"0.6077098",
"0.6077098",
"0.6063943",
"0.6063943"
] | 0.63410795 | 30 |
SETTER: this is how you change instance variables from outside | def seconds=(new_seconds)
@seconds = new_seconds
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __setter__\n \"#{self}=\"\n end",
"def instance_variable_set(p0, p1) end",
"def set!(instance, value)\n instance.instance_variable_set(instance_variable_name, value)\n end",
"def set!(instance, value)\n instance.instance_variable_set(@instance_variable_name, value)\n self\n end",
"def instance=(instance); end",
"def set(object, value); end",
"def set; end",
"def set; end",
"def _setter_method\n :\"_#{self[:name]}=\"\n end",
"def _setter_method\n :\"_#{self[:name]}=\"\n end",
"def set_setting\n end",
"def set _obj, _args\n \"_obj set _args;\" \n end",
"def set_instance\n instance_variable_set \"@#{object_name}\", @object\n end",
"def setter\n @setter ||= :\"#{@name}=\"\n end",
"def baz=(value)\n @baz = value\nend",
"def baz=(value)\n @baz = value\nend",
"def class_variable_set(sym,val) end",
"def setVariable _obj, _args\n \"_obj setVariable _args;\" \n end",
"def instance_var=(value)\n @instance_var = value\n end",
"def instance_var=(value)\n @instance_var = value\n end",
"def instance_var=(value)\n @instance_var = value\n end",
"def instance_var=(value)\n @instance_var = value\n end",
"def setter_method\n :\"#{self[:name]}=\"\n end",
"def thing=(aThing)\r\n @thing = aThing\r\nend",
"def set_value( value )\n @value = value \n end",
"def set!(resource, value)\n resource.instance_variable_set(instance_variable_name, value)\n end",
"def setter\n @setter ||= \"#{name}=\"\n end",
"def proxy=(new_value); end",
"def setter\r\n @setter ||= Field.setter(@name)\r\n end",
"def setter_method\n :\"#{self[:name]}=\"\n end",
"def setName _obj, _args\n \"_obj setName _args;\" \n end",
"def set(*args)\n # not supported\n end",
"def set(*args)\n # not supported\n end",
"def set(variable, value)\n controller.instance_variable_set(\"@#{variable}\", value)\n end",
"def set(instance, value)\n set!(instance, typecast(value))\n end",
"def set(*args, &block)\n update(*args, &block)\n end",
"def set!(*args)\n end",
"def set=(_arg0); end",
"def set(instance, value)\n set!(instance, coerce(value))\n end",
"def setValue(value)\n @value = value\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setA=(a)\n @a = a\n end",
"def fire\n @variable.set_value @value, @name\n super\n end",
"def __setobj__(obj); end",
"def class_variable=(value)\n @@class_variable = value \n end",
"def set_instance_variables(values)\n values.each_with_index do |value,i|\n name = self.class.takes[i]\n instance_variable_set \"@#{name}\",value\n end\n @opt = {} if self.class.takes.include?(:opt) and @opt.nil?\n end",
"def instance_var=(value)\r\n @@class_variable = value\r\n end",
"def attr_accessor(*args)\n attr_reader(*args)\n attr_writer(*args)\n end",
"def setFSMVariable _obj, _args\n \"_obj setFSMVariable _args;\" \n end",
"def set(stat, value)\n\t\tinstance_variable_set(\"@#{stat}\", value)\n\tend",
"def put_on_a_hat\n\n # set all instance variables we have in the sinatra request object\n self.instance_variables.each { |v| @sinatra.instance_variable_set(v, self.instance_variable_get(v)) }\n\n end",
"def create_setter\n @model.class_eval <<-EOS, __FILE__, __LINE__\n #{writer_visibility}\n def #{name}=(value)\n self[#{name.inspect}] = value\n end\n EOS\n end",
"def set(value)\n raise NotImplementedError\n end",
"def override_value(param, value)\n self.instance_variable_set(\"@#{param}\", value)\n end",
"def w=(val); self[2] = val; end",
"def attribute=(_arg0); end",
"def attribute=(_arg0); end",
"def attr_writer(*args)\n sym_args=args_to_sym(args)\n sym_args.each do |value|\n self.instance_eval(\"def #{value}=(arg); @#{value}=arg;end;\")\n end\n \n end",
"def set_instance_variables(values)\n values.each_with_index do |value,i|\n name = self.class.takes[i]\n instance_variable_set \"@#{name}\",value\n end\n end",
"def set_attribute(name, value); end",
"def instance_set(attribute, value)\n setter = :\"#{self.name}_#{attribute}=\"\n self.instance.send(setter, value) if instance.respond_to?(setter)\n end",
"def age=(value)\n @age = value\nend",
"def age=(value)\n @age = value\nend",
"def set(&block)\n @set = block\n end",
"def set(&block)\n @set = block\n end",
"def initialize(name, age)\n @name = name # directly uses the instance variable\n self.age = age # uses the setter method\n end",
"def __copy_on_write__(*)\n super.tap do\n new_set = __getobj__.instance_variable_get(:@set).dup\n __getobj__.instance_variable_set(:@set, new_set)\n end\n end",
"def set_instance_variables( params )\n params.each do |key,val|\n #self.instance_eval(\"@#{key.to_s} = '#{val}'\")\n self.class.class_eval %(\n class << self; attr_accessor :#{key} end\n )\n\n self.instance_variable_set( \"@#{key}\", val )\n end\n end",
"def __setobj__\n raise \"ObjectProxy does not support changing referenced object\"\n end",
"def hack\n self.price = 200\n end",
"def old_value=(_arg0); end",
"def setFromEditor _obj, _args\n \"_obj setFromEditor _args;\" \n end",
"def single_object_db=(v); end",
"def x=(value)\n end",
"def value=(val); end",
"def value=(value); self.data.value = value; end",
"def set!(x, y=self.x, z=self.y)\n end",
"def set(value)\n value\n end",
"def set(field,value)\n set_method = (field.to_s + \"=\").to_sym\n m = self.method((field.to_s + \"=\").to_sym)\n m.call value\n end",
"def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info(\"#{@name} = #{value.inspect} (#{value.class})\")\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end",
"def setting; end",
"def setX(x) \n @x = x\n end",
"def set_ivar\n <<-CODE\n next_literal;\n t2 = stack_pop();\n object_set_ivar(state, c->self, _lit, t2);\n stack_push(t2);\n CODE\n end",
"def set_nombre(nombre) # la convencion de ruby es def nombre=(nombre) * Sin espacios\n @nombre = nombre\n end",
"def setX(x)\n @x = x\n end",
"def reset_age=(new_age)\n @age=new_age\nend",
"def method_missing field, *args, &block\n set field, *args, &block\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def setBehaviour _obj, _args\n \"_obj setBehaviour _args;\" \n end",
"def instance_method=(value)\n # self => foo, self.class => Foo\n @instance_var = value\n\n # assigning to @singleton_instance_var here would create an instance variable of Foo\n # (which is independent of class varibale with same name)\n # @singleton_instance_var = value\n end",
"def set(x, y)\n @x = x\n @y = y\n self\n end",
"def define_setter\n name = @name\n klass.send :define_method, \"#{name}=\" do |unit|\n send \"#{name}_value=\", unit.value\n send \"#{name}_unit=\", unit.unit.to_s\n end\n end",
"def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info('value = ', value.inspect, ' (',value.class,')')\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end",
"def set_name=(name)\n @name=name\n end",
"def assign_property(name, value); end",
"def fld=(val); @fld = val end",
"def initialize\n @instance_variable = 3 # Available in instance methods\n end",
"def change_it(val)\n val = 5\nend",
"def public=(_arg0); end",
"def to_setter\n\t\t\t\t(to_getter.to_s+\"=\").to_sym\n\t\t\tend",
"def set_resource value\n instance_variable_set(resource_name, value)\n end"
] | [
"0.7314075",
"0.7203706",
"0.7091228",
"0.70637614",
"0.7028197",
"0.6939434",
"0.686328",
"0.686328",
"0.67835385",
"0.67055833",
"0.6695053",
"0.6674326",
"0.6666394",
"0.6623259",
"0.65997064",
"0.65997064",
"0.65984195",
"0.65937316",
"0.6575329",
"0.6575329",
"0.6575329",
"0.6575329",
"0.6566325",
"0.65575296",
"0.6541564",
"0.6527095",
"0.64911544",
"0.6488338",
"0.64798886",
"0.6476528",
"0.64644516",
"0.645462",
"0.645462",
"0.64214814",
"0.6413811",
"0.64113927",
"0.6410322",
"0.6387203",
"0.63657933",
"0.6322719",
"0.63206637",
"0.6297468",
"0.6292941",
"0.62874067",
"0.6283635",
"0.6277126",
"0.6274668",
"0.625494",
"0.6245749",
"0.62245613",
"0.62209743",
"0.621506",
"0.6212754",
"0.62103266",
"0.62060064",
"0.6203127",
"0.6203127",
"0.61981875",
"0.61869895",
"0.61855096",
"0.6166985",
"0.6165889",
"0.6165889",
"0.61648446",
"0.61648446",
"0.6156674",
"0.6134809",
"0.61292",
"0.6117472",
"0.6113672",
"0.6101752",
"0.60929394",
"0.60875016",
"0.6078777",
"0.6059112",
"0.605233",
"0.6048637",
"0.6042719",
"0.60413325",
"0.6030652",
"0.6025217",
"0.60249746",
"0.60206133",
"0.6009392",
"0.6002658",
"0.6001173",
"0.5990081",
"0.5989113",
"0.59824836",
"0.5979856",
"0.59791",
"0.597843",
"0.5969679",
"0.5968465",
"0.5968095",
"0.5967699",
"0.59673977",
"0.5967048",
"0.5966774",
"0.5963292",
"0.5959528"
] | 0.0 | -1 |
GETTER: this returns the value of the instance variable | def seconds
@seconds
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get\n @value\n end",
"def get\n val\n end",
"def get\n val\n end",
"def get_value\n @value\n end",
"def get_value\n @value \n end",
"def get(value)\n value\n end",
"def get\n @mutex.synchronize { @value }\n end",
"def value\r\n @value\r\n end",
"def value_get name\n instance_variable_get(:\"@#{name}\")\n end",
"def value\n return @value\n end",
"def value\n return @value\n end",
"def value\n return @value\n end",
"def get_value\n value\n end",
"def get_value\n value\n end",
"def value \n @value\n end",
"def getvalue\n @variable.get_value @name\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def get\n data[\"_value\"]\n end",
"def value\n self[@name]\n end",
"def value\n self\n end",
"def fetch\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def get_value name\n get name\n end",
"def value\n return @val\n end",
"def value\n variable.value\n end",
"def instance\n local.value\n end",
"def value\n @value ||= extract_value\n end",
"def value\n Reac.value(self)\n end",
"def get!(instance)\n instance.instance_variable_get(@instance_variable_name)\n end",
"def get_value name=nil\n @value\n end",
"def value!\n @value\n end",
"def get!(instance)\n instance.instance_variable_get(instance_variable_name)\n end",
"def value\n self['value']\n end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value() end",
"def getvalue\n @source.getvalue\n end",
"def get(instance)\n if instance.instance_variable_defined?(@instance_variable_name)\n get!(instance)\n else\n value = default.call(instance, self)\n set!(instance, value)\n value\n end\n end",
"def get\n object\n end",
"def instance_variable_get(p0) end",
"def get_it\n @myvar\n end",
"def property\n @property\n end",
"def value\n raise NotImplementedError\n end",
"def get_value\n @get_value_handler.call\n end",
"def value\n record.send(name).value\n end",
"def car\n @value1\n end",
"def instance_var\n @instance_var\n end",
"def get()\n \n end",
"def print_value\n\t\t\treturn @value\n\t\tend",
"def print_value\n\t\t\treturn @value\n\t\tend",
"def value\n @value || default_value\n end",
"def value\n if @value\n @value\n else\n @value = resolve( :value )\n end\n end",
"def value\n attributes.fetch(:value)\n end",
"def print_value\n\t\treturn @value\n\tend",
"def getX\n @x\n end",
"def value(); self.data.value; end",
"def getter\r\n @getter ||= Field.getter(@name)\r\n end",
"def get_value(key)\n self[key]\n end",
"def current_value\n @value\n end",
"def get(name)\n\t\tinstance_variable_get(\"@#{name}\") || 0\n\tend",
"def instance_var\n @instance_var\n end",
"def instance_var\n @instance_var\n end",
"def instance_var\n @instance_var\n end",
"def value\n @property_hash[:value]\n end",
"def value\n @base_object\n end",
"def value\n @base_object\n end",
"def getters; end",
"def age\n @age\n end",
"def age\n @age\n end",
"def age\n @age\n end",
"def get(name)\n __get(name, false)\n end",
"def age\n @age\nend",
"def get(context = Context.current)\n context[self]\n end",
"def result\n Namespace.root.context.instance_variable_get(variable_name)\n end"
] | [
"0.8289848",
"0.81380045",
"0.81380045",
"0.7707077",
"0.76995116",
"0.75391614",
"0.746769",
"0.7435873",
"0.73937696",
"0.7388659",
"0.7388659",
"0.7388659",
"0.73704356",
"0.73704356",
"0.73574436",
"0.73485553",
"0.7304236",
"0.7304236",
"0.7304236",
"0.7304236",
"0.7304236",
"0.7304236",
"0.7304236",
"0.73031807",
"0.72898465",
"0.7286176",
"0.7270354",
"0.72675794",
"0.72675794",
"0.72265166",
"0.7218628",
"0.72013074",
"0.71798825",
"0.7090131",
"0.7083092",
"0.7066295",
"0.7038297",
"0.7035087",
"0.7028511",
"0.7010002",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69471204",
"0.69442314",
"0.69382113",
"0.6930528",
"0.69025123",
"0.68582016",
"0.68554884",
"0.6851222",
"0.68369734",
"0.68312234",
"0.6823204",
"0.67857563",
"0.67707634",
"0.6763068",
"0.6752869",
"0.6752869",
"0.6725373",
"0.6699155",
"0.66846514",
"0.6683288",
"0.66761476",
"0.6672342",
"0.6660212",
"0.66568273",
"0.6653556",
"0.66529334",
"0.66407233",
"0.66407233",
"0.66407233",
"0.6623538",
"0.6615188",
"0.6615188",
"0.6594838",
"0.65927327",
"0.65927327",
"0.65927327",
"0.659209",
"0.6569299",
"0.65672404",
"0.6558888"
] | 0.0 | -1 |
This is the quick smart way | def time_string
hours = @seconds/3600 #if not an hour will be stored as 0
remainder = @seconds%3600 #modulo gives the amount that remains
sprintf("%02d:%02d:%02d", hours, remainder/60, remainder%60) #string formatting
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def schubert; end",
"def suivre; end",
"def probers; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def terpene; end",
"def anchored; end",
"def stderrs; end",
"def refutal()\n end",
"def formation; end",
"def verdi; end",
"def identify; end",
"def berlioz; end",
"def intensifier; end",
"def weber; end",
"def used?; end",
"def ibu; end",
"def who_we_are\r\n end",
"def zuruecksetzen()\n end",
"def malts; end",
"def hiss; end",
"def first; end",
"def first; end",
"def issn; end",
"def villian; end",
"def custom; end",
"def custom; end",
"def common\n \n end",
"def ismn; end",
"def offences_by; end",
"def operations; end",
"def operations; end",
"def same; end",
"def gounod; end",
"def spice; end",
"def schumann; end",
"def sitemaps; end",
"def parts; end",
"def parts; end",
"def parts; end",
"def tiny; end",
"def bs; end",
"def checks; end",
"def romeo_and_juliet; end",
"def trd; end",
"def isolated; end",
"def isolated; end",
"def placebo?; false end",
"def getc() end",
"def getc() end",
"def getc() end",
"def check ; true ; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def rossini; end",
"def jack_handey; end",
"def generate_comprehensive\n\n end",
"def buzzword; end",
"def buzzword; end",
"def safe; end",
"def ignores; end",
"def celebration; end",
"def first?; end",
"def user_os_complex\r\n end",
"def internship_passed; end",
"def hd\n \n end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def wrapper; end",
"def flag; end",
"def from; end",
"def from; end",
"def from; end",
"def from; end",
"def strategy; end",
"def sld; end",
"def internal; end",
"def usable?; end",
"def extra; end",
"def pausable; end",
"def beautify; end",
"def beautify; end",
"def loc; end",
"def loc; end",
"def loc; end",
"def r; end",
"def r; end",
"def strain; end",
"def implementation; end",
"def implementation; end",
"def missing?; end"
] | [
"0.674454",
"0.6229655",
"0.6138724",
"0.6109446",
"0.5984392",
"0.5984392",
"0.5984392",
"0.5984392",
"0.5767738",
"0.570093",
"0.565776",
"0.56045496",
"0.5586229",
"0.5579268",
"0.55474216",
"0.55465907",
"0.5529137",
"0.551397",
"0.54968756",
"0.5484835",
"0.54398924",
"0.5409979",
"0.54024994",
"0.5374585",
"0.53710896",
"0.53710896",
"0.5348127",
"0.5339529",
"0.5335873",
"0.5335873",
"0.5335674",
"0.5330197",
"0.5303731",
"0.530175",
"0.530175",
"0.52956074",
"0.52801645",
"0.5253926",
"0.52436095",
"0.5233166",
"0.5223112",
"0.5223112",
"0.5223112",
"0.5217839",
"0.52164966",
"0.5211541",
"0.5209553",
"0.5205991",
"0.5196087",
"0.5196087",
"0.51921856",
"0.5175798",
"0.5175798",
"0.5175798",
"0.51709163",
"0.5157703",
"0.5157703",
"0.5157703",
"0.5157703",
"0.5157703",
"0.5157703",
"0.5157703",
"0.5157703",
"0.5157703",
"0.51470155",
"0.51450926",
"0.51387024",
"0.51345915",
"0.51345915",
"0.51345557",
"0.51264524",
"0.5122675",
"0.5115003",
"0.510857",
"0.51037383",
"0.5102115",
"0.5091178",
"0.5091178",
"0.50806344",
"0.507755",
"0.5069483",
"0.5069483",
"0.5069483",
"0.5069483",
"0.50686234",
"0.5067668",
"0.5066421",
"0.5064923",
"0.5063924",
"0.50574195",
"0.50537664",
"0.50537664",
"0.5049222",
"0.5049222",
"0.5049222",
"0.50452036",
"0.50452036",
"0.50383574",
"0.50291204",
"0.50291204",
"0.50128174"
] | 0.0 | -1 |
Returns the api properties used to connect to the network service resource | def api
{
'host' => self['apiHost'],
'password' => self['apiPassword'],
'path' => self['apiPath'],
'port' => self['apiPort'],
'protocol' => self['apiProtocol'],
'username' => self['apiUsername']
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def client_properties\n end",
"def read_network_properties_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_network_properties ...\"\n end\n # resource path\n local_var_path = \"/node/network\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeNetworkProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_network_properties\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_server_properties\n http_get(:uri=>\"/server/properties\", :fields=>x_cookie)\n end",
"def get_properties\n xml = client.call(\"#{attributes[:url]}/property\").parsed_response\n xml.css('properties property').map { |p| Vebra::Property.new(p, self) }\n end",
"def properties\n @properties ||=\n Hash[Array(@grpc.properties).map { |p| [p.name, p.value] }]\n end",
"def get_config()\n return @api.do_request(\"GET\", get_base_api_path() + \"/config\")\n end",
"def network_configuration\n dns = settings.provider.network.dns\n dns = dns.split(\",\") if dns.is_a?(String)\n {\n \"ip\"=>public_ip,\n \"netmask\"=>settings.provider.network.netmask,\n \"gateway\"=>settings.provider.network.gateway,\n \"dns\"=>dns,\n \"cloud_properties\"=>{\n \"name\"=>settings.provider.network.name\n }\n }\n end",
"def properties\n _properties\n end",
"def endpoint_options\n {user: @username,\n pass: @password,\n host: @host,\n port: @port,\n operation_timeout: @timeout_in_seconds,\n no_ssl_peer_verification: true,\n disable_sspi: true}\n end",
"def properties\n @properties\n end",
"def cr_network_config\n @node[\"network\"]\n end",
"def get_serv_config\n\t\taction = \"configuration\"\n\t\tresponse = call_api(action)\n\tend",
"def get_properties()\n resp = conn.get('/users/'+name+'/props/')\n \n case resp.code.to_i\n when 200\n return JSON.parse(resp.body)\n when 404\n raise RestAuthUserNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( rest )\n end\n end",
"def properties\n @properties\n end",
"def read_network_properties(opts = {})\n data, _status_code, _headers = read_network_properties_with_http_info(opts)\n return data\n end",
"def api_connector_configuration\n return @api_connector_configuration\n end",
"def properties\n self.class.get_properties\n end",
"def properties\n @properties ||= {}\n end",
"def read_node_properties_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_node_properties ...\"\n end\n # resource path\n local_var_path = \"/node\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_node_properties\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_property\n @xml = client.call(url).parsed_response.css('property').first\n @attributes.merge!(parse_xml_to_hash)\n end",
"def read_proton_service_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_proton_service ...\"\n end\n # resource path\n local_var_path = \"/node/services/manager\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeProtonServiceProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_proton_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def web_properties\n Management::WebProperty.all(self)\n end",
"def get_properties()\n return @properties\n end",
"def settings\n self.network[self.class]\n end",
"def propname_properties\n props = self.properties\n if supports_locking?\n props = props.dup if props.frozen?\n props << { name: 'lockdiscovery', ns_href: DAV_NAMESPACE }\n end\n props\n end",
"def property_properties\n _property_properties\n end",
"def configuration\n cfg = {:service => @service}\n cfg[:acl] = @acl.name if (@acl)\n cfg[:avpairs] = @avpairs if (@avpairs)\n cfg[:network_av] = @network_av.configuration if (@network_av)\n cfg[:shell_command_av] = @shell_command_av.configuration if (@shell_command_av)\n return(cfg)\n end",
"def properties\n @properties ||= {}\n end",
"def resource_operations\n attributes.fetch(:resourceOperations)\n end",
"def connection_status_client_setting; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def properties; end",
"def inferred_properties(hash)\n service_type = self.service_type\n case service_type\n when PrismeService::TOMCAT\n self.service_properties.each do |sp|\n if (sp.key.eql?(PrismeService::CARGO_REMOTE_URL))\n url = sp.value\n hash[PrismeService::CARGO_HOSTNAME] = (URI url).host\n hash[PrismeService::CARGO_SERVLET_PORT] = ((URI url).port).to_s\n end\n end\n end\n end",
"def property_dependencies\n {\n host_keys: %i[hostname host_ip]\n }\n end",
"def properties\n @properties ||= {}\n end",
"def properties\n @properties ||= {}\n end",
"def properties\n self.class.properties\n end",
"def DefProperties\n defProperty('env', 'ORBIT', \"testbed to be used: ORBIT, NEPTUNE\")\n defProperty('initialChannels', '', \"initial channels to be used on all the nodes\")\n defProperty('mdebug', '', \"set to yes if you want to enable debug (currently only for l2r)\")\n defProperty('stats', '', \"number of seconds between each collection of statistics. 0 to avoid at all collecting statistics.\")\n defProperty('setAp', '', \"IBSS id to set on interfaces in ad-hoc mode: the following command is called: iwconfig <interface> ap <value_given>\")\n defProperty('startTcpdump', 'no', \"set to yes to have Tcpdump started on nodes\")\n defProperty('channels', nil, \"comma separated list of channels to use\")\n defProperty('stabilizeDelay', '', \"time to wait for the network to stabilize before starting the experiment\")\n defProperty('wifiStandard', '', \"wifi standard (e.g. a or n)\")\n end",
"def resource_properties\n props = {}\n props['Path'] = @resource.path\n\n build_path = @resource.destination_path\n build_path = 'Not built' if ignored?\n props['Build Path'] = build_path if @resource.path != build_path\n props['URL'] = content_tag(:a, @resource.url, href: @resource.url) unless ignored?\n props['Source File'] = @resource.file_descriptor ? @resource.file_descriptor[:full_path].to_s.sub(/^#{Regexp.escape(ENV['MM_ROOT'] + '/')}/, '') : 'Dynamic'\n\n data = @resource.data\n props['Data'] = data.to_hash(symbolize_keys: true).inspect unless data.empty?\n\n options = @resource.options\n props['Options'] = options.inspect unless options.empty?\n\n locals = @resource.locals.keys\n props['Locals'] = locals.join(', ') unless locals.empty?\n\n props\n end",
"def properties\n { 'message_type' => 'compatibility', 'protocol_version' => @protocol_version }\n end",
"def required_properties\n {\n \"cc\" => {\n \"internal_service_hostname\" => \"cc.service.cf.internal\"\n },\n \"loggregator\" => {\n \"etcd\" => {\n \"machines\" => []\n },\n \"uaa\" => {\n \"client_secret\" => \"secret\"\n }\n },\n \"system_domain\" => \"bosh-lite.com\",\n }\n end",
"def get_properties_with_http_info(did, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesManagementApi.get_properties ...\"\n end\n # verify the required parameter 'did' is set\n fail ArgumentError, \"Missing the required parameter 'did' when calling DevicesManagementApi.get_properties\" if did.nil?\n # resource path\n local_var_path = \"/devicemgmt/devices/{did}/properties\".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'includeTimestamp'] = opts[:'include_timestamp'] if !opts[:'include_timestamp'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'MetadataEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesManagementApi#get_properties\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def web_properties\n WebProperty.all(:account => self)\n end",
"def getProperties\n @widget = Widget.find(params[:id])\n wtype = WidgetType.find(@widget.widget_type_id)\n\n # Return a hash of properties obtained from each source\n # TBD: Currently used for cal widget. Can be used to send authentication tokens\n srcdata = {}\n str2lst(@widget.sources).each do |source_id|\n src = Source.find(source_id)\n sdata = src.getProperties()\n #logger.debug(\"getProperties():sdata = #{sdata}\")\n srcdata[source_id] = sdata\n end\n\n data = {:srcdata => srcdata}\n #logger.debug(\"getProperties():data = #{data}\")\n\n # The final returned hash looks like this\n # data -> {\n # srcdata -> { ... },\n # };\n render :json => {:data => data}\n end",
"def property_to_rest_mapping\n {\n :name => :aclname,\n :interface => :Interface,\n }\n end",
"def get_endpoint()\n end",
"def read_ntp_service_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_ntp_service ...\"\n end\n # resource path\n local_var_path = \"/node/services/ntp\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeNtpServiceProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_ntp_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def properties\n model.properties\n end",
"def properties\n return @properties\n end",
"def transport_options\n definition.transport_options\n end",
"def read_proxy_service_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_proxy_service ...\"\n end\n # resource path\n local_var_path = \"/node/services/http\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeHttpServiceProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_proxy_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_properties(options={})\n return send_message(SkyDB::Message::GetProperties.new(options))\n end",
"def properties\n start = Time.now\n debug \"Checking properties for device group: \\\"#{resource[:full_path]}\\\"\"\n connection = self.class.get_connection(resource[:account])\n properties = Hash.new\n device_group = get_device_group(connection, resource[:full_path], 'id')\n if device_group\n device_group_properties = rest(connection,\n Puppet::Provider::Logicmonitor::DEVICE_GROUP_PROPERTIES_ENDPOINT % device_group['id'],\n Puppet::Provider::Logicmonitor::HTTP_GET,\n build_query_params('type:custom,name!:system.categories,name!:puppet.update.on',\n 'name,value'))\n if valid_api_response?(device_group_properties, true)\n device_group_properties['data']['items'].each do |property|\n name = property['name']\n value = property['value']\n if value.include?('********') && resource[:properties].has_key?(name)\n debug 'Found password property. Verifying'\n verify_device_group_property = rest(connection,\n Puppet::Provider::Logicmonitor::DEVICE_GROUP_PROPERTIES_ENDPOINT % device_group['id'],\n Puppet::Provider::Logicmonitor::HTTP_GET,\n build_query_params(\"type:custom,name:#{name},value:#{value}\", nil, 1))\n if valid_api_response?(verify_device_group_property)\n debug 'Property unchanged'\n value = resource[:properties][name]\n else\n debug 'Property changed'\n end\n end\n properties[name] = value\n end\n else\n alert device_group_properties\n end\n else\n alert device_group\n end\n debug \"Finished in #{(Time.now-start)*1000.0} ms\"\n properties\n end",
"def show\n format = params[:format] || 'json'\n data = @container.config.get_properties(flavor: :public, format: format)\n\n render response_ok data\n end",
"def config\n ModelApi.config\n end",
"def property_keys\n headers = { 'Accept' => 'application/json; charset=UTF-8' }\n get_request 'propertykeys', headers\n end",
"def network_connections_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.network_connections ...'\n end\n allowable_values = [\"pending\", \"connected\", \"introduced\"]\n if @api_client.config.client_side_validation && opts[:'states'] && !allowable_values.include?(opts[:'states'])\n fail ArgumentError, \"invalid value for \\\"states\\\", must be one of #{allowable_values}\"\n end\n allowable_values = [\"connected\", \"introduced\"]\n if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])\n fail ArgumentError, \"invalid value for \\\"direction\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/network/connections'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil?\n query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse2004' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#network_connections\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def api_config()\n AdwordsApi::ApiConfig\n end",
"def configuration\n _get(\"/system/configuration\") { |json| json }\n end",
"def api_metadata\n service_id = @context.config.api.metadata['serviceId']\n return unless service_id\n\n service_id = service_id.gsub(' ', '_').downcase\n gem_version = @context[:gem_version]\n \"api/#{service_id}##{gem_version}\"\n end",
"def intersys_properties\n properties = Intersys::Object.common_get_or_set('@properties', {})\n properties[class_name] ||= intersys_reflector.properties.to_a\n end",
"def base_properties\n %i[title\n creator\n contributor\n description\n keyword\n license\n rights_statement\n publisher\n date_created\n subject\n language\n identifier\n based_near\n related_url\n resource_type\n source].freeze\n end",
"def restclient_option_keys\n [:method, :url, :payload, :headers, :timeout, :open_timeout,\n :verify_ssl, :ssl_client_cert, :ssl_client_key, :ssl_ca_file]\n end",
"def transferred_properties; end",
"def transferred_properties; end",
"def props\n ret = {\"_neo_id\" => getId()}\n iter = getPropertyKeys.iterator\n while (iter.hasNext) do\n key = iter.next\n ret[key] = getProperty(key)\n end\n ret\n end",
"def resource_properties\n {\n 'Path' => @resource.path,\n 'Output Path' => File.join(@resource.app.build_dir, @resource.destination_path),\n 'Url' => content_tag(:a, @resource.url, :href => @resource.url),\n #'Metadata' => @resource.metadata,\n 'Source' => @resource.source_file\n }\n end",
"def props\n props = Openvpn::Generators::Keys::Properties\n\n props.default.merge props.yaml\n end",
"def meta\n data,stat = @zk.get(:path => ZK::Config::ServicePath + \"/#{@service_name}/#{@name}\")\n stat\n end",
"def to_configure_properties\n ['@security', '@channel_flags', '@clas', '@race', '@traits', '@sign', '@stuff']\n end",
"def raw_system_properties(addr, user, password)\n http_get(\n addr,\n '/system/console/status-System%20Properties.txt',\n user,\n password\n ).body\n end",
"def properties\n self.class.properties.keys\n end",
"def net\n @net\n end",
"def jsonProperties\n\t\t\tallItems = {\n\t\t\t\t:mp3Url\t\t=> @mp3Url,\n\t\t\t}\n\t\t\treturn allItems\n\n\t\tend",
"def props()\n @props\n end",
"def props\n ret = {}\n iter = @internal_node.getPropertyKeys.iterator\n while (iter.hasNext) do\n key = iter.next\n ret[key] = @internal_node.getProperty(key)\n end\n ret\n end",
"def platform_endpoint; end",
"def network\n\n\t\tdebug \"Network paramentrs\"\n\t\tnetwork = []\n\t\tiface = resource[:interfaces]\n\t\tif iface.nil? \n\t\t\tnetwork = [\"--network\", \"network=default\"]\n\t\telsif iface == \"disable\"\n\t\t\tnetwork = [\"--nonetworks\"]\n\t\telse\n\t\t\tiface.each do |iface|\n\t\t\t\tif interface?(iface)\t\n\t\t\t\t\tnetwork << [\"--network\",\"bridge=\"+iface]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\tmacs = resource[:macaddrs]\n\t\tif macs\n\t\t\tresource[:macaddrs].each do |macaddr|\n\t\t\t\t#FIXME -m is decrepted\n\t\t\t\tnetwork << \"-m\"\n\t\t\t\tnetwork << macaddr\n\t\t\tend\n\t\tend\n\n\t\treturn network\n\tend",
"def api_url\n @@API_URL\n end",
"def client_info\n self.class.client_info\n end",
"def read_proton_service_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.read_proton_service_status ...\"\n end\n # resource path\n local_var_path = \"/node/services/manager/status\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeServiceStatusProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#read_proton_service_status\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def client_config\n cc = Settings.dig(:connection, connection_type)\n return cc unless host\n\n uhost = URI(host)\n cc.host = uhost.hostname\n cc.port = uhost.port\n cc.scheme = uhost.scheme\n cc\n end",
"def props(host)\n if $PROPERTIES.has_key?(host)\n if $PROPERTIES[host].has_key?(:props)\n #get the default properties\n default_props=$PROPERTIES[\"default\"][:props]\n #merge with the properties for that host\n props=default_props.merge($PROPERTIES[host][:props])\n else\n #send default properties\n props=$PROPERTIES[\"default\"][:props]\n end\n else \n #send default properties\n props=$PROPERTIES[\"default\"][:props]\n end\n props\nend",
"def properties\n decorate_with_methods(read_attribute(:properties))\n end",
"def server_settings\n [\n {\n url: \"https://api.shipengine.com\",\n description: \"No description provided\",\n }\n ]\n end",
"def base_attributes\n\t\t\t\t\t# Base Attributes to be sent for foreman host creation API\n\t\t\t\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\" \t\t\t\t\t=> self.name,\n \n\t\t\t\t\t\t\"compute_resource_id\" \t=> self.compute_resource_id,\n\n\t\t\t\t\t\t\"compute_profile_id\" \t=> self.compute_profile_id,\n\t\t\t\t\t\t\n\t\t\t\t\t\t\"managed\"\t\t\t\t=> \"true\",\n\n\t\t\t\t\t\t\"type\"\t\t\t\t\t=> \"Host::Managed\",\t\t\t\t\t\t\n\n\t\t\t\t\t\t\"provision_method\"\t\t=> \"build\",\n\n\t\t\t\t\t\t\"build\"\t\t\t\t\t=> \"1\",\t\t\t\t\t\t\n\n\t\t\t\t\t\t\"disk\"\t\t\t\t\t=> \"\",\t\t\t\t\t\t\n\n\t\t\t\t\t\t\"enabled\"\t\t\t\t=> \"1\",\n\n\t\t\t\t\t\t\"model_id\"\t\t\t\t=> \"\",\n\n\t\t\t\t\t\t\"comment\"\t\t\t\t=> \"\",\n\n\t\t\t\t\t\t\"overwrite\" \t\t\t=> \"false\",\t\t\t\t\t\n\n\t\t\t\t\t\t\"mac\"\t\t\t\t\t=> \"\",\n\t\t\t\t\t\t\"organization_id\"\t\t=> self.organization_id,\n\t\t\t\t\t\t\"location_id\"\t\t\t=> self.location_id,\n\t\t\t\t\t\t\"owner_id\"\t\t\t\t=> self.user_id,\n\t\t\t\t\t\t\"owner_type\"\t\t\t=> \"User\",\n\t\t\t\t\t\t\n\t\t\t\t\t}.merge(self.host_parameters)\n\t\t\t\tend",
"def properties; @message_impl.getProperties; end",
"def api\n return @api\n end",
"def get_image_properties(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :GET, 'ImagingResponse')\n end",
"def network\n @_network\n end",
"def http_endpoint_enabled\n data[:http_endpoint_enabled]\n end",
"def softlayer_properties(object_mask = nil)\n my_service = self.service\n\n if(object_mask)\n my_service = my_service.object_mask(object_mask)\n else\n my_service = my_service.object_mask(self.class.default_object_mask)\n end\n\n my_service.getObject()\n end",
"def softlayer_properties(object_mask = nil)\n my_service = self.service\n\n if(object_mask)\n my_service = my_service.object_mask(object_mask)\n else\n my_service = my_service.object_mask(self.class.default_object_mask)\n end\n\n my_service.getObject()\n end",
"def softlayer_properties(object_mask = nil)\n my_service = self.service\n\n if(object_mask)\n my_service = my_service.object_mask(object_mask)\n else\n my_service = my_service.object_mask(self.class.default_object_mask)\n end\n\n my_service.getObject()\n end"
] | [
"0.672411",
"0.6707109",
"0.62542915",
"0.612648",
"0.605689",
"0.5968345",
"0.59643066",
"0.5953441",
"0.5942669",
"0.5938788",
"0.5931861",
"0.5915803",
"0.58995813",
"0.58844525",
"0.5821192",
"0.5810311",
"0.5763357",
"0.5747126",
"0.57311344",
"0.5715752",
"0.57139266",
"0.57138336",
"0.5688502",
"0.5655951",
"0.5653729",
"0.56414884",
"0.5633574",
"0.5630528",
"0.56264234",
"0.5626394",
"0.5603234",
"0.5603234",
"0.5603234",
"0.5603234",
"0.5603234",
"0.5603234",
"0.5603234",
"0.5603234",
"0.558765",
"0.55845237",
"0.55836356",
"0.55836356",
"0.55733293",
"0.5562205",
"0.55459857",
"0.5542695",
"0.5535174",
"0.5522137",
"0.55220705",
"0.55120105",
"0.5496108",
"0.5492267",
"0.5487966",
"0.5481917",
"0.54809195",
"0.5479983",
"0.54772323",
"0.5477146",
"0.546945",
"0.54677856",
"0.546466",
"0.5453818",
"0.54508275",
"0.5434993",
"0.54299325",
"0.54213935",
"0.54083335",
"0.54042196",
"0.5397777",
"0.5395192",
"0.5395192",
"0.53940326",
"0.53922915",
"0.5388681",
"0.5388659",
"0.53816944",
"0.5373669",
"0.5364992",
"0.5362702",
"0.53561544",
"0.5353172",
"0.53484976",
"0.5347837",
"0.5345352",
"0.5344977",
"0.5341983",
"0.53339493",
"0.5328848",
"0.53281415",
"0.53260225",
"0.53173834",
"0.5314152",
"0.5311567",
"0.5308695",
"0.53069705",
"0.5304342",
"0.530398",
"0.5300362",
"0.5300362",
"0.5300362"
] | 0.6429231 | 2 |
Returns the network service resource type name | def type
self['type']['type']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_name\n raise TypeError, 'no type on this reply' unless\n instance_variable_defined? :@type\n\n @type.split('.').first.sub '_', ''\n end",
"def get_resource_type_identifier(type)\n get_type_identifier(type, Occi::Core::Resource.kind)\n end",
"def resource_name\n resource_class.slice(0,1).downcase + resource_class.slice(1,resource_class.length)\n end",
"def type(type = nil)\n @type = type if type\n @type || name.split('::').last.gsub(/Resource$/, '').underscore\n end",
"def service_name\n resource[:name]\n end",
"def resource_name\n \"#{self.class.to_s.split(\"::\").last.downcase}s\"\n end",
"def get_resource_type()\n return RedXmlResource::TYPE\n end",
"def type_name\n self.class.name.split('::').last.upcase\n end",
"def type_as_class(resource_name)\n\t resource_name.singularize.capitalize.constantize\n\tend",
"def type\n query_root_node(\"rdf:type/@rdf:resource\", @@NAMESPACES).to_s\n end",
"def name(_prefix = false)\n 'Resource Types'\n end",
"def get_ruby_specific_resource_type_name(resource_type_name)\n resource_type_name.slice(resource_type_name.rindex('.') + 1, resource_type_name.length - 1)\n end",
"def get_resource_type(type, resource_path)\n changed_path = resource_path.split('/').last\n if type.eql?('singular')\n changed_path.singularize.to_sym\n else\n changed_path.to_sym\n end\n end",
"def service_type_name\n \"\" \n end",
"def resource_class\n (self.class.name.split('::').last || '').downcase\n end",
"def type_name\n @type_name ||= self.name.demodulize.underscore\n end",
"def resource_klass_name\n resource_name.classify\n end",
"def _service_type\n self.class.service_type\n end",
"def get_resource_class\n \tresource_name.classify.constantize\n end",
"def resource_type\n return @resource_type\n end",
"def resource_type\n return @resource_type\n end",
"def resource_type\n return @resource_type\n end",
"def resource_type\n return @resource_type\n end",
"def type\n self.class.to_s.split('::').last.downcase.to_sym\n end",
"def service_type_name\n \"REST\"\n end",
"def getResourceType() \n @obj.getResourceType() \n end",
"def resource_name\n resource[:name].gsub(/\\s/, '_').downcase.singularize\n end",
"def resource_class_name\n @resource_class_name ||= resource_name.classify.constantize\n end",
"def type\n _type.split(\"::\").last.downcase\n end",
"def type\n if entity.respond_to?(:resource_type)\n entity.resource_type\n else\n entity.class\n end.to_s\n end",
"def type_name\n @type_name ||= name.underscore\n end",
"def resource\n self.class.to_s.split('::').last.downcase\n end",
"def name\n @service.name.to_s\n end",
"def resource_name\n resource_class.resource_name\n end",
"def type_url\n query_root_node(\"rdf:type/@rdf:resource\", @@NAMESPACES).to_s\n end",
"def resource_name\n resource.name.singularize.underscore\n end",
"def resource_as_constant_name\n if klass_or_instance.is_a?(Class)\n klass_or_instance.name\n else\n klass_or_instance.class.name\n end\n end",
"def resource_name\n resource_specification.name\n end",
"def resource_name\n resource_module.to_s.demodulize\n end",
"def option_type(ns=[])\n a_template = (self =~ /template/) == 0\n a_service = self =~ /^[A-Z][a-zA-Z]*\\[[a-zA-Z0-9\\-\\.\\\"\\'_\\$\\{\\}\\/]*\\]/i\n a_function = self =~/(.)*\\((.)*\\)(.)*/\n if is_a?(PoolParty::Resources::Resource)\n self.to_s\n else\n (a_service || a_template || a_function) ? self : \"'#{self}'\"\n end \n end",
"def localized_resource_class_name(resource)\n resource_class = ::Link2::Support.find_resource_class(resource)\n resource_name = ::Link2::Support.human_name_for(resource_class) rescue resource_class.to_s.humanize\n resource_name.underscore\n end",
"def resource_name\n name.ns_underscore.pluralize\n end",
"def type_name\n @type_name ||= determine_type_name(descriptor)\n end",
"def resource_type(resource)\n resource.xpath('string(command/ident/@value)')\n end",
"def resource_type(resource)\n resource.xpath('string(command/ident/@value)')\n end",
"def type\n klass = self.class.name\n if sep = klass.rindex('::')\n klass[(sep+2)..-1]\n else\n klass\n end.underscore.to_sym\n end",
"def get_type_name\n\t\treturn campaign_type.type_name\n\tend",
"def name\n @type_name\n end",
"def resource_name\n @resource_name ||= model_name.element.pluralize\n end",
"def item_type\n name.singularize.ns_underscore\n end",
"def type; self.class.name.split('::').last.to_sym; end",
"def resource_name\n self.class.name.ns_underscore.pluralize\n end",
"def resource_name\n resources_name.singularize\n end",
"def type\n self.class.name.split(':').last.downcase\n end",
"def resource_item_name\n resource_name.to_s.singularize.to_sym\n end",
"def resource_klass\n resource_klass_name.constantize\n end",
"def classize_resource(type)\n return type unless type.is_a?(Symbol) || type.is_a?(String)\n\n klass = nil\n begin\n klass = qualified_const_get(type.to_s)\n rescue NameError\n raise NameError, \"Could not find relation class #{type} (referenced as #{type} by #{self})\"\n end\n klass\n end",
"def resource_type\n /(\\/api\\/(?<type>\\w+)\\/?)/ =~ full_url\n type.capitalize\n end",
"def service_type_name(account_name, name)\n map_opts = get_acct_catalog_map(account_name)\n case map_opts[:provider]\n when \"hp\"\n service_name = name\n unless map_opts[:catalog].nil?\n service_catalog_key = name.to_s.downcase.gsub(' ','_').to_sym\n service_name = map_opts[:catalog][service_catalog_key] if map_opts[:catalog].has_key?(service_catalog_key)\n end\n return service_name\n else\n return name\n end\n end",
"def type\n @type ||= self.class.name.split('::').last\n end",
"def type_name\n @values['typeName']\n end",
"def getBaseTypeName(var)\n nsPrefix = \"\"\n langType = @langProfile.getTypeName(var.getUType())\n\n if (var.utype != nil) # Only unformatted name needs styling\n baseTypeName = CodeNameStyling.getStyled(langType, @langProfile.classNameStyle)\n else\n baseTypeName = langType\n end\n\n if var.namespace.hasItems?()\n nsPrefix = var.namespace.get(\"::\") + \"::\"\n baseTypeName = nsPrefix + baseTypeName\n end\n\n return baseTypeName\n end",
"def network_type\n data[:network_type]\n end",
"def network_type\n data[:network_type]\n end",
"def to_resource_name\n singularize.underscore\n end",
"def resource_class\n @resource_class ||= self.class.to_s.split(\":\").last\n end",
"def resource_class\n\t\t\t\t@resource_class ||= resource_name.classify.constantize\n\t\t\tend",
"def resource_item_name\n resource_name.to_s.singularize.to_sym\n end",
"def getTypeName(var)\r\n if (var.vtype != nil)\r\n return @langProfile.getTypeName(var.vtype)\r\n else\r\n return CodeNameStyling.getStyled(var.utype, @langProfile.classNameStyle)\r\n end\r\n end",
"def qualified_resource_name\n @qualified_resource_name ||=\n begin\n @resource_class.name.split('::').map do |str|\n tools.string.underscore(str)\n end.join('-')\n end # name\n end",
"def get_type_name(type)\n type_name = TypeName.new get_class_name(type), get_class_module_path(type), get_class_file_name(type), get_class_file_path(type)\n type_name.parent = make_parents get_class_module_path(type)\n type_name\n end",
"def resource_name\n @resource_name ||= self.class.to_s.underscore.gsub(%r{.*/([^/]+)\\z}, '\\1')\n end",
"def type_name\n @type_name ||= StringHelpers.underscore(StringHelpers.demodulize(@value.class.name)).to_sym\n end",
"def get_resource(ty, nm)\n o = self.send \"#{ty}s\".to_sym\n o.detect {|r| r.name == nm }\n end",
"def readable_type_name(type)\n return TYPE_MAPPING.fetch(type, type)\n end",
"def resource_class\n case @options[:class]\n when false\n name.to_sym\n when nil\n namespaced_name.to_s.camelize.constantize\n when String\n @options[:class].constantize\n else\n @options[:class]\n end\n end",
"def name\n @resource.name\n end",
"def type\n self.class.class_name.downcase\n end",
"def service_type\n return nil unless self.service_type_id \n ServiceType.find(self.service_type_id)\n end",
"def getBaseTypeName(var)\n nsPrefix = \"\"\n\n baseTypeName = \"\"\n if (var.vtype != nil)\n baseTypeName = @langProfile.getTypeName(var.vtype)\n else\n baseTypeName = CodeNameStyling.getStyled(var.utype, @langProfile.classNameStyle)\n end\n\n baseTypeName = nsPrefix + baseTypeName\n\n return baseTypeName\n end",
"def resource_human_name\n resource_class.model_name.human\n end",
"def resource_label\n resource_name.translate count: 1,\n default: resource_name.to_s.gsub(\"::\", \" \").titleize\n end",
"def type_to_s\n self.class.to_s.split(':').last.downcase\n end",
"def name\n type.to_s.capitalize\n end",
"def resource_class(klassname)\n contract_namespaces.each do |ns|\n begin\n return \"#{ns}::#{klassname}\".constantize\n rescue;end\n end\n end",
"def resource_type\n case\n when controller_name.starts_with?('search')\n params[:record_type]\n when is_variable_controller?\n 'variables'\n when is_services_controller?\n 'services'\n when is_tools_controller?\n 'tools'\n else\n # default\n 'collections'\n end\n end",
"def compute_type(type_name)\n type_name.constantize\n end",
"def resource_name\n return @resource_name\n end",
"def resource_name\n return @resource_name\n end",
"def resource_name\n return @resource_name\n end",
"def type\n @type.name\n end",
"def default_type_label(type)\n type.name.gsub(/::/, '_').underscore\n end",
"def resource_name\n @resource_name ||= controller_name.singularize\n end",
"def resource_name\n @resource_name ||= controller_name.singularize\n end",
"def resource_name\n type = params[:draft_type]\n case type\n when 'collection_drafts'\n draft_type = 'CollectionDraft'\n when 'tool_drafts'\n draft_type = 'ToolDraft'\n when 'variable_drafts'\n draft_type = 'VariableDraft'\n when 'service_drafts'\n draft_type = 'ServiceDraft'\n end\n @resource_name ||= draft_type\n end",
"def enclosing_resource_name\n enclosing_resource.class.name.underscore\n end",
"def resource_name\n\t\t\t\t@resource_name ||= self.controller_name.singularize\n\t\t\tend",
"def resource_name\n @@resource_name ||= self.class.to_s.split('::').last.gsub('Controller', '').singularize.underscore\n end",
"def class_of_resource\n @class_of_resource ||= resource_name.classify.constantize\n end",
"def type_name\n self['type_name']\n end",
"def type\n return @type if defined? @type\n\n @type = self.to_s.gsub(/.*::/, '')\n end"
] | [
"0.7220518",
"0.7087991",
"0.70208895",
"0.6983821",
"0.6981845",
"0.6966585",
"0.6956692",
"0.68372697",
"0.67974854",
"0.6740067",
"0.66943884",
"0.6683098",
"0.6652709",
"0.66316104",
"0.6631166",
"0.6577122",
"0.6560205",
"0.6555105",
"0.6552634",
"0.65180606",
"0.65180606",
"0.65180606",
"0.65180606",
"0.6509198",
"0.6495356",
"0.6479666",
"0.6478386",
"0.64577925",
"0.6454402",
"0.6435679",
"0.6412649",
"0.63890076",
"0.6386818",
"0.6350996",
"0.63328195",
"0.63242066",
"0.63238645",
"0.63058573",
"0.6301505",
"0.6298416",
"0.6270337",
"0.62638396",
"0.6247468",
"0.62410593",
"0.62410593",
"0.6221763",
"0.6217321",
"0.61875564",
"0.6177813",
"0.617473",
"0.61716247",
"0.61579955",
"0.6153741",
"0.6139484",
"0.6133528",
"0.612256",
"0.61185116",
"0.6117749",
"0.60977113",
"0.6091572",
"0.6077807",
"0.6075753",
"0.60754436",
"0.60754436",
"0.6047571",
"0.60457504",
"0.60291696",
"0.6016884",
"0.6015569",
"0.60127884",
"0.6010533",
"0.6009958",
"0.600933",
"0.60041517",
"0.6000702",
"0.59935546",
"0.5989725",
"0.59892756",
"0.5984015",
"0.59704363",
"0.5957891",
"0.59576374",
"0.5957127",
"0.595256",
"0.5951096",
"0.5947137",
"0.59467643",
"0.59440583",
"0.59440583",
"0.59440583",
"0.59391636",
"0.59311205",
"0.592124",
"0.592124",
"0.5910972",
"0.59090036",
"0.5908568",
"0.5905005",
"0.5900072",
"0.5894709",
"0.5891263"
] | 0.0 | -1 |
returns a properly formatted phone number. | def format_phone_number(phone_number_str)
b = phone_number_str
c = b.gsub(" ", "").gsub(".", "").gsub("-", "")
"(" + c[0..2] + ")" + " " + c[3..5] + "-" + c[6..9]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"def formatted_phone_number\n Phonelib.parse(phone_number).local_number\n end",
"def formatted_phone\n phone\n end",
"def format_phone_number\n\t\tunless self.phone_number.nil?\n\t\t\told = self.phone_number.gsub(/\\D/,'')\n\t\t\tnew_phone = \"(#{old[0..2]}) #{old[3..5]}-#{old[6..9]}\"\n\t\t\tself.phone_number = new_phone\n\t\tend\n\tend",
"def format_phone_number\n if self.phone_number.nil?\n return false\n end\n raw_numbers = self.phone_number.gsub(/\\D/, '')\n if raw_numbers.size != 10\n return false\n end\n self.phone_number = \"(#{raw_numbers[0..2]}) #{raw_numbers[3..5]}-#{raw_numbers[6..9]}\"\n end",
"def phone_formatted_for_display\r\n return number_to_phone(phone, {:area_code => true})\r\n end",
"def format_phone_number(phone)\n cleaned_phone_number = Phonelib.parse(phone).national(false)\n return nil if cleaned_phone_number.nil? || cleaned_phone_number.length != 10\n\n cleaned_phone_number.insert(6, '-').insert(3, '-')\n end",
"def format_phone(number)\n result = number.gsub(/[^\\d]/, '')\n if result.length == 10\n \"(#{result[0..2]}) #{result[3..5]}-#{result[6..10]}\"\n else\n number\n end\n end",
"def format_phone\n if Phoner::Phone.valid? self.phone\n pn = Phoner::Phone.parse phone, :country_code => '1'\n self.phone = pn.format(\"(%a) %f-%l\")\n end\n end",
"def format_phone\n if @phone != nil\n @phone = self.phone.scan(/[0-9]/).join\n self.phone = @phone.length == 7 ? ActionController::Base.helpers.number_to_phone(@phone) : \n @phone.length == 10 ? ActionController::Base.helpers.number_to_phone(@phone, area_code: true) :\n @phone\n\n end\n end",
"def format_phone_number(phone_number_str)\n return phone_number_str\nend",
"def phone_number\n if self[:phone_number] == nil\n return nil\n end\n phone_number = self[:phone_number]\n return PhoneNumberHandler.format_phone_number(phone_number)\n end",
"def phone_number\n if self[:phone_number] == nil\n return nil\n end\n phone_number = self[:phone_number]\n return PhoneNumberHandler.format_phone_number(phone_number)\n end",
"def format_phone_number\n area_code = self.phone_number.slice!(0,3)\n area_code = '(' + area_code + ') '\n return area_code + self.phone_number.insert(3, '-')\n end",
"def format_phone_number(phone_number)\n phone_number.digits\n end",
"def format_phone_number(phone)\n parsed_phone = Phonelib.parse(phone)\n\n if parsed_phone.country == Phonelib.default_country\n parsed_phone.local_number\n else\n parsed_phone.full_international\n end\n end",
"def format_phone num\n num.insert(3, '-').insert(7, '-')\n end",
"def format_phone_number(phone_number_str)\n\n\tp_n_s = phone_number_str.to_s\n\n\t#Use each substring of the phone number string to create formatted phone number.\n\tph_frmtd = \"(\" + p_n_s[0..2] + \")\" + p_n_s[3..5] + \"-\" + p_n_s[6..9]\n\t\n\treturn phone_number_str\n\nend",
"def format_phone(phone)\n regex = Regexp.new('[A-Z]+[a-z]+')\n if !phone.blank? && (phone != 'N/A' || phone != '0') && !regex.match(phone)\n phone_stripped = phone.gsub(/[^0-9]/, '')\n phone_step2 = phone_stripped && phone_stripped[0] == '1' ? phone_stripped[1..-1] : phone_stripped\n final_phone = !(phone_step2 && phone_step2.length < 10) ? \"(#{phone_step2[0..2]}) #{(phone_step2[3..5])}-#{(phone_step2[6..9])}\" : phone\n else\n final_phone = nil\n end\n final_phone\n end",
"def format_phone_number(num)\n num = num.delete(' ')\n return \"#{num[0..2]}-#{num[3..6]}\" if num.size == 7\n return \"(#{num[0..2]}) #{num[3..5]}-#{num[6..9]}\" if num.size == 10\n num\nend",
"def phone_number\n '+18009977777'\n end",
"def format_phone_number(phone_number)\n return nil if phone_number.nil?\n\n clean_number = phone_number.gsub(/\\D/, '')\n\n return phone_number if clean_number.length < 10\n\n country_code = clean_number[0, clean_number.length - 9]\n number = clean_number[clean_number.length - 9, clean_number.length]\n\n \"#{country_code}|#{number}\"\n end",
"def formatted_number(phone_number)\n number = phone_number.dup\n number = number.gsub(' ', '').gsub('.', '').gsub('-', '').gsub('/', '')\n\n PhoneNumber::MOBILE_PREFIXES.each do |prefix|\n if number.starts_with? prefix\n number = number.gsub prefix, \"0033#{prefix.last}\" #.last because last is 6 or 7\n break\n end\n end\n number\n end",
"def phone_number\n \"(#{Helpers::FakeIt.area_code}) #{Helpers::FakeIt.exchange_code}-#{Helpers::FakeIt.subscriber_number}\"\n end",
"def phone_number\n '+18773289677'\n end",
"def phone_for_display(phone)\n if phone.blank? then return \"N/A\" end\n md = PHONE_REGEX.match(phone)\n if md\n \"+1 (#{md[1]}) #{md[2]}-#{md[3]}\"\n else\n phone\n end\n end",
"def phone_number(nr)\n country_code = AppConfig['contact_info.default_country_code'].to_s\n Phone.parse(nr, :country_code => country_code).format(:europe)\n rescue\n return nr\n end",
"def format_phone(phone_number, country_code)\n formatted_phone = phone_number.gsub(/[^0-9]/, '').gsub(/^0+/, '')\n \"#{country_code}#{formatted_phone}\"\n end",
"def format_phone_number(phone_number_str)\n phone_number_str.gsub!(/\\D/, \"\")\n area_code = phone_number_str[0..2]\n phone_beginning = phone_number_str[3..5]\n phone_end = phone_number_str[6..9]\n\n return \"(#{area_code}) #{phone_beginning}-#{phone_end}\"\nend",
"def phoneme(number)\n number.gsub(/-+|\\s+/, '').gsub(/(\\d{2,2})(\\d{2,2})(\\d{2,2})(\\d{2,2})/, '\\\\1 \\\\2 \\\\3 \\\\4')\n end",
"def to_s\n \"#{phone_number}\"\n end",
"def format_phone_number(phone_number_str)\n number = phone_number_str.to_s.gsub(/[[:punct:]]/, \"\").gsub(/\\s+/, \"\").to_s.split(\"\")\n return \"(\" + number[0..2].join + \") \" + number[3..5].join + \"-\" + number[6..9].join \nend",
"def format_phone(phone,style=:paren)\n return nil unless phone\n num = phone.gsub(/\\D/,'')\n case style\n when :paren then \"(#{num[0,3]})#{num[3,3]}-#{num[6,4]}\"\n when :dash then \"#{num[0,3]}-#{num[3,3]}-#{num[6,4]}\"\n when :space then \"#{num[0,3]} #{num[3,3]} #{num[6,4]}\"\n end\n end",
"def internationalized_phone_number(phone_number)\n \t\"+1#{phone_number}\"\n end",
"def to_s\n return \"#{self[:name]} - #{phone_number.split(//).last(4).join unless phone_number.nil?}\"\n end",
"def to_s\n valid? ? full : @phone\n end",
"def formatPhoneNumber(phone_number)\n\t\tphone_number = phone_number.split('.')\n\t\tphone_number = \"(#{phone_number[0]}) #{phone_number[1]}-#{phone_number[2]}\"\n\t\n\t\tphone_number\n\tend",
"def format_phone_numbers\n\t\tif self.phone_number_1.present? and self.phone_number_1.length > 9\n\t\t\told = self.phone_number_1.gsub(/\\D/,'')\n\t\t\tnew_phone = \"(#{old[0..2]}) #{old[3..5]}-#{old[6..9]}\"\n\t\t\tself.phone_number_1 = new_phone\n\t\tend\n\t\tif self.phone_number_2.present? and self.phone_number_2.length > 9\n\t\t\told = self.phone_number_2.gsub(/\\D/,'')\n\t\t\tnew_phone = \"(#{old[0..2]}) #{old[3..5]}-#{old[6..9]}\"\n\t\t\tself.phone_number_2 = new_phone\n\t\tend\n\tend",
"def get_telephone\n area_code = @rand.rand(1000).to_s.rjust(3, '0')\n last_four_digits = @rand.rand(10000).to_s.rjust(4, '0')\n \"(\" + area_code + \") 555-\" + last_four_digits\n end",
"def phone_with_parantheses(number)\n number.to_s(:phone, area_code: true)\n end",
"def format_phone_number(phone_number_str)\n ret = []\n fin = phone_number_str.split(/\\W+/).join.split(//)\n fin.each do |n|\n ret << n.to_i\n end\n x = ret.first(3)\n y = ret[3..5]\n z = ret.last(4)\nreturn \"(\" + x.join + \") \" + y.join + \"-\" + z.join\n\nend",
"def standardized_phone_number\n @standardized_phone_number ||= phone_number.gsub(/\\D/, '')\n end",
"def international_phone\n phone.gsub(/[^\\d]/, \"\").prepend('+1')\n end",
"def short_phone_number\n FFaker.numerify('###-##-##')\n end",
"def phone_number_with_country_code\n \"#{country_code} #{phone_number}\"\n end",
"def mobile_number\n \"#{mobile_phone_prefix}-#{short_phone_number}\"\n end",
"def phone_number; end",
"def phone_number; end",
"def normalize_phone_number(num)\n number = Phoner::Phone.parse(num)\n # Formats as (area code) XXX XXXX\n number = number.format('(%a) %f %l')\nend",
"def text_phone\n ret = cell_phone.gsub(/[^0-9]*/, \"\")\n \n if ret[0] != 1\n ret = \"1\" + ret\n end\n\n \"+#{ret}\"\n end",
"def shape_phone_number\n self.phone_number = twilio_format phone_number\n end",
"def convert_phone_nbr_scrp\n if self[0] == \"0\"\n self[0].gsub(\"0\", \"+33\") + self[1..-1]\n end\n end",
"def phone(no)\n if no\n number_to_phone(no, :area_code => false)\n else\n no\n end\n end",
"def twilio_format(phone_number)\n phone_number.gsub(' ', '')\n end",
"def format\n return @phone if mask_too_short?\n mask_array.map do |item|\n if item == \"#\"\n next_digit\n else\n item\n end\n end.join\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def phone_number(area_code = nil)\n area_code ||= CITIES.rand[1]\n length = 10 - area_code.length\n \"#{area_code} #{numerify('#' * length)}\"\n end",
"def reformat_phone\n phone = self.phone.to_s \n phone.gsub!(/[^0-9]/,\"\") \n self.phone = phone \n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers\n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def format_phone_for_storage(phone)\n return phone if phone.blank?\n phone.gsub(/[^0-9]/, '')\n end",
"def format_phone_for_storage(phone)\n return phone if phone.blank?\n phone.gsub(/[^0-9]/, '')\n end",
"def format_phone phone_string, sep = '-'\n a = parse_phone(phone_string)\n raise \"invalid phone number\" if !a\n \"#{a[0]}#{sep}#{a[1]}#{sep}#{a[2]}#{a[3] ? ' '+a[3] : ''}\"\n end",
"def mobile_phone_number\n FFaker.numerify(\"#{mobile_phone_prefix}## ### ###\")\n end",
"def phone_number\n\t\t\trecipient.phone_number\n\t\tend",
"def format_phone_number(phone_number_str)\n\tarray = []\n\tarray = phone_number_str.split(\"\")\n\tphone_number_str = \"\"\n\tarray.keep_if { |i| i =~ /[0123456789]/ } \n\tarray.insert(0,\"(\") \n\tarray.insert(4,\")\")\n\tarray.insert(8,\"-\")\n\tarray.insert(5,\" \")\n\tphone_number_str = array.join\n return phone_number_str\nend",
"def extract_phone_number(phone)\n\t#remove the + and the country code if its a '+254'\n if phone.gsub(/\\D/, \"\").match(/^[0-9][0-9][0-9]?(\\d{2})(\\d{3})(\\d{4})/)\n\t\t[$1, $2, $3].join() #join the three parts of the number to avoid whitespaces \n\telse\n\t\tphone.match(/^[0-9]?(\\d{2})(\\d{3})(\\d{4})/) # remove the 0 if if it's a '07'\n\t\t[$1, $2, $3].join() \n\tend\nend",
"def format_phone_number(arr)\n\tphone_num = \"(\"\n\t3.times {phone_num += arr.shift.to_s}\n\tphone_num += \") \"\n\t3.times {phone_num += arr.shift.to_s}\n\tphone_num += \"-\"\n\t4.times {phone_num += arr.shift.to_s}\n\tphone_num\nend",
"def reformat_phone\r\n phone = self.phone.to_s # change to string in case input as all numbers \r\n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\r\n self.phone = phone # reset self.phone to new string\r\n end",
"def home_work_phone_number\n FFaker.numerify(\"(#{home_work_phone_prefix}) #### ####\")\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def normalize_phone_number\n # stretch\n end",
"def normalize_phone_number\n # stretch\n end",
"def normalize_phone_number\n # stretch\n end",
"def normalize_phone_number\n # stretch\n end",
"def phone_number\n get_attribute(Yoti::Attribute::PHONE_NUMBER)\n end",
"def create_phone_number(numbers)\n '(%d%d%d) %d%d%d-%d%d%d%d' % numbers\nend",
"def createPhoneNumber\r\n '(%d%d%d) %d%d%d - %d%d%d%d' % array end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def international_phone\n \"011-#{rand(100) + 1}-#{rand(100)+10}-#{rand(10000)+1000}\"\n end",
"def reformat_phone\n phone = self.cell_phone.to_s # change to string in case input as all numbers\n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.cell_phone = phone # reset self.phone to new string\n end",
"def phone_numbers_full\n format_entities('gd$phoneNumber', :format_phone_number)\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def reformat_phone\n phone = self.phone.to_s # change to string in case input as all numbers \n phone.gsub!(/[^0-9]/,\"\") # strip all non-digits\n self.phone = phone # reset self.phone to new string\n end",
"def field_phone(phone, country = nil)\n # if !phone.nil? && phone != \"\"\n # if phone.length > 7\n # (phone[0, 1] == \"7\" ? \"+\" : \"\") + \"#{phone[0, 1]} (#{phone[1, 3]}) #{phone[4, 3]} - #{phone[7, phone.length - 7]}\"\n # else\n # \"#{phone[0, 3]} - #{phone[3, phone.length - 3]}\"\n # end\n # else\n # \"-\"\n # end\n field_string(phone) + \"#{country.nil? ? '' : ' ('+country.name_en+')'}\"\n end",
"def phone_number\n element_with_value('PhoneNumber', opts[:phone_number][0..14])\n end",
"def update_phone_number\n begin\n self.phone_number = self.primary_phone.tr('^0-9', '')\n rescue\n return nil\n end\n end",
"def format_phone_number(numbers)\n phone_number = \"(\" \n i = 0\n while i <= 2 do\n phone_number += numbers[i].to_s\n i += 1\n end\n phone_number += \") \"\n while i <= 5 do\n phone_number += numbers[i].to_s\n i += 1\n end\n phone_number += \"-\"\n while i <= 9 do\n phone_number += numbers[i].to_s\n i += 1\n end\n return phone_number\nend",
"def mobile_format\n strfphone(MOBILE_FORMAT)\n end",
"def create_phone_number(numbers)\n numbers.join(\"\").gsub(/(...)(...)(....)/, '(\\1) \\2-\\3')\nend",
"def standardized_phone_number\n Phonelib.parse(phone_number, \"US\").e164\n end",
"def standardized_phone_number\n Phonelib.parse(phone_number, \"US\").e164\n end",
"def format(number, options={})\n return nil unless number\n\n # options[:format] ||= :parens\n code,num = strip_country_code(normalize_phone_number(number))\n code ||= \"1\" if options[:country_code]\n case options[:format]\n when :parens\n (options[:country_code] ? \"+#{code} \" : '' ) + \"(#{num[0..2]}) #{num[3..5]} #{num[6..9]}\"\n when :dashes\n (options[:country_code] ? \"+#{code}-\" : '' ) + \"#{num[0..2]}-#{num[3..5]}-#{num[6..9]}\"\n when :spaces\n (options[:country_code] ? \"+#{code} \" : '' ) + \"#{num[0..2]} #{num[3..5]} #{num[6..9]}\"\n else\n (options[:country_code] ? \"+#{code}\" : '' ) + num\n end\n end",
"def normalize_phone_number(phone,country_code=1)\n if phone\n phone = phone.to_s.sub(/^011/,\"+\")\n \"+\" + (phone.start_with?(\"+\") ? '' : country_code.to_s) + phone.gsub(/\\D/,'') \n end\n end"
] | [
"0.88608974",
"0.88608974",
"0.88608974",
"0.8573699",
"0.845018",
"0.8267938",
"0.82413036",
"0.8189943",
"0.81600267",
"0.81494856",
"0.81199133",
"0.81020707",
"0.80932367",
"0.80912817",
"0.80329806",
"0.7996358",
"0.79803115",
"0.79191643",
"0.7906887",
"0.78721225",
"0.7826474",
"0.7815627",
"0.77989537",
"0.7773549",
"0.77626234",
"0.7757906",
"0.7754206",
"0.7685021",
"0.76628006",
"0.7631827",
"0.76073855",
"0.7605764",
"0.7597447",
"0.7581118",
"0.7577635",
"0.75756055",
"0.7571575",
"0.75589776",
"0.75487614",
"0.753263",
"0.7463781",
"0.7434638",
"0.74215764",
"0.74186975",
"0.7414324",
"0.74035704",
"0.74007565",
"0.7385742",
"0.7385742",
"0.73754823",
"0.7349389",
"0.73191416",
"0.7268191",
"0.7258704",
"0.7253878",
"0.72482353",
"0.7224535",
"0.72046655",
"0.7197877",
"0.71854323",
"0.7177594",
"0.7177594",
"0.71274656",
"0.71197724",
"0.71138775",
"0.7105699",
"0.7090207",
"0.7088629",
"0.70760614",
"0.70425427",
"0.7040482",
"0.70396465",
"0.70396465",
"0.70396465",
"0.70396465",
"0.7022315",
"0.7022315",
"0.7022315",
"0.7022315",
"0.70199394",
"0.6997487",
"0.6960004",
"0.69547284",
"0.69334435",
"0.6929476",
"0.69248295",
"0.69194335",
"0.69194335",
"0.69194335",
"0.69194335",
"0.6913819",
"0.69136804",
"0.68854725",
"0.68665975",
"0.6840639",
"0.68249387",
"0.68240917",
"0.68240917",
"0.68223166",
"0.68050647"
] | 0.7594456 | 33 |
this is used to generate URL in development mode | def port
@presenter.port
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_url\n\t\tif self.url.blank?\n\t\t\tself.dev_stage.blank? ? dev_stage_string = \"\" : dev_stage_string = \"-\" + self.dev_stage + \"-\"\n\t\t\tcomponent_string = self.component.downcase.gsub(/[^a-zA-Z0-9]+/, \"-\").chomp(\"-\")\n\t\t\tversion_string = self.maj_version.to_s + \"-\" + self.min_version.to_s\n\t\t\tself.url = component_string + dev_stage_string + version_string\n\t\tend\n\tend",
"def url\n url = \"#{config.url[config.env]}/#{@path}\"\n url = \"#{url}?#{@params.to_param}\" unless @params.empty?\n url\n end",
"def generated_url; end",
"def dev_url(path = \"/\")\n uri = URI.join(\"http://#{Radiant::Config['dev.host'] || 'dev'}.#{self.base_domain}\", path)\n uri.to_s\n end",
"def url\n \"#{Rails.configuration.baseurl}#{creator_path(self)}\"\n end",
"def generate_preview_url\n GlobalConstant::Base.root_url + @params['path'] + '?ts=' + @params['ts'].to_s\n end",
"def url\n @url = \"#{@http_mode}://#{self.config.servers[0]}\"\n @url << \"/#{self.config.context}\" if(!self.config.context.empty?)\n #self.config.log.debug_msg(\"Request base URL: #{@url}\")\n @url\n end",
"def fullurl\n if Rails.env == 'development'\n 'http://localhost:3000' + object.url.to_s\n else\n 'http://signlab-rails.herokuapp.com' + object.url.to_s\n end\n end",
"def generate_url\n\t\tself.url ||= name.parameterize\n\tend",
"def _url\n URI.join(domain, path_gen.for_uri)\n end",
"def build_url(action)\n \"#{@base_url}#{action}\"\n end",
"def generate_url(template); end",
"def url_template; end",
"def url_template; end",
"def onliner_url\n @url ||= (CONSTANT_URL + @options.to_query)\n end",
"def url\n [ Configuration.url, @path ].join\n end",
"def url\n options[:test] ? options[:test_url] : options[:production_url]\n end",
"def url\n options[:test] ? options[:test_url] : options[:production_url]\n end",
"def converted_url\n #Rails.application.routes.url_helpers.root_url\n \"http://localhost:3000/#{hash_code}\"\n end",
"def build_url(url_suffix)\n return @base_url+url_suffix\nend",
"def url\n URI.escape(\"#{protocol}#{host}/#{path_prefix}#{key}\")\n end",
"def generate_short_url\n short_url = SecureRandom.urlsafe_base64[0..6]\n short_url\n end",
"def short_url\n \"#{HOST_URL}/#{short_code}\"\n end",
"def makeURL(path)\n \"#{self.api_endpt + path}?token=#{self.token}\"\n end",
"def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end",
"def my_url\n url 'my'\n end",
"def base_url_path; end",
"def build_url(product, options = nil)\n \"#{BASE_URL}#{product}#{build_query_string(options)}\"\n end",
"def url=(_); end",
"def site_url\n if Rails.env.production?\n # Place your production URL in the quotes below\n \"http://www.ezonline.com/\"\n else\n # Our dev & test URL\n \"http://ezonline-dev.com:3000\"\n end\n end",
"def iadmin_url\n @test_mode ? @test_url : @production_url\n end",
"def base_url\n 'http://ow.ly/api/1.1/url/shorten'\n end",
"def full_url\n char = (api_env('URL') =~ /\\?/).nil? ? '?' : '&'\n api_env('URL') + \"#{char}#{api_env('PARAM')}=#{login}\"\n end",
"def localhost_url path = nil\n \"http://localhost:4270/#{path}\"\n end",
"def url\n Config.site.url.chomp('/') + self.path\n end",
"def url\n if self.controller and self.action and self.page_id\n return \"/#{self.controller}/#{self.action}/#{self.page_id}\"\n end\n if self.controller and self.action\n return \"/#{self.controller}/#{self.action}\"\n end\n if self.controller\n return \"/#{self.controller}\"\n end\n return \"/#{self.shortcut}\"\n end",
"def url\n \"http://#{self.cms_site.hostname}#{self.full_path}\"\n end",
"def app_url\n url\n end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def url; end",
"def base_url\n BASE_URL.dup % [\"%s\", \"%s\", @api_key, \"%s\"] \n end",
"def build_url(vars = {})\n \"/\" + path_spec.map do |p|\n case p\n when String\n p\n when Symbol\n vars.fetch(p)\n end\n end.join(\"/\")\n end",
"def base_path\n if debug\n \"/#{debug_prefix}/\"\n else\n \"/#{digest_prefix}/\"\n end\n end",
"def generate_short_url\n return if self.short_url.present?\n self.short_url = SecureRandom.hex(2)\n end",
"def old_url\n \"http://#{site.default_host.hostname}#{path}\"\n end",
"def baseurl; end",
"def build_url(params)\n \"#{@base_url}?#{params.to_query}\"\n end",
"def base_url\n return url\n end",
"def url\n env[:url]\n end",
"def create_short_url\n rand_url = ('a'..'z').to_a.shuffle[0..5].join\n self.short_url = \"#{rand_url}\"\n end",
"def api_url\n if PagSeguro.developer?\n File.join PagSeguro.config[\"base\"], \"pagseguro_developer/confirm\"\n else\n API_URL\n end\n end",
"def url\n ''\n end",
"def base_url\n GlobalConstant::Base.cms[:url] + \"api/preview/\"\n end",
"def url\n end",
"def generate_short_url(base_url)\n build_shorten_url.update( uniq_id: shorten, expired_at: Time.now.utc + 1.year ) unless shorten_url\n shorten_url.link(base_url)\n end",
"def url\n end",
"def static_url(url); \"url('#{url}')\"; end",
"def full_shortened_url(base)\n base + '/' + short_url\n end",
"def base_url_path=(_arg0); end",
"def p_url\n Rails.application.routes.url_helpers.rent_url(id, host: PUBLIC_URL)\n end",
"def url\n send(\"url_#{page.env}\")\n end",
"def generate_url_name\n self.url_name ||=\n Base32.encode(SecureRandom.random_bytes(16)).downcase.sub(/=*$/, '')\n end",
"def generate_url_name\n self.url_name ||=\n Base32.encode(SecureRandom.random_bytes(16)).downcase.sub(/=*$/, '')\n end",
"def url_for_main; end",
"def url_for_main; end",
"def base_web_url(artefact)\n if [\"production\", \"test\"].include?(ENV[\"RACK_ENV\"])\n public_web_url\n else\n Plek.current.find(artefact.rendering_app || artefact.owning_app)\n end\n end",
"def baseURL\n Rails.env.development? ? GeventAnalysis::Application::CONSTS[:dev_host] : GeventAnalysis::Application::CONSTS[:app_host]\n end",
"def generate_url(url, params = {})\n uri = URI(url)\n if Settings.get_params_char == '#'\n uri.fragment = params.to_query\n else\n uri.query = params.to_query\n end\n uri.to_s\n end",
"def shorten\n return \"#{Rails.application.secrets.base_url}#{self.dilute}\"\n end",
"def generateUrl(additionalParams={})\n finalParams = self._setFinalParams(additionalParams)\n options = {}\n options['product'] = self\n options['renderParameters'] = finalParams\n params = @serverManager.buildRenderCommand(options)\n if params then\n url = @serverManager.buildRenderServerUrlRequest(params)\n url\n end\n end",
"def url\n @url ||= URL.new(\n template: template,\n placeholders: url_placeholders,\n permalink: permalink\n ).to_s\n end",
"def url_shortener(full_uri)\n mapper = UrlMapper.find_by_original_url(full_uri)\n \n if mapper\n string = mapper.short_url\n else\n string = \"/\"\n 5.times { string << (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr }\n begin\n UrlMapper.create!({:short_url => string, :original_url => full_uri})\n rescue\n end\n end\n \"#{APP_CONFIG['url_shortener']}#{string}\"\n end",
"def get_url(is_local = true)\n is_local ? (return '../../../www/public/') : (return 'https://whimsy.apache.org/public/')\n end",
"def baseurl=(_arg0); end",
"def get_url\n \"http://#{self.domain}/#{self.path}#{self.params.it_keys_to_get_param}\"\n end",
"def outputurl\n if Rails.env.production?\n return \"http://oboe.oerc.ox.ac.uk/download/#{self.id}\"\n elsif Rails.env.development?\n return \"http://bonnacon.oerc.ox.ac.uk:3000/download/#{self.id}\"\n elsif Rails.env.test?\n return \"http://bonnacon.oerc.ox.ac.uk:3000/download/#{self.id}\"\n end\n\n end",
"def url\n return @@nfg_urls['sandbox']['url'] if @use_sandbox\n @@nfg_urls['production']['url']\n end",
"def url\n if derivative\n derivative_url || regular_url\n elsif version\n version_url\n else\n regular_url\n end\n end",
"def shorter_url\n\t\tself.short_url = SecureRandom.base64(10)\n\tend",
"def url\n self.compile\n url = \"#{properties[:endpoint]}/render/?width=586&height=308&#{properties_to_url}&target=\" + CGI.escape(targets.map{|i| i.compile}.compact.join(\"&target=\"))\n end",
"def short_url(root_url)\n \"#{root_url}#{self.token}\"\n end",
"def url(params)\n \"%s%s\" % [config['endpoint'], query_string(params)]\n end",
"def generate_base_urls \n set_scheme\n if(ENV['ENVIRONMENT']=='sandbox')\n @base_url = @sandbox + @bbc_domain \n @static_base_url = @static_sandbox + @bbc_domain\n elsif (ENV['ENVIRONMENT']=='live' && ENV['WWW_LIVE']=='false')\n @base_url = @www_prefix.chop + @bbc_domain\n @static_base_url = @static_prefix.chop + @bbci_domain\n @open_base_url = @open_prefix.chop + @bbc_domain\n elsif (ENV['ENVIRONMENT'].split('.')[0].include? 'pal') #address specific box\n @base_url = \"#{scheme}://#{ENV['ENVIRONMENT']}\" \n else\n @base_url = @www_prefix + ENV['ENVIRONMENT'] + @bbc_domain\n @static_base_url = @static_prefix + ENV['ENVIRONMENT'] + @bbci_domain\n @static_base_url = @static_prefix.chop + @bbci_domain if ENV['ENVIRONMENT'] == 'live'\n @open_base_url = @open_prefix + ENV['ENVIRONMENT'] + @bbc_domain\n end\n proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] \n @proxy_host = proxy.scan(/http:\\/\\/(.*):80/).to_s if proxy\n end",
"def gardener_url\n (ENV['SUT_SCHEME'] || 'https') + \"://\" + gardener_fqhn()\n end"
] | [
"0.7541227",
"0.7219365",
"0.7182593",
"0.71506053",
"0.71082056",
"0.7090069",
"0.70846254",
"0.70665073",
"0.7025436",
"0.693468",
"0.6905737",
"0.69050467",
"0.68797916",
"0.68797916",
"0.6853423",
"0.6839726",
"0.6835069",
"0.6835069",
"0.68015647",
"0.678917",
"0.67549205",
"0.67346346",
"0.6731878",
"0.67225987",
"0.6710232",
"0.6707922",
"0.6704308",
"0.67029136",
"0.66987747",
"0.667092",
"0.6664113",
"0.666076",
"0.6659226",
"0.66500396",
"0.66470724",
"0.6631379",
"0.6617716",
"0.6612086",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6611069",
"0.6604192",
"0.6597302",
"0.65957636",
"0.65889597",
"0.6585545",
"0.6583861",
"0.658335",
"0.6571313",
"0.65695846",
"0.65694857",
"0.6567749",
"0.65623623",
"0.6558607",
"0.65566456",
"0.65514874",
"0.6530991",
"0.65309656",
"0.6522462",
"0.6516199",
"0.65075666",
"0.65055937",
"0.65046984",
"0.65046984",
"0.6494236",
"0.6494236",
"0.6491234",
"0.64829206",
"0.6482764",
"0.6481045",
"0.64798826",
"0.64777845",
"0.6477031",
"0.6469702",
"0.64683926",
"0.64683795",
"0.6466133",
"0.6461463",
"0.6459113",
"0.6458543",
"0.6449425",
"0.64417505",
"0.6438246",
"0.64339685",
"0.6431674"
] | 0.0 | -1 |
This code was taken from active_record_helper.rb | def rp_error_messages_for(*params)
options = params.extract_options!.symbolize_keys
if object = options.delete(:object)
objects = [object].flatten
count = objects.inject(0) { |sum, obj|
sum += params.inject(0) {|s, p|
obj.errors.detect { |e|
e.include?(p.to_s)
}.blank? ? s : s + 1
}
}
# count = objects.inject(0) {|sum, object| sum + object.errors.count }
else
objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact
count = objects.inject(0) {|sum, object| sum + object.errors.count }
end
unless count.zero?
html = {}
[:id, :class].each do |key|
if options.include?(key)
value = options[key]
html[key] = value unless value.blank?
else
html[key] = 'errorExplanation'
end
end
options[:header_only] ||= false
name = objects.first
if name.respond_to?('property')
options[:object_name] ||= name.property.name
elsif name.respond_to?('resource_type')
options[:object_name] ||= name.resource_type.name
elsif name.respond_to?('name')
options[:object_name] ||= name.name
else
options[:object_name] ||= ''
end
unless options.include?(:header_message)
if options[:header_only]
options[:header_message] = "Errors prohibited #{options[:object_name].to_s.gsub('_', ' ')} from being saved"
else
options[:header_message] = "#{options[:object_name].to_s.gsub('_', ' ')}"
end
end
options[:message] ||= ''#There were problems with the following fields:' unless options.include?(:message)
error_messages = objects.map {|object| object.errors.full_messages.map {|msg| content_tag(:li, msg) } }
contents = ''
contents << content_tag(options[:header_tag] || :h2, options[:header_message]) unless options[:header_message].blank?
contents << content_tag(:p, options[:message]) unless options[:message].blank? or options[:header_only]
contents << content_tag(:ul, error_messages) unless options[:header_only]
content_tag(:div, contents, html)
else
''
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def orm; end",
"def subscribe_sql_active_record; end",
"def private; end",
"def real_column; end",
"def single_object_db; end",
"def subscribe_sql_active_record=(_arg0); end",
"def prerecord(klass, name); end",
"def sdb_to_ruby(name, value)\n# puts 'sdb_to_ruby arg=' + name.inspect + ' - ' + name.class.name + ' - value=' + value.to_s\n return nil if value.nil?\n att_meta = get_att_meta(name)\n\n if att_meta.options\n if att_meta.options[:encrypted]\n value = Translations.decrypt(value, att_meta.options[:encrypted])\n end\n if att_meta.options[:hashed]\n return PasswordHashed.new(value)\n end\n end\n\n\n if !has_id_on_end(name) && att_meta.type == :belongs_to\n class_name = att_meta.options[:class_name] || name.to_s[0...1].capitalize + name.to_s[1...name.to_s.length]\n # Camelize classnames with underscores (ie my_model.rb --> MyModel)\n class_name = class_name.camelize\n # puts \"attr=\" + @attributes[arg_id].inspect\n # puts 'val=' + @attributes[arg_id][0].inspect unless @attributes[arg_id].nil?\n ret = nil\n arg_id = name.to_s + '_id'\n arg_id_val = send(\"#{arg_id}\")\n if arg_id_val\n if !cache_store.nil?\n# arg_id_val = @attributes[arg_id][0]\n cache_key = self.class.cache_key(class_name, arg_id_val)\n# puts 'cache_key=' + cache_key\n ret = cache_store.read(cache_key)\n# puts 'belongs_to incache=' + ret.inspect\n end\n if ret.nil?\n to_eval = \"#{class_name}.find('#{arg_id_val}')\"\n# puts 'to eval=' + to_eval\n begin\n ret = eval(to_eval) # (defined? #{arg}_id)\n rescue SimpleRecord::ActiveSdb::ActiveSdbError => ex\n if ex.message.include? \"Couldn't find\"\n ret = RemoteNil.new\n else\n raise ex\n end\n end\n\n end\n end\n value = ret\n else\n if value.is_a? Array\n value = value.collect { |x| string_val_to_ruby(att_meta, x) }\n else\n value = string_val_to_ruby(att_meta, value)\n end\n end\n value\n end",
"def sql_state; end",
"def orm_patches_applied; end",
"def model_name; end",
"def model_name; end",
"def check_record; end",
"def as_you_like_it_quote; end",
"def find_by()\n\n end",
"def sql_modes; end",
"def active_record_at_least_4?\n defined?(::ActiveRecord) && ::ActiveRecord::VERSION::MAJOR >= 4\nend",
"def select(db); end",
"def select(db); end",
"def test_raw_insert_bind_param_with_q_mark_deprecated; end",
"def model_class; end",
"def mu_pp(obj)\n if obj.is_a?(ActiveRecord::Base)\n obj.to_s\n else\n super\n end\n end",
"def get_sighting_records(db)\r\n\r\n sighting_records = db.query(\"select * from sighting_details order by id\")\r\n\r\n return sighting_records.to_a\r\n\r\nend",
"def generate_active_record(mdm_model, config)\n #do the code to create new classes based on model metadata\n #and load them up in the Ruby VM\n #below NOTE! Need table created first for AR\n #AR provides a #column_names method that returns an array of column names\n useconnection = nil\n mdm_model.mdm_objects.each do |mdm_object|\n klass = Class.new ActiveRecord::Base do\n #establish_connection(config)\n #AR to set the physical tablename\n before_save :diff_row\n self.table_name = mdm_object.name\n \n #below does composite keys!\n \n if mdm_object.mdm_primary_keys.size > 0\n pkeys = mdm_object.mdm_primary_keys.collect{|x| x.mdm_column.name.to_sym }\n self.primary_keys = pkeys\n @@pklist = pkeys\n puts \"-\" * 80\n puts mdm_object.name, pkeys.size\n end\n #note this is FK implementation\n # has_many :statuses, :class_name => 'MembershipStatus', :foreign_key => [:user_id, :group_id]\n\n def name\n \n end\n \n def diff_row\n #here we send changes out over to the queue\n #we need PK followed by row\n puts self.changes\n pkvals = {}\n changevals = {}\n self.class.primary_keys.each do |k|\n pkvals[k] = self.read_attribute(k)\n end\n changevals['colvals'] = self.changes\n changevals['pkeys'] = pkvals\n redis = Redis.new\n redis.publish(\"mdm:freemdm\", changevals.to_json)\n end\n end\n \n \n #NOTE will need some adjustments to fit legacy tables to AR\n Object.const_set mdm_object.name.capitalize, klass\n puts config.symbolize_keys\n klass.establish_connection(config.symbolize_keys) \n useconnection = klass.connection if !useconnection\n # eval(\"class #{klass.name}; attr_accessible *columns;end\")\n #\n generate_column_meta(klass)\n\n klass.connection.jdbc_connection.close\n end\n \n end",
"def employee_first_names_and_store_names\n ActiveRecord::Base.connection.exec_query(custom_sql).collect &:values\nend",
"def fields_for_sql(num_fields)\r\n '(' + \"?,\\s\" * (num_fields - 1) + '?' + ')'\r\nend",
"def get_ip_address(id_unique)\r\n\tip_addr = $db.execute(\"SELECT ip_address FROM phone WHERE id_unique = ?\", id_unique)[0][0]\r\n\treturn ip_addr\t\r\nend",
"def save_as\n # the join is required in case we hit a multiple choice question.\n # It’s highly unlikely that this kind of question will ever use the\n # save_as attribute, but what the heck.\n # Also, keep only valid chars\n [@db_column].join.gsub(/[^a-z0-9-]/i, \"\")\n end",
"def prepare_sql; raise \"Define #prepare_sql in your subclass\"; end",
"def method_missing(name, *args, &block)\n fn = name.to_s\n fnne = fn.gsub('=','')\n if (!self.attributes.keys.include?(fnne)) && self.connection.columns(self.class.table_name).map{|c| c.name}.include?(fnne)\n # for next time\n self.class.reset_column_information\n\n # for this time\n if self.new_record?\n self.attributes[fnne] = nil\n else\n self.attributes[fnne] = self.connection.select_all(\"select #{fnne} from #{self.class.table_name} where id = #{self.id}\")[0][fnne] rescue nil\n end\n\n return self.attributes[fnne]\n else\n super\n end\n end",
"def column_name; end",
"def string_field_names\n # database_field_names.join(', ')\n database_field_names.to_s[1...-1]\n end",
"def model_fields(collection)\n records = []\n model = collection.classify.constantize\n document = model.new\n# p document.methods\n document.attribute_names.each do |attribute_name|\n options = model.fields[attribute_name].options\n description = I18n.t(\"helpers.help.#{collection}.#{attribute_name}\")\n description = I18n.t(\"helpers.label.#{collection}.#{attribute_name}\") if description.match('missing:')\n description = attribute_name if description.match('missing:')\n\n records.push( {'collection' => collection, \n 'field' => attribute_name, \n 'type' => options[:type],\n 'description' => description, \n '_default' => options[:default]\n } )\n end\n# embedded documents\n document.embedded_relations.each do |a_embedded|\n embedded = a_embedded.last\n description = I18n.t(\"helpers.help.#{collection}.#{embedded.key}\")\n description = I18n.t(\"helpers.label.#{collection}.#{embedded.key}\") if description.match('missing:')\n description = embedded.key if description.match('missing:')\n\n records.push( {'collection' => collection, \n 'field' => embedded.key, \n 'type' => 'Embedded:' + embedded.class_name,\n 'description' => description\n } )\n end\n#p records\n records\nend",
"def find_rows(field_name, record_id) \n results = CONNECTION.execute(\"SELECT * FROM #{self.table_name} WHERE #{field_name} = #{record_id}\")\n \n return self.results_as_objects(results) \n end",
"def probers; end",
"def prepare_result; end",
"def to_key\nnew_record? ? nil : [ self.send(self.class.primary_key) ]\nend",
"def books_not_sorted_to_libraries\n ActiveRecord::Base.connection.exec_query(books_not_sorted_to_libraries_sql).collect &:values\nend",
"def check_duplicate_item(db, tbl,field_name,value)\r\n check_command = \"Select * from ? where ? = ?\",[tbl, field_name,value]\r\n if db.execute(check_command).length > 0\r\n return true\r\n else \r\n return false \r\n end \r\nend",
"def alchemy\r\n end",
"def oracle; end",
"def artist #this is a helper method\n sql = \"\n SELECT * FROM artists\n WHERE id = $1\"\n values = [@artist_id]\n\n artist_info = results[0]\n artist = Artist.new(artist_info)\n return artist.name\nend",
"def sql_for_columns; @sql_for_columns end",
"def create_extension_view_and_class\n self.const_get(\"Extended#{to_s}\")\n rescue\n clause = view_builder\n #this needs to be moved into the specific db adapter files\n connection.execute %{\n create or replace algorithm = merge SQL SECURITY DEFINER view #{extended_table_name} as select #{clause[:view_select]} from #{table_name} #{clause[:view_joins]}#{clause[:view_conditions]}\n }\n class_eval %{\n class Extended#{to_s} < #{to_s}\n set_table_name \"#{extended_table_name}\"\n def self.descends_from_active_record?\n true\n end\n end\n }\n true\n end",
"def query; end",
"def table; end",
"def table; end",
"def table; end",
"def table; end",
"def rails_3\n defined?(ActiveRecord::VERSION) && ActiveRecord::VERSION::MAJOR >= 3\nend",
"def row_to_find\n create_coded_row\n end",
"def to_sql_query_info(offset)\n \"SELECT * FROM #{@model.quoted_table_name} WHERE \" +\n \" #{quote_column(@model.primary_key)} = (($id - #{offset}) / #{ThinkingSphinx.indexed_models.size})\"\n end",
"def data_complextest(db); end",
"def col_names_for_insert\r\n self.class.column_names.delete_if {|col| col == \"id\"}.join(\", \")\r\nend",
"def orm_patches_applied=(_arg0); end",
"def query_field; end",
"def resultset; end",
"def schubert; end",
"def attribute_to_sql(attr, record)\n if attr.to_s.include?(\".\")\n attr\n else\n \"#{record_table_name(record)}.#{attr}\"\n end\n end",
"def initial_query; end",
"def db=(_arg0); end",
"def db=(_arg0); end",
"def sql_columns\n \"(#{attributes.keys.join(\", \")})\"\n end",
"def db_fetch\n \"SELECT *\" + from_table_where + sql_match_conditions\n end",
"def conditions\n sqlwhere = \"1 = 1 \"\n sqlwhere = sqlwhere + \"and orders.namel like ? \" if is_string_here?(namel)\n sqlwhere = sqlwhere + \"and orders.email like ? \" if is_string_here?(email)\n sqlwhere = sqlwhere + \"and addresses.street_address1 like ? \" if is_string_here?(street_address1)\n sqlwhere = sqlwhere + \"and addresses.street_address2 like ? \" if is_string_here?(street_address2)\n sqlwhere = sqlwhere + \"and orders.user_id = ? \" if is_object_here?(user_id)\n sqlwhere = sqlwhere + \"and orders.order_state_id = ? \" if is_object_here?(order_state_id)\n sqlwhere = sqlwhere + \"and orders.checkout_state_id = ? \" if is_object_here?(checkout_state_id)\n sqlwhere = sqlwhere + \"and orders.created_at > ? \" if is_object_here?(created_at_since)\n sqlwhere = sqlwhere + \"and orders.created_at < ? \" if is_object_here?(created_at_till)\n\n result = [sqlwhere]\n result << UnicodeUtils.downcase(namel) if is_string_here?(namel)\n result << UnicodeUtils.downcase(email) if is_string_here?(email)\n result << UnicodeUtils.downcase(street_address1) if is_string_here?(street_address1)\n result << UnicodeUtils.downcase(street_address2) if is_string_here?(street_address2)\n result << user_id if is_object_here?(user_id)\n result << order_state_id if is_object_here?(order_state_id)\n result << checkout_state_id if is_object_here?(checkout_state_id)\n result << created_at_since if is_object_here?(created_at_since)\n result << created_at_till if is_object_here?(created_at_till)\n result\n end",
"def prepare; end",
"def prepare; end",
"def prepare; end",
"def dbselect2(find, table)\n if find.kind_of?(Array) == false\n variables = find\n else\n variables = \"\"\n i = 0\n while i < find.length\n variables += find[i].to_s\n i += 1\n if i < find.length\n variables += \", \"\n end\n end\n end\n return db.execute(\"SELECT #{variables} FROM #{table}\")\nend",
"def table_attributes\n attributes\n end",
"def object_name; end",
"def object_name; end",
"def object_name; end",
"def serialize(row)\n row\n .map { |c| db_format(c) }\n .join(\",\")\nend",
"def snapshots_redact_sql_queries; end",
"def retrieve_database_meta(modelname, adapter,driver,host,username,password,database,urltemplate)\n \n urltemplate.gsub!(\"{host}\",host)\n urltemplate.gsub!(\"{password}\",password)\n urltemplate.gsub!(\"{username}\",username)\n urltemplate.gsub!(\"{database}\",database)\n mdmtype=MdmDataType.first\n \n curr_connect = ActiveRecord::Base.connection\n if adapter==\"mysql\"\n arconfig = {\n :adapter => adapter,\n :host => host,\n :username => username,\n :password => password,\n :database => database }\n \n config = ActiveRecord::ConnectionAdapters::ConnectionSpecification.new( {\n :adapter => adapter,\n :driver => driver,\n :username => username,\n :password => password,\n :host => host,\n :url => urltemplate,\n :pool => 2\n }, 'mysql_connection')\n \n connection = ActiveRecord::ConnectionAdapters::ConnectionPool.new(config)\n \n else\n # jdbc = JDBCAR.new\n # connection = jdbc.connect(driver,username,password,urltemplate)\n arconfig = {:adapter => 'jdbc',\n :driver => driver,\n :username => username,\n :password => password,\n :url => urltemplate,\n :pool => 2}\n config = ActiveRecord::ConnectionAdapters::ConnectionSpecification.new( {\n :adapter => 'jdbc',\n :driver => driver,\n :username => username,\n :password => password,\n \n :url => urltemplate,\n :pool => 2\n }, 'jdbc_connection')\n \n connection = ActiveRecord::ConnectionAdapters::ConnectionPool.new(config)\n end\n \n primary_k = {}\n newtables={}\n metaconnect = connection.checkout\n metaconnect.tables.each do |table|\n newtables[table] = [] \n primary_k[table] = metaconnect.primary_key(table)\n metaconnect.columns(table.to_s).each do |col|\n newtables[table] << col.name\n print col.name + \", \"\n end\n end\n \n connection.checkin metaconnect\n \n \n mdm_model = MdmModel.find_by_name(modelname) \n mdm_model = MdmModel.new if mdm_model.nil? \n mdm_model.connect_src = serialize_config(adapter,driver,host,username,password,database,urltemplate)\n mdm_model.name = modelname\n newtables.keys.each do |table|\n mdmexist = MdmObject.find_by_name(table)\n mdmexist.destroy if mdmexist\n mdmobject = MdmObject.new\n mdmobject.name=table\n newtables[table].each do |col|\n mdmcolumn = MdmColumn.new\n mdmcolumn.name = col\n mdmcolumn.mdm_data_type = mdmtype\n mdmcolumn.is_primary_key=true if !primary_k[table].nil? && primary_k[table].include?(mdmcolumn.name)\n mdmcolumn.save\n if mdmcolumn.is_primary_key\n pk = MdmPrimaryKey.new\n pk.mdm_column = mdmcolumn\n mdmobject.mdm_primary_keys << pk\n end\n mdmobject.mdm_columns << mdmcolumn\n end\n mdm_model.mdm_objects << mdmobject\n \n end\n \n mdm_model.save\n generate_active_record(mdm_model,arconfig)\n end",
"def sid_column\n end",
"def sql_string(value)\n \"'#{value.gsub(\"'\", \"''\")}'\" \nend",
"def relation_by_sql_form\n # Nothing to do here\n end",
"def values_for_insert\r\n values = []\r\n self.class.column_names.each do |col_name|\r\n values << \"'#{send(col_name)}'\" unless send(col_name).nil?\r\n end\r\n values.join(\", \")\r\nend",
"def save_primary_key_grip; end",
"def _save_cursor\n\t\tfalse\n\tend",
"def primary_keys(field)\n sql = \"SELECT #{field.primary_key_col} from #{field.table} \"\n sql += \"#{where_and(sql)} #{field.column} IS NOT NULL \" if field.leave_null\n field.where&.each_pair do |column, value|\n sql += \"#{where_and(sql)} #{column} = #{value} \"\n end\n sql += \"ORDER BY #{field.primary_key_col};\"\n execute(sql).split(\"\\n\")\nend",
"def make_and_model; end",
"def tables; ActiveRecord::Base.connection.tables; end",
"def db; end",
"def db; end",
"def ordering_query; end",
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def custom_sql\n \"SELECT bookings.full_name FROM bookings ORDER BY checkin DESC LIMIT 1;\"\nend",
"def real_name; end",
"def active_record_obj?(object)\n defined?(ActiveRecord::Base) &&\n (object.is_a?(ActiveRecord::Base) ||\n object.singleton_class.include?(ActiveModel::Model))\n end",
"def create\n col_array = self.instance_variables\n col_array.delete(@id)#you don't get to assign an object's id\n qmark_string = Array.new(col_array.count){\"?\"}.join(\", \")\n col_string = col_array.join(\", \").gsub(/@/, \"\")\n DBConnection.execute(<<-SQL, *attribute_values )\n INSERT INTO #{self.class.table_name}\n (#{col_string})\n VALUES (#{qmark_string})\n SQL\n self.id = DBConnection.last_insert_row_id\n end",
"def activerecord?\n record.is_a?(::ActiveRecord::Base)\n end",
"def find_all\n \n end",
"def connection\n ActiveRecord::Base.connection\n end",
"def connection\n ActiveRecord::Base.connection\n end",
"def object_id() end",
"def select_all; end"
] | [
"0.5917317",
"0.5899161",
"0.5853252",
"0.55706394",
"0.5535221",
"0.5432858",
"0.539077",
"0.53449047",
"0.53095895",
"0.5245881",
"0.52411354",
"0.52411354",
"0.52387166",
"0.52336055",
"0.52162683",
"0.51960176",
"0.5171255",
"0.5149756",
"0.5149756",
"0.51436627",
"0.512056",
"0.5118857",
"0.5105697",
"0.5097014",
"0.5076934",
"0.507685",
"0.50717586",
"0.5071558",
"0.5056875",
"0.5046382",
"0.50397563",
"0.50343615",
"0.5030867",
"0.502873",
"0.5021454",
"0.5018816",
"0.5014746",
"0.50109446",
"0.5007605",
"0.5006761",
"0.4990852",
"0.49880284",
"0.49819076",
"0.49711648",
"0.49689123",
"0.49688065",
"0.49688065",
"0.49688065",
"0.49688065",
"0.49658602",
"0.4964524",
"0.4963996",
"0.49482182",
"0.49380136",
"0.4937148",
"0.49347627",
"0.4926116",
"0.49228755",
"0.491952",
"0.49142113",
"0.49135253",
"0.49135253",
"0.49004394",
"0.489594",
"0.48951146",
"0.48934624",
"0.48934624",
"0.48934624",
"0.48896742",
"0.4882769",
"0.48814434",
"0.48814434",
"0.48814434",
"0.48801368",
"0.48766437",
"0.4873647",
"0.48713422",
"0.4865376",
"0.4864939",
"0.4864501",
"0.48615363",
"0.48574486",
"0.48476234",
"0.4842187",
"0.48409417",
"0.48397875",
"0.48397875",
"0.48384625",
"0.4831052",
"0.4831052",
"0.4831052",
"0.48266363",
"0.48259512",
"0.48244268",
"0.48214152",
"0.48180073",
"0.48157787",
"0.4805501",
"0.4805501",
"0.47995323",
"0.47978106"
] | 0.0 | -1 |
Handle to designage/move sortable elements | def sort_handler(force = false)
# return unless logged_in?
# return if @is_homepage and (not force)
'<img class="sort_handler" src="/images/arrow.gif" alt="" />'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sortable(pos)\n @sortable[pos]\n end",
"def update_sortable(pos, newVal)\n sort_function = @parent.sort_function(pos)\n if sort_function\n @sortable[pos] = sort_function.call(newVal)\n else\n @sortable[pos] = newVal\n end\n end",
"def __sortable__\n self\n end",
"def drag_to_order_internal( dimension, items, positions )\n if items.length == 1\n return true\n end\n\n while true\n current=$driver.find_element( items[0][0].to_sym, items[0][1] )\n\n current_loc = current.location.send( dimension )\n jitter = 0\n if dimension == :x\n jitter = current.size.width\n else\n jitter = current.size.height\n end\n\n diff = positions[0] - current_loc\n\n $debug and print \"In drag_to_order_internal: current: #{current}\\n\"\n $debug and print \"In drag_to_order_internal: d0: #{positions[0]}\\n\"\n $debug and print \"In drag_to_order_internal: current_loc: #{current_loc}\\n\"\n $debug and print \"In drag_to_order_internal:diff : #{diff}\\n\"\n\n # Increase the absolute value of diff slightly, and keep the\n # sign\n fixed_diff = diff != 0 ? ((diff.abs + jitter - 1) * (diff/diff.abs)) : 0\n if diff.abs > jitter\n x = 0\n y = 0\n if dimension == :x\n x = [ fixed_diff, (diff * 1.2).to_i ].max\n end\n if dimension == :y\n y = [ fixed_diff, (diff * 1.2).to_i ].max\n end\n\n hover_and_move_slow( items[0][0].to_sym, items[0][1], x, y )\n else\n break\n end\n end\n\n drag_to_order_internal( dimension, items[1..-1], positions[1..-1] )\n end",
"def make_sortable(options={})\n sortable_element_js(javascript_variable('this'), options)\n end",
"def drag_to_order( dimension, items )\n positions = Array.new\n items.each_index do |n|\n item=$driver.find_element( items[n][0].to_sym, items[n][1] )\n positions[n] = item.location.send( dimension )\n end\n positions.sort!\n $debug and print \"In drag_to_order: items: #{YAML.dump(items)}\\n\"\n $debug and print \"In drag_to_order: positions: #{YAML.dump(positions)}\\n\"\n drag_to_order_internal( dimension, items, positions )\n\n # Then we re-pull the positions and check them\n last=0\n current=0\n items.each_index do |n|\n item=$driver.find_element( items[n][0].to_sym, items[n][1] )\n current = item.location.send( dimension )\n current.should satisfy { |current| current > last }\n last = current\n end\n end",
"def sortable?\n !@sortable.nil?\n end",
"def sortable_sort\n @sortable_sort\n end",
"def set_sortable\n @sortable = Sortable.find(params[:id])\n end",
"def update_sort_key\n @item.sort_key = @sortable[@parent.sort_index]\n @item.reversed = @parent.reversed? ? -1 : 1\n end",
"def move\n @page = Page.find(params[:drag_id])\n @page.update_sorting Page.find(params[:drop_id]), params[:position]\n \n render :json => { :moved => true }\n end",
"def sortable_fields\n []\n end",
"def sortable_params\n params.require(:sortable).permit(:position, :column)\n end",
"def sortable\n sorted = params[:sidebar].map(&:to_i)\n\n Sidebar.transaction do\n sorted.each_with_index do |sidebar_id, staged_index|\n # DEV NOTE : Ok, that's a HUGE hack. Sidebar.available are Class, not\n # Sidebar instances. In order to use jQuery.sortable we need that hack:\n # Sidebar.available is an Array, so it's ordered. I arbitrary shift by?\n # IT'S OVER NINE THOUSAND! considering we'll never reach 9K Sidebar\n # instances or Sidebar specializations\n sidebar = if sidebar_id >= 9000\n SidebarRegistry.available_sidebars[sidebar_id - 9000]\n .new(blog: this_blog)\n else\n Sidebar.valid.find(sidebar_id)\n end\n sidebar.update(staged_position: staged_index)\n end\n end\n\n @ordered_sidebars = Sidebar.ordered_sidebars\n @available = SidebarRegistry.available_sidebars\n\n respond_to do |format|\n format.js\n format.html do\n return redirect_to admin_sidebar_index_path\n end\n end\n end",
"def drag_and_drop_by(source, right_by, down_by, device: T.unsafe(nil)); end",
"def user_sortable_list(sortable)\n sortable.order.join(\"\\n\")\n end",
"def sortable_handle_tag(object)\n class_name = \"handle #{ object.class.name.underscore }\"\n image = image_tag(\"move.gif\", :border => 0, :alt => \"#{ _(\"Move\") }\", :class => class_name)\n\n object.new_record? ? \"\" : image\n end",
"def reorder\n # If it's AJAX, do our thing and move on...\n if request.xhr?\n params[\"page_list_#{params[:id]}\"].each_with_index { |id,idx| ComatosePage.update(id, :position => idx) }\n expire_cms_page ComatosePage.find(params[:id])\n render :text=>'Updated sort order', :layout=>false\n else\n @page = ComatosePage.find params[:id]\n if params.has_key? :cmd\n @target = ComatosePage.find params[:page]\n case params[:cmd]\n when 'up' then @target.move_higher\n when 'down' then @target.move_lower\n end\n redirect_to :action=>'reorder', :id=>@page\n end\n end\n end",
"def sortable?\n self.sortable = Presenting::Defaults.grid_is_sortable unless defined? @sort_name\n self.sortable = self.id if @sort_name == true\n !@sort_name.blank?\n end",
"def sortable?\n !faceted? && !hard_paginate?\n end",
"def move_up\n # TODO: maybe refactor this to use acts-as-list or ranked-model\n aisles = @store.aisles\n\n # first, compact everything back down to 1-n in case a delete or something got it out of whack\n aisles.sort! { |a, b| a.position <=> b.position }\n aisles.each_with_index do |aisle, i|\n aisle.position = i + 1\n aisle.save!\n end\n\n @aisle = aisles.find(params[:id])\n original_position = @aisle.position\n if original_position > 1\n @aisle.position -= 1\n @aisle.save!\n aisles.each do |aisle|\n aisle.position += 1 if aisle != @aisle &&\n aisle.position >= @aisle.position &&\n aisle.position <= original_position\n aisle.save!\n end\n end\n redirect_to(store_aisles_url(@store.id))\n end",
"def sortable?\n return false if multiple?\n\n human_readable?\n end",
"def move_without_saving(vector)\n if vector.kind_of?(Hash)\n action, object = vector.keys[0], vector.values[0]\n else\n action = vector\n end\n\n # set the start position to 1 or, if offset in the list_options is :list, :first => X\n minpos = model.list_options[:first]\n\n # the previous position (if changed) else current position\n prepos = original_attributes[properties[:position]] || position\n\n # set the last position in the list or previous position if the last item\n maxpos = (last = list.last) ? (last == self ? prepos : last.position + 1) : minpos\n\n newpos = case action\n when :highest then minpos\n when :top then minpos\n when :lowest then maxpos\n when :bottom then maxpos\n when :higher,:up then [ position - 1, minpos ].max\n when :lower,:down then [ position + 1, maxpos ].min\n when :above\n # the object given, can either be:\n # -- the same as self\n # -- already below self\n # -- higher up than self (lower number in list)\n ( (self == object) or (object.position > self.position) ) ? self.position : object.position\n\n when :below\n # the object given, can either be:\n # -- the same as self\n # -- already above self\n # -- lower than self (higher number in list)\n ( self == object or (object.position < self.position) ) ? self.position : object.position + 1\n\n when :to\n # can only move within top and bottom positions of list\n # -- .move(:to => 2 ) Hash with FixNum\n # -- .move(:to => '2' ) Hash with String\n\n # NOTE:: sensitive functionality\n # maxpos is incremented above, so decrement by 1 to get true maxpos\n # minpos is fixed, so just take the object position value given\n # else add 1 to object position value\n obj = object.to_i\n if (obj > maxpos)\n [ minpos, [ obj, maxpos - 1 ].min ].max\n else\n [ minpos, [ obj, maxpos ].min ].max\n end\n\n else\n raise ArgumentError, \"unrecognized vector: [#{action}]. Please check your spelling and/or the docs\" if action.is_a?(Symbol)\n # -- .move(2) as FixNum only\n # -- .move('2') as String only\n if action.to_i < minpos\n [ minpos, maxpos - 1 ].min\n else\n [ action.to_i, maxpos - 1 ].min\n end\n end\n\n # don't move if already at the position\n return false if [ :lower, :down, :higher, :up, :top, :bottom, :highest, :lowest, :above, :below ].include?(action) && newpos == prepos\n return false if !newpos || ([ :above, :below ].include?(action) && list_scope != object.list_scope)\n return true if newpos == position && position == prepos || (newpos == maxpos && position == maxpos - 1)\n\n if !position\n list.all(:position.gte => newpos).adjust!({ :position => 1 }, true) unless action =~ /:(lowest|bottom)/\n elsif newpos > prepos\n newpos -= 1 if [:lowest,:bottom,:above,:below].include?(action)\n list.all(:position => prepos..newpos).adjust!({ :position => -1 }, true)\n elsif newpos < prepos\n list.all(:position => newpos..prepos).adjust!({ :position => 1 }, true)\n end\n\n self.position = newpos\n self.moved = true\n true\n end",
"def move_measurement_down\n respond_to do |format|\n format.js { head :ok } ## only return 200 to client\n end\n measurements_array = @data_list.data_list_measurements.to_a.sort_by{ |m| m.list_order }\n old_index = measurements_array.index{ |m| m.measurement_id == params[:measurement_id].to_i }\n if old_index >= measurements_array.length - 1\n return\n end\n measurements_array.each_index do |i|\n if old_index + 1 == i\n measurements_array[i].update list_order: i - 1\n next\n end\n if old_index == i\n measurements_array[i].update list_order: i + 1\n next\n end\n measurements_array[i].update list_order: i\n end\n end",
"def sort\n if (defined? params[:moved] and defined? params[:test_case])\n # moved will look like 'test_case_3.0', make it '3.0' instead\n params[:moved].gsub!(/.*_(\\d+\\.\\d+)$/, '\\1')\n # find the new position for this item\n pos = params[:test_case].index(params[:moved]) + 1\n tc_id, tc_pos = params[:moved].split('.', 2)\n if (defined? pos and pos != tc_pos.to_i)\n stc = SuiteTestCase.where(:suite_id => params[:id], :test_case_id => tc_id).first\n if stc.insert_at(pos) != false\n flash[:notice] = \"Successfully saved sort order.\"\n end\n end\n end\n @suite = Suite.find(params[:id])\n # must redraw list with updated id #'s\n @current_cases = @suite.test_cases\n respond_with @suite do |format|\n format.js { render 'sort.js' }\n end\n end",
"def sort_order\n super\n end",
"def move_measurement_up\n respond_to do |format|\n format.js { head :ok } ## only return 200 to client\n end\n measurements_array = @data_list.data_list_measurements.to_a.sort_by{ |m| m.list_order }\n old_index = measurements_array.index{ |m| m.measurement_id == params[:measurement_id].to_i }\n if old_index <= 0\n return\n end\n measurements_array.each_index do |i|\n if old_index - 1 == i\n measurements_array[i].update list_order: i + 1\n next\n end\n if old_index == i\n measurements_array[i].update list_order: i - 1\n next\n end\n measurements_array[i].update list_order: i\n end\n end",
"def render\n <<-HTML\n #{caption}<ol id=\"#{prefix}-sortable-items\" class=\"cbl-sortable-items\">\n #{item_renders}\n </ol>\n <input type=\"hidden\" name=\"#{input_name}\" id=\"#{prefix}-sorted_ids\" value=\"#{item_ids}\" size=\"50\" data-sortable-prefix=\"#{prefix}\"#{grouping}/>\n HTML\n end",
"def reorder(positions)\n\t SortableList.new(self.serial_works.in_order).reorder_list(positions)\n\tend",
"def index\n get_sorted_objects(params)\n render :template => 'sortable/index'\n end",
"def rearrange\n # Calculate the number of the dynamic dimension.\n case @type\n when :fixed_rows\n @num_columns = (size / @num_rows.to_f).ceil\n when :fixed_columns\n @num_rows = (size / @num_columns.to_f).ceil\n end\n\n # Create an array containing all the rows.\n @rows = case @type\n when :fixed_rows\n # Rearrange the list, arranged by columns, into rows.\n rows = Array.new(@num_rows) { [] }\n @children.each_with_index do |child, i|\n rows[i % @num_rows].push child\n end\n rows\n when :fixed_columns\n @children.each_slice(@num_columns).to_a\n end\n\n nil\n end",
"def moves\n # overridden in slideable/stepable modules\n end",
"def sortable_attributes\n @sortable_attributes ||= []\n end",
"def swap_with_next i\n #if first_item >= first_item.next_list_item\n\n end",
"def bubble_up()\n\t\ti = @elements.length - 1\n\t\twhile(i > 0)\n\t\t\t# compare with its parent. swap if parent is less than it\n\t\t\tif @elements[(i-1)/2][@orderBy] >= @elements[i][@orderBy]\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\tswap((i-1)/2, i)\n\t\t\t\ti = (i-1)/2\n\t\t\tend\n\t\tend\n\tend",
"def sortable?\n true\n # not self.action? and\n # !options[:through] && !@column.nil?\n end",
"def sortable(column, title = nil)\n title ||= column.titleize\n css_class = column == sort_column ? \"current #{sort_direction}\" : nil\n direction = (column == sort_column && sort_direction == 'asc') ? 'desc' : 'asc'\n icon_name = column == sort_column ? sort_direction == 'asc' ? 'chevron-up' : 'chevron-down' : nil\n link_to \"#{title}#{icon(icon_name)}\".html_safe,\n # when we reorder an list it goes back to the first page\n params.merge(sort: column, direction: direction, page: 1),\n data: { column: column },\n remote: true,\n class: \"sortable #{css_class}\"\n end",
"def move_up_in_collection!\n weight = self.weight\n\n if previous_item = self.prioritizable_collection.where(['weight > ?', weight]).last\n swap_weight_with_other_item!(previous_item)\n end\n end",
"def add_sort_field(*) super end",
"def set_sortable_mode\n if @user_mode == \"instructor\" || @course_asset.try(:assetable_type) == \"Subject\"\n @sortable = \"sortable\"\n else\n @sortable = \"not-sortable\"\n end\n end",
"def up_item \n order_op2(true, @item)\n end",
"def move_up_action\n post1 = Post.find(params[:post_id].to_i)\n post2 = Post.where(\"sort_id > ?\", post1.sort_id).order(\"sort_id ASC\").first\n if post1 && post2\n post1_sort_id = post1.sort_id\n post1.sort_id = post2.sort_id\n post2.sort_id = post1_sort_id\n post1.save!\n post2.save!\n end\n return redirect_to \"/admin\"\n end",
"def bubble_up(index)\n #YOUR WORK HERE\n end",
"def sortable(sortable)\n raise \"sortable must be a boolean.\" unless is_bool? sortable\n @sortable = sortable\n self\n end",
"def cloned_user_sortable(preset, attribute)\n if (order = preset.try(attribute)) && order.persisted?\n order.class.new(order.attributes.except('id', 'scenario_id'))\n end\n end",
"def move_component_up()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.LayoutEditor_move_component_up(@handle.ptr)\n end",
"def moveup\n papers = venue.papers.where(\"listorder < ?\",self.listorder).order(:listorder)\n \n if papers.length == 1\n self.listorder = papers[0].listorder - 1.0\n elsif papers.length > 1\n self.listorder = (papers[papers.length-1].listorder + papers[papers.length-2].listorder) / 2\n end\n end",
"def reorder_children!(*sorted_ids)\n return if children.empty?\n last_moved = nil\n sorted_ids.flatten.each do |child_id|\n child = children.find { |item| item.id.to_s == child_id.to_s }\n next if child.nil?\n if last_moved.nil?\n child.move_to_left_of(children[0]) unless child == children[0]\n else\n child.move_to_right_of(last_moved)\n end\n child.save # Needed in order for the sweeper to work properly\n last_moved = child\n end\n end",
"def manageable_sortable(column, title = nil, options = {})\n title ||= column.titleize\n\n if respond_to?(:sort_column) && respond_to?(:sort_direction)\n css_class = column && sort_column && column.to_sym == sort_column.to_sym ? \"sort_#{sort_direction}\" : nil\n direction = column && sort_column && column.to_sym == sort_column.to_sym && sort_direction == \"asc\" ? \"desc\" : \"asc\"\n options[:class] = [options[:class], css_class].compact.join(\" \")\n\n link_to title, params.merge(:sort => column, :direction => direction, :page => nil), options\n else\n title\n end\n end",
"def arrange\n\t\t\n\tend",
"def repaint\n # we need to see if structure changed then regenerate @list\n _list()\n super\n end",
"def moveup\n @quality_rating_field = QualityRatingField.find(params[:quality_rating_field_id])\n\t@extraction_form = ExtractionForm.find(params[:extraction_form_id])\t\t\n\tQualityRatingField.move_up_this(params[:quality_rating_field_id].to_i, params[:extraction_form_id])\n\t@quality_rating_fields =QualityRatingField.find(:all, :conditions => {:extraction_form_id => params[:extraction_form_id]}, :order => \"display_number ASC\")\n\t@div_name = \"quality_rating_fields_table\"\n\t@partial_name = \"quality_rating_fields/table\"\n\t@quality_rating_field = QualityRatingField.new\n\trender \"shared/render_partial.js.erb\"\n end",
"def sort_link(*args)\n\t\toptions = {\n\t\t\t:image => true\n\t\t}.merge(args.extract_options!)\n\t\tcolumn = args[0]\n\t\ttext = args[1]\n\t\t#\tmake local copy so mods to muck up real params which\n\t\t#\tmay still be references elsewhere.\n\t\tlocal_params = params.dup\n\n#\n#\tMay want to NOT flip dir for other columns. Only the current order.\n#\tWill wait until someone else makes the suggestion.\n#\n\t\torder = column.to_s.downcase.gsub(/\\s+/,'_')\n\t\tdir = ( local_params[:dir] && local_params[:dir] == 'asc' ) ? 'desc' : 'asc'\n\n\t\tlocal_params[:page] = nil\n\t\tlink_text = text||column\n\t\tclasses = ['sortable',order]\n\t\tarrow = ''\n\t\tif local_params[:order] && local_params[:order] == order\n\t\t\tclasses.push('sorted')\n\t\t\tarrow = if dir == 'desc'\n\t\t\t\tif File.exists?( sort_down_image ) && options[:image]\n\t\t\t\t\timage_tag( File.basename(sort_down_image), :class => 'down arrow')\n\t\t\t\telse\n\t\t\t\t\t\"<span class='down arrow'>↓</span>\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif File.exists?( sort_up_image ) && options[:image]\n\t\t\t\t\timage_tag( File.basename(sort_up_image), :class => 'up arrow')\n\t\t\t\telse\n\t\t\t\t\t\"<span class='up arrow'>↑</span>\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\ts = \"<div class='#{classes.join(' ')}'>\"\n\t\ts << link_to(link_text,local_params.merge(:order => order,:dir => dir))\n\t\ts << arrow unless arrow.blank?\n\t\ts << \"</div>\"\n\t\ts.html_safe\n#\tNOTE test this as I suspect that it needs an \"html_safe\" added\n\tend",
"def sortable_columns\n [\"date\", \"dow\", \"sortable_title\", \"receipts\"]\n end",
"def draggable(renderer, event_handler_registry, handle_w, handle_h, region_rect, ui_state, &on_change)\n handle_x = ui_state[:handle_x] || 0\n handle_y = ui_state[:handle_y] || 0\n if !(ui_state[:pressed])\n evh = { type: :mouse_down, rect: Rect.new(handle_x, handle_y, handle_w, handle_h), callback: proc { |_ev|\n if !(ui_state[:pressed])\n ui_state[:pressed] = true\n yield(ui_state) if on_change\n true\n else\n false\n end\n } }\n event_handler_registry.register_event_handler(evh)\n else\n evh2 = { type: :mouse_move, callback: proc { |ev|\n if ui_state[:pressed] == true\n new_handle_x = (ui_state[:handle_x] || 0) + ev.xrel\n new_handle_x = region_rect.x if new_handle_x < region_rect.x\n new_handle_x = region_rect.x2 if new_handle_x > region_rect.x2\n\n new_handle_y = (ui_state[:handle_y] || 0) + ev.yrel\n new_handle_y = region_rect.y if new_handle_y < region_rect.y\n new_handle_y = region_rect.y2 if new_handle_y > region_rect.y2\n\n ui_state[:handle_x] = new_handle_x\n ui_state[:handle_y] = new_handle_y\n\n yield(ui_state) if on_change\n true\n else\n false\n end\n } }\n\n evh1 = { type: :mouse_up, callback: proc { |_ev|\n if ui_state[:pressed] == true\n ui_state[:pressed] = false\n yield(ui_state) if on_change\n true\n else\n false\n end\n } }\n\n event_handler_registry.register_event_handler(evh1)\n event_handler_registry.register_event_handler(evh2)\n end\nend",
"def series_sortable(solr_doc)\n title_for_heading(solr_doc[Solrizer.solr_name(\"parent_unittitles\", :displayable)]) unless solr_doc[Solrizer.solr_name(\"parent_unittitles\", :displayable)].nil?\n end",
"def rearrange_children!\n @rearrange_children = true\n end",
"def update_safe_display_order(params)\n\n reorder = ->(relation, offset) do\n return if relation.size == 0\n start = offset ? [relation.size, *relation.pluck(:display_order), *relation.map(&:display_order)].compact.max.to_i + 1 : 1\n relation.each { |item| item.created_at = DateTime.now if item.created_at.nil? }\n relation.sort_by(&:created_at).each_with_index {|el, i| el.display_order = start + i}\n end\n\n assign_attributes(params)\n\n if valid?\n reorder.(sections, true)\n sections.each {|s| reorder.(s.questions, true)}\n sections.flat_map(&:questions).each {|q| reorder.(q.multiple_choice_options, true)}\n offset_saved = save\n\n reorder.(sections, false)\n sections.each {|s| reorder.(s.questions, false)}\n sections.flat_map(&:questions).each {|q| reorder.(q.multiple_choice_options, false)}\n ordered_save = save\n\n return (offset_saved && ordered_save)\n else\n return false\n end\n end",
"def double_sorted_add(item)\n raise NotImplementedError, \"Double Sorted Linked Lists are not supported\"\n end",
"def add_draggables(stuff)\n stuff.each {|obj| add_draggable(obj)}\n end",
"def sash_dragto(index, x, y)\n execute_only(:sash, :dragto, index, x, y)\n end",
"def move_down_action\n post1 = Post.find(params[:post_id].to_i)\n post2 = Post.where(\"sort_id < ?\", post1.sort_id).order(\"sort_id DESC\").first\n if post1 && post2\n post1_sort_id = post1.sort_id\n post1.sort_id = post2.sort_id\n post2.sort_id = post1_sort_id\n post1.save!\n post2.save!\n end\n return redirect_to \"/admin\"\n end",
"def create\n @sortable = Sortable.new(sortable_params)\n\n # respond_to do |format|\n if @sortable.save\n redirect_to sortables_path, notice: \"New #{@sortable.column} item created\"\n else\n redirect_to sortables_path, notice: \"#{@sortable.column} item failed to create\"\n end\n # end\n end",
"def move_diffs\n \n end",
"def sortable(column, title = nil) \n title ||= column.titleize\n css_class = column == sort_column ? \"current #{sort_direction}\" : nil\n direction = column == sort_column && sort_direction == \"asc\" ? \"desc\" : \"asc\"\n # In the link to below we added the :product and :versino aprameters\n # these parameters are added to urls by the search function. For example, see the Execute and Versions page\n # We preserve them for use when a search and then order is selected\n link_to title, {:sort => column, :direction => direction, :product => params[:product], :version => params[:version]}, {:class => css_class}\n end",
"def update_list_input\n index = @index\n return true unless index_changed(:@index, :UP, :DOWN, @last_index)\n play_cursor_se\n delta = @index - index\n if delta.abs == 1\n animate_list_index_change(delta)\n else\n update_item_button_list\n update_info\n @scroll_bar.index = @index\n end\n return false\n end",
"def array\n # assign the sorted tree to a variable\n newlist = params[:ul].sort\n # initialize the previous item\n previous = nil\n #loop through each item in the new list (passed via ajax)\n newlist.each_with_index do |array, index|\n # get the category id of the item being moved\n moved_item_id = array[1][:id].gsub(/category_/,'')\n # find the object that is being moved (in database)\n @current_category = Category.find_by_id(moved_item_id)\n # if this is the first item being moved, move it to the root.\n unless previous.nil?\n @previous_item = Category.find_by_id(previous)\n @current_category.move_to_right_of(@previous_item)\n else\n @current_category.move_to_root\n end\n # then, if this item has children we need to loop through them\n unless array[1][:children].blank?\n # NOTE: unless there are no children in the array, send it to the recursive children function\n childstuff(array[1], @current_category)\n end\n # set previous to the last moved item, for the next round\n previous = moved_item_id\n end\n Category.rebuild!\n render :nothing => true\n end",
"def parent=(newParent)\n return if newParent == @parent\n remove_item if @parent\n @parent = newParent\n @content.each_index do |pos|\n update_sortable(pos, @content[pos]) if @parent\n end\n end",
"def putmove(movetype,column,gen) #column refers to leftmost column in move\n #put pieces on board\n if movetype == 1\n @board.droppiece(currpieces[0],column)\n @board.droppiece(currpieces[1],column)\n elsif movetype == 2\n @board.droppiece(currpieces[1],column)\n @board.droppiece(currpieces[0],column)\n elsif movetype == 3\n @board.droppiece(currpieces[0],column)\n @board.droppiece(currpieces[1],column+1)\n elsif movetype == 4\n @board.droppiece(currpieces[1],column)\n @board.droppiece(currpieces[0],column+1)\n end \n setcurr(@nextpieces[0],@nextpieces[1])\n if gen\n gennext\n end\n end",
"def test_moving\n item = QuotedList.first\n item.higher_items\n item.lower_items\n item.send :bottom_item # Part of private api\n end",
"def reorder\n slide_images.each_with_index do |slide, index|\n slide.update_attribute(:position, index + 1)\n expire_page :controller => 'pages', :action => 'thumb', :id => slide.id\n end\n expire_page :controller => 'pages', :action => 'card', :id => card.slug\n redirect_to admin_card_slide_images_path(card)\n end",
"def render_items\n @items.reverse_each_with_index do |item, index|\n # Skip if item is already in\n next if item.parent\n\n next_item = @items[index + 1]\n if next_item\n # If there is a nex item isert before it\n next_id = next_item.data[key]\n el = @items.find { |element| element.data[key] == next_id }\n insert_before item, el\n else\n # Else append at the end\n item >> self\n end\n end\n end",
"def dragged\n search($items[0])\nend",
"def reorder_queue_items\n queue_items.each_with_index do |queue_item,index|\n queue_item.update_attributes(list_order: index + 1)\n end\n end",
"def sort\r\n key = params.keys.grep(/m(?:aj|in)ors/).shift # Get DOM ID.\r\n order, parent = params[key], key[/\\d+/] # Filter out category ids.\r\n attrs = order, (1..order.length).map { |p| { :position => p } }\r\n unless parent.nil? # Scope\r\n instance.idea_categories.find(parent).subcategories.update *attrs\r\n else\r\n instance.idea_categories.update *attrs\r\n end\r\n render(:update) { |page| page.visual_effect :highlight, key }\r\n end",
"def less *elements\n (self - elements).extend Swapable\n end",
"def move_component_down()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.LayoutEditor_move_component_down(@handle.ptr)\n end",
"def tree_actions(row)\r\n html = [link_to(image_tag('std/edit.png'), :controller => :dev_feedbacks, :action => :edit, :id => row.id)]\r\n html << link_to(image_tag('std/del.png'),\r\n {:controller => :dev_feedbacks, :action => :destroy, :id => row.id},\r\n :remote => true,\r\n :confirm => _(\"Are you sure that you want to delete %{name}?\") % {:name => row.disp_name})\r\n c = DevFeedback.get_root.children\r\n html << link_to(image_tag('std/go_up.png'),\r\n {:controller => :dev_feedbacks, :action => :tree_move, :id => row.id, :direction => :prev},\r\n :update => \"dev_feedback_#{row.parent_id || 0}_div\", :remote => true) if row.self_and_siblings.first != row || (row.parent.nil? && c.first != row)\r\n html << link_to(image_tag('std/go_down.png'),\r\n {:controller => :dev_feedbacks, :action => :tree_move, :id => row.id, :direction => :next},\r\n :update => \"dev_feedback_#{row.parent_id || 0}_div\", :remote => true) if row.self_and_siblings.last != row || (row.parent.nil? && c.last != row)\r\n html << link_to(image_tag('std/go_left.png'),\r\n {:controller => :dev_feedbacks, :action => :tree_move, :id => row.id, :direction => :dec},\r\n :update => \"dev_feedback_#{row.parent.parent_id || 0}_div\", :remote => true) unless row.parent.nil?\r\n html << link_to(image_tag('std/go_right.png'),\r\n {:controller => :dev_feedbacks, :action => :tree_move, :id => row.id, :direction => :inc},\r\n :update => \"dev_feedback_#{row.left_sibling.id}_div\",\r\n :loaded => %Q[$(\"dev_feedback_#{row.id}_div\").remove()],\r\n :position => :bottom, :remote => true) if row.left_sibling\r\n return content_tag(:span, html.join.html_safe, :class => 'tree_actions', :id => \"#{row.id}_actions\")\r\n end",
"def move_diffs\n\n end",
"def move_to_position(new_position)\n old_position = self.send(position_column)\n unless new_position == old_position\n if new_position < old_position\n # Moving higher in the list (up) \n new_position = [1, new_position].max\n increment_positions_between(new_position, old_position - 1)\n else\n # Moving lower in the list (down)\n new_position = [bottom_position_in_list(self).to_i, new_position].min\n decrement_positions_between(old_position + 1, new_position)\n end\n self.update_attribute(position_column, new_position)\n end\n end",
"def move_down\n @collection.move_lower\n redirect_to account_collections_url, notice: 'Collection was successfully reordered.'\n end",
"def update_task_orders\n if column_id_changed?\n rearrange_tasks_old_column\n rearrange_tasks_new_column\n else\n if task_order_changed?\n if task_order > task_order_in_database\n task_moved_down\n else\n task_moved_up\n end\n end\n end\n end",
"def move_down\n\n section = Section.find(params[:id])\n index = section.checklist.sections.index(section)\n\n if section.checklist.sections[index].move_lower\n flash['notice'] = 'Sections were re-ordered'\n else\n flash['notice'] = 'Section re-order failed'\n end\n\n redirect_to(:controller => 'checklist', \n :action => 'edit', \n :id => section.checklist_id)\n end",
"def index\n @sortable = Sortable.new\n @sortables = Sortable.all\n @column = Column.new\n @columns = Column.all\n end",
"def drag(componentName, o1, o2, o3, o4, o5 = nil, o6 = nil)\n $marathon.drag(componentName, o1, o2, o3, o4, o5, o6)\nend",
"def move_diffs\n raise NotImplementedError\n end",
"def grand_sorting_machine(array)\n\n\n\nend",
"def perform_reorder_of_children(ordered_ids, current)\n steps = calculate_reorder_steps(ordered_ids, current)\n steps.inject([]) do |result, (source, idx)|\n target = current[idx]\n if source.id != target.id \n source.swap(target, false) \n from = current.index(source)\n current[from], current[idx] = current[idx], current[from]\n result << source\n end\n result\n end\n end",
"def handle_search_n_sort\n if @search_sort\n inject_into_file \"app/models/#{singular_table_name}.rb\",\n before: /^end/ do\n \"\\n\\textend SqlSearchableSortable\\n\"\n end\n inject_into_file \"app/models/#{singular_table_name}.rb\",\n before: /^end/ do\n \"\\n\\tsql_searchable #{searchable_cols_as_symbols}\\n\" \n end\n inject_into_file \"app/models/#{singular_table_name}.rb\",\n before: /^end/ do\n \"\\n\\tsql_sortable #{cols_to_symbols}\\n\"\n end\n end\n\n end",
"def move; end",
"def move; end",
"def providers_sort_save\n params[:sortable_list].each_index do |i|\n item = SmsLcrprovider.find(:first, :conditions => [\"sms_provider_id = ? AND sms_lcr_id = ?\", params[:sortable_list][i], params[:id]])\n item.priority = i\n item.save\n end\n @page_title = _('Change_Order') + \": \" + @lcr.name\n @items = @lcr.sms_providers(\"asc\")\n render :layout => false, :action => :providers_sort\n end",
"def move_lower\n lower = lower_item\n return unless lower\n acts_as_list_class.transaction do\n self.update_attribute(position_column, lower.send(position_column))\n lower.decrement_position\n end\n end",
"def drag_and_drop(source, sourceinfo, target, targetinfo, action)\n $marathon.dragAndDrop(ComponentId.new(source, sourceinfo), ComponentId.new(target, targetinfo), action)\nend",
"def smart_table_sortable(text, attribute)\n raise 'smart_table_params must be called on the controller, before using smart_table_sortable helper' unless get_cached_smart_table_params\n\n current_sort_state = get_cached_smart_table_params.sort\n attribute = attribute.to_s\n\n current_sort_attribute, current_sort_order = if current_sort_state.present?\n current_sort_state.downcase.split\n else\n nil\n end\n\n next_sort_order = if current_sort_attribute == attribute\n SORT_ORDERS[(SORT_ORDERS.index(current_sort_order) + 1) % SORT_ORDERS.size]\n else\n SORT_ORDERS.first\n end\n\n link_url = current_request_url_with_merged_query_params(SORT_PARAM => \"#{attribute} #{next_sort_order}\")\n link_class = \"smart-table-link smart-table-sort-link smart-table-sort-link-#{attribute}\"\n link_to link_url, class: link_class, data: {smart_table_remote_link: (true if get_cached_smart_table_params.remote)} do\n text.html_safe + ' ' + (\n if current_sort_attribute == attribute && current_sort_order == 'asc'\n \"<span class='fa fa-sort-down smart-link-sort-arrow-asc'></span>\".html_safe\n elsif current_sort_attribute == attribute && current_sort_order == 'desc'\n \"<span class='fa fa-sort-up smart-link-sort-arrow-desc'></span>\".html_safe\n else\n \"<span class='fa fa-sort smart-link-sort-arrow-unsorted'></span>\".html_safe\n end\n )\n end\n end",
"def bubble_down()\n\t\t# remove max and swap with last node\n\t\t@elements[0] = @elements.pop\n\t\ti = 0\n\t\twhile(i < @elements.length)\n\t\t\tmax_idx = i\n\t\t\t# find greater of left and right child\n\t\t\tif((2*i + 1) < @elements.length && @elements[2*i + 1][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 1\n\t\t\tend\n\t\t\tif((2*i + 2) < @elements.length && @elements[2*i + 2][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 2\n\t\t\tend\n\t\t\t# if left or right child is greater, swap and update i\n\t\t\tif(max_idx != i)\n\t\t\t\tswap(i, max_idx)\n\t\t\t\ti = max_idx\n\t\t\t# if not, we are done\n\t\t\telse\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\tend",
"def drag(componentName, o1, o2, o3, o4, o5 = nil, o6 = nil)\n $marathon.drag(componentName, o1, o2, o3, o4, o5, o6)\nend",
"def moves\n\n HORIZONTAL_DIRS.each do |direction|\n x,y = direction\n grow_unblocked_moves_in_dir(x,y)\n end\n\n #call grow_unblocked_ele \n# RIGHT HERE!!!\n \n #1 call move_dirs -< put this in each class\n #will return array of all possible moves from unblocked into moves array\n\n\n #2 Then #moves is used collects the all possible moves\n\n\n # create array to collect moves\n\n # iterate over each of the directions in which a slideable piece can move\n # use the Piece subclass' `#move_dirs` method to get this info\n # for each direction, collect all possible moves in that direction\n # and add them to your moves array \n # (use the `grow_unblocked_moves_in_dir` helper method)\n\n # return the final array of moves (containing all possible moves in all directions)\n end",
"def XOdragAndDrop(tag, tvalue, right_by, down_by)\n\n\t\turl= @wwBrws.url.to_s\n\t\t$pfd.tstart(url)\n\t\tbegin\n\t\t\tel= @wwBrws.element(tag, tvalue)\n\t\t\tel.drag_and_drop_by( right_by, down_by)\n\t\t\t$pfd.calcApplRes(true, 'Drag and drop '+par1+' by '+right_by.to_s+'/'+down_by.to_s, url)\n\t\t\tsleep TIMETICK\t\t\t\t\t\t\t\t\t\t\t\t\t\t# small sleep to let objects appear\n\t\t\tres= OK\n\t\trescue\n\t\t\tmsg='DragAndDrop failed. Values: /'+tag.to_s+'/'+tvalue+'/ '+$!.to_s\n\t\t\tres= setResCritical( msg)\n\t\tend\n\t\treturnRes (res )\n\tend",
"def sort\n aisles = @store.aisles\n aisles.each do |aisle|\n aisle.position = params['aisle'].index(aisle.id.to_s) + 1\n aisle.save!\n end\n render nothing: true\n end",
"def sortable(*columns, validate: true)\n columns.each { |column| validate_column(column, validate) }\n sortable_columns.concat(columns.map(&:to_s))\n end"
] | [
"0.69781756",
"0.670934",
"0.66613495",
"0.6188665",
"0.61590856",
"0.61583745",
"0.60426706",
"0.5957023",
"0.581892",
"0.57525957",
"0.5735824",
"0.56466484",
"0.5603152",
"0.5530853",
"0.54576087",
"0.5410814",
"0.53945756",
"0.53719366",
"0.53404105",
"0.5326266",
"0.53053004",
"0.52511847",
"0.52505594",
"0.5239218",
"0.52158225",
"0.5194133",
"0.51925015",
"0.51915735",
"0.51611537",
"0.5157158",
"0.5149691",
"0.50927603",
"0.50736904",
"0.5072927",
"0.505451",
"0.5048973",
"0.5034558",
"0.5033033",
"0.50232077",
"0.5000938",
"0.49984735",
"0.49956715",
"0.49837077",
"0.49765578",
"0.49751076",
"0.4968928",
"0.49687195",
"0.49658433",
"0.49651352",
"0.49606594",
"0.49580744",
"0.49518055",
"0.4944451",
"0.49389708",
"0.49338898",
"0.4917115",
"0.49169326",
"0.49127144",
"0.4891478",
"0.4890759",
"0.48873547",
"0.48861298",
"0.48794544",
"0.48697808",
"0.4858905",
"0.48583704",
"0.4854846",
"0.48501936",
"0.48466522",
"0.4844274",
"0.48217368",
"0.48160583",
"0.4813584",
"0.48004863",
"0.47976536",
"0.47966912",
"0.4784051",
"0.47833762",
"0.47810248",
"0.47726986",
"0.47689545",
"0.47682965",
"0.47669417",
"0.47575435",
"0.47522527",
"0.47518417",
"0.47463405",
"0.4745925",
"0.47366542",
"0.47363344",
"0.47363344",
"0.4732988",
"0.4727198",
"0.4725869",
"0.47199938",
"0.4714202",
"0.47105595",
"0.47083127",
"0.4706423",
"0.47028124",
"0.4692807"
] | 0.0 | -1 |
Return a pointer to the first form element in libcurl. | def first
@first ||= FFI::MemoryPointer.new(:pointer)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parseTarget(url)\n response = Nokogiri::HTML(RestClient.get(url))\n\n forms = response.css('form')\n puts \"there are #{forms.length} forms\"\n forms_attributes = []\n forms.each_with_index do |el, index|\n puts\n forms_attributes[index] = el.to_s.split('>')[0]\n puts \" #{index.to_s.ljust(5)}#{forms_attributes[index]}\"\n end\n puts \" \"\n choice = ask(\"Which form do you want to bruteforce ?\")\n \n return forms[choice.to_i]\nend",
"def parse_web_form_request\n if !params[:file].blank?\n return [params[:file], 'file']\n elsif !params[:freetext].blank?\n return [params[:freetext], 'text']\n elsif !params[:url].blank?\n return [params[:url], 'url']\n elsif !params[:example_url].blank?\n return [params[:example_url], 'url']\n end \nend",
"def form_url\n URL\n end",
"def parse_gdoc_url_for_key(url)\n u = URI.parse(url)\n \n key = CGI.parse(u.query)['key'][0]\n end",
"def initialize\n @agent = Mechanize.new\n @page = @agent.get(@@url)\n @form = @page.forms.first\n end",
"def find_first_image_uploader\n matches = self.body.match(/#{IMAGE_UPLOADER_SIGNATURE}(\\d+)/)\n return nil unless matches.present?\n\n first_page_image_id = matches.captures.first\n return nil unless first_page_image_id.present?\n\n return Redactor3Rails::Image.find_by_id(first_page_image_id)&.data\n end",
"def first\n contents[0]\n end",
"def find_first(selector, data)\n data = @data unless data\n results = (data/selector)\n if results and results.first\n results.first.inner_html.strip\n else\n nil\n end\n end",
"def get_link_to_first_bracket page\n link = page.links.first \n end",
"def getForm(entry)\n\t\t# split the user input by ||\n\t\tpieces = entry.split(\"||\")\n\t\tfrm = pieces[0]\n\t\tfrm = frm.to_i\n\t\t\n\t\t# get form name from array\n\t\tif(frm < @@allForms.length)\n\t\t\t@@form_index = frm\n\t\t\tfrm = @@allForms[frm][\"frm\"]\n\t\telse\n\t\t\tfrm = \"N/A\"\n\t\tend\n\t\t\n\t\t# return form name\n\t\treturn frm\n\tend",
"def getFirstMatch page\n list = page.search('.findList')\n return nil if list.empty?\n return list.search('.findResult')[0].search('.result_text').children[1].attr('href')\nend",
"def get_first\r\n return @head ? @head.data : nil\r\n end",
"def get_first\n return head ? head.data : nil\n end",
"def first(c)\n if c and c.class == String\n return c\n elsif c and c.length > 0 \n return c[0]\n else\n return nil\n end\nend",
"def get_first\n return nil if @head.nil?\n return @head.data\n end",
"def get_first\n return @head ? @head.data : nil\n end",
"def get_first\n return nil if @head.nil?\n\n return @head.data\n end",
"def get_first\n return nil if @head.nil?\n\n return @head.data\n end",
"def first\n return nil unless first_page_uri\n perform_request(first_page_uri)\n end",
"def form_search(url, html)\n\n forms = []\n html.css('form').each do |form|\n\n action = form.attr('action')\n\n action = url if action.nil?\n\n # prefix relative base url if no protocol\n unless action =~ /^https?:\\/\\//i\n uri = URI.parse(action)\n\n if action =~ /^\\//\n # absolute path\n src = \"#{uri.scheme}://#{uri.host}#{action}\"\n else\n # relative path\n src = \"#{url}/#{action}\"\n end \n\n end\n\n\n data = { \n method: (form.attr('method') || 'post').downcase, \n action: action,\n params: form.css('*[name]').map do |i| \n { \n name: i.attr('name'), \n value: i.attr('value')\n }\n end\n }\n\n forms << data\n\n # case data[:method]\n # when 'get'\n # puts RestClient.get(form[:action])\n # when 'post'\n # puts RestClient.post(form[:action], form[:params])\n # when 'put'\n # else \n # # do nothing\n # end\n\n # end\n\n end\n\n forms\n\n end",
"def fb_request_form_submit\n tag \"fb:request-form-submit\"\n end",
"def canonical_form_object\n CanonicalForm.find(entry.name.canonical_form_id) # Yuck. But true.\n end",
"def first_page\n @links['first']\n end",
"def get_first\r\n if @head \r\n return @head.data\r\n else \r\n return nil\r\n end\r\n end",
"def scrape_and_look_for_next_link(page)\n scrape_table(page.body)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$tab21$GVProcesos'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page)\n end\nend",
"def scrape_and_look_for_next_link(page)\n scrape_table(page.body)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$tab21$GVProcesos'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page)\n end\nend",
"def scrape_and_look_for_next_link(page)\n scrape_table(page.body)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$tab21$GVProcesos'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page)\n end\nend",
"def scrape_and_look_for_next_link(page)\n scrape_table(page.body)\n link = page.link_with(:text => '2')\n if link\n page.form_with(:name => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$tab21$GVProcesos'\n f['__EVENTARGUMENT'] = 'Page$2'\n page = f.submit()\n p page.body\n end\n scrape_and_look_for_next_link(page)\n end\nend",
"def get_first\n if @head == nil\n return nil\n else\n return @head.data\n end\n end",
"def get_first\n return @head.data if @head\n return @head\n end",
"def get_first\n return nil if !@head\n return @head.data\n end",
"def find_contact_form\n @contact_form = @node.content\n end",
"def scrape_and_look_for_next_link(page, request_url, next_page_num)\n while add_position(next_page_num).nil? do\n next_page_num += 1\n end\n \n link = page.link_with(:text => 'Tiếp')\n if link\n got_page = @br.get request_url\n view_state = got_page.forms[0].field_with(:name => \"__VIEWSTATE\").value\n \n page.form_with(:id => 'aspnetForm') do |f|\n f['__EVENTTARGET'] = 'ctl00$ContentPlaceHolder1$ucPaging$lkbNext'\n f['__EVENTARGUMENT'] = ''\n f['__LASTFOCUS'] = ''\n f['__VIEWSTATE'] = view_state\n f['viet_method'] = 'on'\n f['ctl00$Header$ucSearch$txtSearch'] = 'Tìm địa điểm, thông tin khuyến mãi, hàng giảm giá...'\n f['ctl00$ContentPlaceHolder1$hdfPage'] = next_page_num\n # I learned that I don't need to include some of the above but the coder of the site I am scraping\n # ask for stuff that he doesn't need when submitting the form,\n # it will return an empty page if not most of them are submitted\n # so I just leave them here\n f['ctl00$ContentPlaceHolder1$hdfKey'] = ''\n f['ctl00$ContentPlaceHolder1$hdfKey1'] = ''\n f['ctl00$ContentPlaceHolder1$hdfLocation'] = -1\n f['ctl00$ContentPlaceHolder1$hdf_usseachResult'] = 0\n f['ctl00$ucPopUpThank$dlstThanks$ctl00$RadbThank'] = 1\n f['ctl00$ucPopUpThank$hdfThankID'] = 1\n f['ctl00$ucPopUpThank$ucPopUpThank$hdfText'] = ''\n f['ctl00$ucPopUpThank$txtMessage'] = ''\n f['ctl00$hdfFreUserID'] = ''\n f['ctl00$hdfThankForPU'] = ''\n f['ctl00$hdfIDTemplate'] = ''\n page = f.submit()\n end\n scrape_table(page.body)\n scrape_and_look_for_next_link(page, request_url, next_page_num + 1)\n end\nend",
"def get_first\n return nil if head.nil?\n return head.data\n end",
"def get_first\n \n return nil if @head.nil?\n return @head.data\n \n end",
"def get_first\n return @head if @head.nil?\n\n return @head.data\n end",
"def first_textfield\n xpath 'textfield'\n end",
"def first_part\n self.parsed_page ||= @connect.page self.name\n self.parsed_page.search(\"p\").first.children.first\n end",
"def first_submission\n as = as.parent\n end",
"def get_first\n return @head.nil? ? nil : @head.data\n end",
"def get_first\n return @head.nil? ? nil : @head.data\n end",
"def get_first\n @head.nil? ? nil : @head.data\n end",
"def next_form\n json_form.next_form(parsed_json['id'])\n end",
"def get_first\n current = @head\n return nil if current.nil?\n \n return @head.data\n end",
"def get_first\n @head == nil ? nil : @head.data\n end",
"def form_fragment\n parsed_json\n end",
"def get_first\r\n @head&.data\r\n end",
"def first(string)\n return string[0]\nend",
"def get_first\r\n # if the list is empty, head is nil\r\n if @head.nil?\r\n return nil\r\n else \r\n value = @head.data\r\n return value\r\n end\r\n end",
"def get_next_url\n while true\n unless url = dequeue_url()\n # there are currently no further URLs in the queue\n return nil\n end\n\n unless http_url = HttpUrl.parse(url)\n log_error :invalid_url, url.inspect \n next\n end\n\n if has_file?(http_url.to_filename) \n log :skip_url__already_fetched, url.inspect\n next\n end\n\n return http_url\n end # while\n end",
"def first_textfield\n js = textfield_js 'r = r.length > 0 ? $(r[0]) : r;'\n execute_script(js).first\n end",
"def query \n first_element('query')\n end",
"def find_login_form\n @login_sequence.each do |r|\n form = find_login_form_from_request( r )\n return form if form\n end\n nil\n end",
"def test_submit_on_form\n page = @agent.get(\"http://localhost/form_multival.html\")\n form = page.form_with(:name => 'post_form')\n\n assert_not_nil(form)\n assert_equal(2, form.fields_with(:name => 'first').length)\n\n form.fields_with(:name => 'first')[0].value = 'Aaron'\n form.fields_with(:name => 'first')[1].value = 'Patterson'\n\n page = form.submit\n\n assert_not_nil(page)\n\n assert_equal(2, page.links.length)\n assert_not_nil(page.link_with(:text => 'first:Aaron'))\n assert_not_nil(page.link_with(:text => 'first:Patterson'))\n end",
"def first\n @elements.empty? ? nil : @elements[0]\n end",
"def peek_first\n raise 'No such element' if @size == 0\n @head.value\n end",
"def onSubmit(request, response, form, errors)\r\n\treturn form\r\n end",
"def submit!\n# NSString.stringWithContentsOfURL(url)\n return \"FOOO\"\n end",
"def access_url_first_filtered(record)\n if record['url_access_json'].present? && record[\"url_access_json\"].first.present?\n url_access = JSON.parse(record['url_access_json'].first)\n if url_access['url'].present?\n access_url = url_access['url']\n access_url.sub!('http://proxy.library.cornell.edu/login?url=','')\n access_url.sub!('https://proxy.library.cornell.edu/login?url=','')\n return access_url\n end\n end\n nil\n end",
"def first\n matches.first\n end",
"def form_tag(url_for_options = T.unsafe(nil), options = T.unsafe(nil), &block); end",
"def first\n @first ||= VcfGenotypeField.new(@fields[9],format,@header,ref,alt)\n end",
"def first_reference_paper\n reference_papers[0]\n end",
"def first\n # Modify the @next url to set the :limit to 1\n original_next = @next\n @next = @path\n fetch_next!(@options.merge(params: @options.fetch(:params, {}).merge({ limit: 1 })))\n # Restore the @next url to the original\n @next = original_next\n @data.first\n end",
"def get_next_element(subset, fp)\n fq = nil\n \n idx = subset.index(fp) \n if idx and idx < subset.size-1\n fq = subset[idx+1]\n end\n \n fq\n end",
"def first_textfield\n ele_by_json _textfield_visible\n end",
"def get_pages (page, form, event_target)\n link = page.links_with(:class => 'rgCurrentPage')[0]\n /(ctl00[^']+)/.match(link.href).each do |another_page|\n form.add_field!('__EVENTTARGET', another_page)\n form.add_field!('__EVENTARGUMENT', '')\n yield form.submit\n end\nend",
"def form\n find_parent_by_tag_name('FORM')\n end",
"def form\n find_parent_by_tag_name('FORM')\n end",
"def get_form(slug, options = nil)\r\n @client.raw('get', \"/content/forms/#{slug}\", options)\r\n end",
"def form_node; end",
"def onSubmit(request, response, form, errors)\r\n return form\r\n end",
"def onSubmit(request, response, form, errors)\r\n return form\r\n end",
"def get_first_link(content)\n \n #Remove curly braces\n while content =~ /\\{\\{[^\\{\\\\}]+?\\}\\}/\n\t content.gsub!(/\\{\\{[^\\{\\}]+?\\}\\}/,'')\n end\n #remove info box\n content.sub!(/^\\{\\|[^\\{\\}]+?\\n\\|\\}\\n/,'')\n #remove anything in parens\n #content.gsub!(/\\(.*\\)/,'')\n content.gsub!(/(\\(.*\\))(?=^(?:(?!\\[\\])))/,'')\n #remove bold and italicized text\n content.gsub!(/'''''(.+?)'''''/,'')\n #remove italic text\n content.gsub!(/''(.+?)''/,'')\n #remove images and file links\n content.gsub!(/\\[\\[Image:.*?\\]\\]/,'')\n content.gsub!(/\\[\\[File:.*?\\]\\]/,'')\n content.gsub!(/\\[\\[image:.*?\\]\\]/,'')\n content.gsub!(/\\[\\[file:.*?\\]\\]/,'')\n #remove any link with colons in it\n #content.gsub!(/\\[\\[.*?:.*?\\]\\]/,'')\n #gets the first link\n content = content.slice(/\\[\\[.*?\\]\\]/)\n #replaces spaces with underscores (for correct resolving of links)\n content.gsub!(\" \",'_')\n #removes the trailing description (for correct resolving of links)\n content = content.gsub(/\\|.*?\\]\\]/,']]')\n return content\n end",
"def first\n perform_request(first_page_uri) if first_page_uri\n end",
"def getFormIndexFromAction( formAction )\n i = 0\n @ie.document.forms.each do |f|\n return i if f.action.to_s == formAction\n i+=1\n end\n return nil\n end",
"def pdf_item\n pdf = self.items.collect { |i| i if i.url.include?('docs.google.com') }\n pdf.first\n end",
"def first_citation_paper\n citation_papers[0]\n end",
"def get_protocol(url)\n url_partitioned_at_colon = url.partition(\":\")\n url_partitioned_at_colon[0]\nend",
"def curl_form_data(uri, form_data=[], options={})\n curl = Pkg::Util::Tool.find_tool(\"curl\") or fail \"Couldn't find curl. Curl is required for posting jenkins to trigger a build. Please install curl and try again.\"\n #\n # Begin constructing the post string.\n # First, assemble the form_data arguments\n #\n post_string = \"-i \"\n form_data.each do |param|\n post_string << \"#{param} \"\n end\n\n # Add the uri\n post_string << \"#{uri}\"\n\n # If this is quiet, we're going to silence all output\n if options[:quiet]\n post_string << \" >/dev/null 2>&1\"\n end\n\n %x{#{curl} #{post_string}}\n return $?.success?\nend",
"def peek\n raise IndexError.new if @data.size == 0\n return @data[0]\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def first_ele tag_name\n # XPath index starts at 1\n find_element :xpath, \"//#{tag_name}[1]\"\n end",
"def get_form_start_id(form_name)\n get_form(form_name)[:start_id]\n end",
"def xpath_first(doc, path, pnamespace = '')\n elements = xpath_all(doc, path, pnamespace)\n (elements != nil) ? elements[0] : nil\n end",
"def parseForm(form)\n # I'm using the format \"name value\" to be able to use the set_options method\n url = Array[\"\", \"url\", form[\"action\"]]\n method = Array[\"\", \"method\", form[\"method\"]]\n hidden_inputs = form.css(\"input[type='hidden']\")\n password_input = form.xpath(\"//input[@type='password']/@name\")\n\n # get the login input\n visible_inputs = form.css(\"input[type!='hidden']\")\n login_input = \"\"\n visible_inputs.each do |el|\n if el.to_s =~ /(login)|(email)|(username)|(user)/i\n login_input = el\n puts \"the login input est : #{el}\"\n break\n end\n end\n\n # create the string with all the hidden parameters\n body = \"\"\n hidden_inputs.each do |el|\n body = body + el[\"name\"] + \"=\" + el[\"value\"] + \"&\"\n end\n\n body = \"#{body}\" + \"#{login_input[\"name\"]}\" + \"=FILE0&\" + \"#{password_input}\" + \"=FILE1\"\n\n # add the question mark if get request\n if method == \"get\"\n body = \"?#{body}\"\n end\n body = Array[\"\", \"body\", body]\n\n\n # write the values in the json object \n options = JSON.parse(get_options(\"http_module\"))\n\n set_options(options, url)\n set_options(options, method)\n set_options(options, body)\nend",
"def onSubmit(request, response, form, errors) \n return form\n end",
"def search_for_first_image(doc)\n @first_image = doc.css('img')\n .map { |i| i.attribute('src') }\n .compact\n .map(&method(:absolutize_url))\n .first\n end",
"def first\r\n self[0]\r\n end",
"def parse_request(url)\n return Crack::XML.parse(open(url).read)\n end",
"def form_request(client)\n # read and tokenize the first line\n # we want to parse this line to retrieve the port, hostname, version, and filename\n first_line_tokens = client.gets.split\n\n # read the headers and store them in a hash\n header_hash = Hash.new()\n \n while next_line = client.gets do\n break if next_line.eql?(\"\\r\\n\") \n # we expect this line to be of the form (header): (header value)\n first_colon_index = next_line.index(\":\")\n unless first_colon_index.nil?\n header_hash[next_line[0..first_colon_index-1]] = next_line[first_colon_index+1..next_line.length - 1]\n end\n end\n\n #populate our metadata with temporary values\n port = 80\n version = \"\"\n filename = \"/\"\n request_type = first_line_tokens[0]\n \n if (!first_line_tokens[0].eql?(\"GET\") && !first_line_tokens[0].eql?(\"POST\"))\n # then this is not a GET or POST request, and we return nil\n return nil\n else\n # then this is a GET or POST request, and we will parse out the\n # port, hostname, version, and filename associated with this request\n\n # the rest of our attributes can be parsed from the second token, and\n # the token should be of the form: http://(hostname)(:port)/(filename)\n # or of the form: /(filename)\n url = first_line_tokens[1]\n # ignore the prefix\n url = url.split(\"//\")[1]\n\n # now, extract the hostname and port\n first_slash_index = url.index(\"/\")\n first_colon_index = url.index(\":\")\n if first_colon_index.nil? || first_colon_index>first_slash_index\n # then the port was not specified. Default to 80\n port = 80\n # then the hostname is the substring up to the first slash, or it\n # is instead specified in a header\n if first_slash_index > 0\n header_hash[\"Host\"] = url[0..first_slash_index-1]\n end\n else first_colon_index<first_slash_index\n # then the port is specified\n port = url[first_colon_index+1..first_slash_index-1]\n header_hash[\"Host\"] = url[0..first_colon_index-1]\n end\n \n # extract the filename from the url\n filename = url[first_slash_index..url.length-1]\n end\n return Request.new(header_hash[\"Host\"], port, filename, url, header_hash, request_type)\nend",
"def parse_params(url)\n CGI::parse(url.split('?')[-1])\n end",
"def test_get_multival\n page = @agent.get(\"http://localhost/form_multival.html\")\n form = page.form_with(:name => 'get_form')\n\n assert_not_nil(form)\n assert_equal(2, form.fields_with(:name => 'first').length)\n\n form.fields_with(:name => 'first')[0].value = 'Aaron'\n form.fields_with(:name => 'first')[1].value = 'Patterson'\n\n page = @agent.submit(form)\n\n assert_not_nil(page)\n\n assert_equal(2, page.links.length)\n assert_not_nil(page.link_with(:text => 'first:Aaron'))\n assert_not_nil(page.link_with(:text => 'first:Patterson'))\n end",
"def contact_link\n begin\n require 'open-uri'\n require 'hpricot'\n api_url = \"http://www.api.sunlightlabs.com/people.getDataCondition.php?BioGuide_ID=#{bioguideid}&output=xml\"\n response = Hpricot.XML(open(api_url))\n entry = (response/:entity_id).first.inner_html\n api_person_url = \"http://api.sunlightlabs.com/people.getDataItem.php?id=#{entry}&code=webform&output=xml\"\n person_response = Hpricot.XML(open(api_person_url))\n webform = (person_response/:webform).first.inner_html\n return webform \n catch Exception\n return false\n end\n end",
"def first\n @head\n end",
"def first\n self[0]\n end",
"def peek()\n @q.first\n end",
"def first\n self[0]\n end"
] | [
"0.5553469",
"0.5488442",
"0.5430206",
"0.5314752",
"0.5271995",
"0.52333486",
"0.5200609",
"0.5145032",
"0.51377267",
"0.51080287",
"0.5100265",
"0.5035936",
"0.50172025",
"0.50081843",
"0.49990615",
"0.4996669",
"0.4993031",
"0.4993031",
"0.49808604",
"0.49773577",
"0.497696",
"0.49712336",
"0.496495",
"0.49623176",
"0.49528092",
"0.49528092",
"0.4952288",
"0.4952288",
"0.49471647",
"0.4920939",
"0.49128258",
"0.4908971",
"0.49019256",
"0.48965016",
"0.48944277",
"0.48934308",
"0.48885718",
"0.48841524",
"0.4883616",
"0.48786527",
"0.48786527",
"0.48507926",
"0.48340192",
"0.48317665",
"0.48033357",
"0.479513",
"0.47855362",
"0.47590333",
"0.47560936",
"0.47527993",
"0.47469848",
"0.47439244",
"0.47421798",
"0.4741778",
"0.47362888",
"0.47139832",
"0.47124225",
"0.4710634",
"0.46950465",
"0.4690292",
"0.46826854",
"0.4681148",
"0.467701",
"0.46569103",
"0.46497118",
"0.4648921",
"0.46368507",
"0.4636283",
"0.4636283",
"0.46272656",
"0.46105394",
"0.46088183",
"0.46088183",
"0.4608563",
"0.46011987",
"0.4593525",
"0.4592234",
"0.45804396",
"0.45759204",
"0.45744178",
"0.45706236",
"0.4567316",
"0.4567316",
"0.4567316",
"0.4567316",
"0.4566762",
"0.45633093",
"0.45608333",
"0.45483494",
"0.45338655",
"0.45278242",
"0.45192525",
"0.4515746",
"0.4509099",
"0.4506815",
"0.45064494",
"0.4503731",
"0.4500166",
"0.44928893",
"0.4489844",
"0.44891784"
] | 0.0 | -1 |
Return a pointer to the last form element in libcurl. | def last
@last ||= FFI::MemoryPointer.new(:pointer)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_form_last_action(form_name)\n get_form(form_name)[:form_last_action]\n end",
"def last_textfield\n xpath 'textfield[last()]'\n end",
"def last_for_value\n self.form_field_value.queries.last\n end",
"def last\n contents[contents.size - 1]\n end",
"def last_textfield\n js = textfield_js 'r = r.length > 0 ? $(r[r.length - 1]) : r;'\n execute_script(js).first\n end",
"def last_page\n @links['last']\n end",
"def last\n empty? ? nil : @anchor.prev_node.value\n end",
"def get_last\n return @tail ? @tail.data : nil\n end",
"def last *a; self.child(*a) + ':last-child' end",
"def last\n out = nil\n\n each {|i| out = i }\n\n out\n end",
"def last() end",
"def last\n perform_request(last_page_uri) if last_page_uri\n end",
"def last\n at(-1)\n end",
"def last\n @routes[-1]\n end",
"def last\r\n self[-1]\r\n end",
"def last\n goto(last_page_index())\n end",
"def last_page(url = onliner_url)\n JSON(Net::HTTP.get(URI(url)))['page']['last']\n #Net::HTTP.get(URI(url)).scan(/\\\"last\\\"\\:\\d{1,}/).to_s.scan(/\\d+/).first.to_i\n end",
"def get_last\n return nil if @head.nil?\n return get_last_helper(@head)\n end",
"def last\n self[-1]\n end",
"def get_last\n return nil if @head.nil? \n pointer = @head\n\n until pointer.next.nil?\n pointer = pointer.next\n end\n return pointer.data\n end",
"def last_textfield\n result = eles_by_json(_textfield_visible).last\n raise _no_such_element if result.nil?\n\n result\n end",
"def last\n self[-1]\n end",
"def peek_last\n raise 'No such element' if @size == 0\n @tail.value\n end",
"def get_last\n return nil if @head.nil? \n pointer = @head \n while !pointer.next.nil?\n pointer = pointer.next\n end\n return pointer.data\n end",
"def last\n end",
"def last; end",
"def last; end",
"def last; end",
"def getLastNode #not counting the sentinel node\n\tunless (@size == 0)\n\t\treturn @last.prev\n\telse\n\t\treturn nil\n\tend\nend",
"def retrieve_last_element_from_array(array)\n array[array.length-1]\nend",
"def last(options={})\n get(\"last\", options)\n end",
"def get_last\n return nil if @head.nil?\n current = @head\n until current.next.nil?\n current = current.next\n end\n return current.data\n end",
"def get_last\n return nil if @head.nil?\n\n current = @head\n\n until current.next.nil?\n current = current.next\n end\n\n return current.data\n end",
"def last\n tail.data\n end",
"def form_url\n URL\n end",
"def last(*input) \n input[-1].is_a?(String) ? input[-1][-1] : input.flatten[-1]\nend",
"def last_ele tag_name\n xpath \"//#{tag_name}[last()]\"\n end",
"def lastElement\n return @stk[@count]\n end",
"def last\n @ordered_elements.last\n end",
"def retrieve_last_element_from_array(array)\n return array[-1]\nend",
"def last_response\n last_request_with_response = requests.reverse.detect do |r|\n r.response\n end\n return nil unless last_request_with_response\n\n last_request_with_response.response\n end",
"def get_last\n if length == 0\n return nil?\n elsif length == 1\n return @head.data\n else\n current = @head\n (length - 1).times do\n current = current.next\n end\n return current.data\n end\n end",
"def last\n @tail\n end",
"def get_last\n return if @head == nil\n\n current = @head\n\n until current.next.nil?\n current = current.next\n end\n\n return current.data\n end",
"def last\n @tail.val\n end",
"def get_last\n # return nil unless @head\n if @head == nil\n return nil\n end\n current = @head\n while !current.next.nil?\n current = current.next\n end\n \n return current.data\n end",
"def last\n \tbegin\n \t raise ArgumentError, \"Empty LinkedList\" if @size <= 0\n \t return @last.prev.data\n \t rescue\n \t puts \"Empty\" \t\t \n\t\t end\n \tend",
"def lastof(arr)\n return arr[arr.length - 1]\nend",
"def get_last\r\n return unless @head\r\n \r\n last = @head\r\n last = last.next until last.next.nil?\r\n last.data\r\n end",
"def get_last\n # return nil unless @head\n if @head == nil\n return nil\n end\n current = @head\n while current.next != nil \n current = current.next\n end\n return current.data\n end",
"def last_textfield\n result = _textfields_with_predicate.last\n raise _no_such_element if result.nil?\n\n result\n end",
"def last_of(arr)\n output = arr[-1]\n return output\nend",
"def last_of(array)\n return array[array.length - 1]\nend",
"def last_of(array)\n return array[array.length - 1]\nend",
"def last_of(array)\n return array[-1]\nend",
"def get_last\r\n return nil unless @head\r\n cursor = @head\r\n while cursor.next\r\n cursor = cursor.next\r\n end\r\n return cursor.data\r\n end",
"def last\n self.slice(self.size - 1)\n end",
"def last?; end",
"def get_last\n return nil unless @head\n current = @head\n\n while current.next\n current = current.next\n end\n\n return current.data\n end",
"def get_last\n return nil if @head.nil?\n return last_node.data\n end",
"def last_step_page\n history.values.last\n end",
"def last\n\t\t@last.content\n\tend",
"def parseTarget(url)\n response = Nokogiri::HTML(RestClient.get(url))\n\n forms = response.css('form')\n puts \"there are #{forms.length} forms\"\n forms_attributes = []\n forms.each_with_index do |el, index|\n puts\n forms_attributes[index] = el.to_s.split('>')[0]\n puts \" #{index.to_s.ljust(5)}#{forms_attributes[index]}\"\n end\n puts \" \"\n choice = ask(\"Which form do you want to bruteforce ?\")\n \n return forms[choice.to_i]\nend",
"def form_end\n ''\n end",
"def get_last\n return nil if !@head\n current = @head\n while current.next\n current = current.next\n end\n return current.data\n end",
"def last\n all[all.size - 1]\n end",
"def last_of(arr)\n return arr[arr.length-1]\nend",
"def last(list)\n list[-1]\nend",
"def last\n\t\t\t@last\n\t\tend",
"def last_request\n raise Error, 'No request yet. Request a page first.' unless @last_request\n @last_request\n end",
"def lastElement(arr)\n return arr[arr.length - 1]\nend",
"def last_of(arr)\n index = arr.length\n return arr[index -1]\nend",
"def last\n trailer_data\n end",
"def getFinalUrl(url)\n return Net::HTTP.get_response(URI(url))['location']\nend",
"def last_http_response\n @http_response\n end",
"def get_last_page\n query = URI.parse(request.referrer).query\n @last_page = query.nil? ? 0 : CGI.parse(query)[\"page\"].first.to_i\n end",
"def tail(input)\n input[1..-1]\n end",
"def last(array)\n array[-1]\nend",
"def last_element(array)\n array[-1]\nend",
"def get_last_item(arr)\n\treturn arr[-1]\nend",
"def retrieve_last_element_from_array(array)\n array.last\nend",
"def using_last(array)\narray.last\nend",
"def last(*vars)\n result = Query.get params(:from => count-1, :size => 1), *vars\n docs = result.get_docs\n docs.is_a?(Array) ? docs.first : docs\n end",
"def previous_form\n json_form.previous_form(parsed_json['id'])\n end",
"def get_last\r\n # return nil if the linked list is empty\r\n if @head.nil?\r\n return nil\r\n end\r\n \r\n # otherwise, go to end of list ...\r\n current = @head\r\n until current.next.nil?\r\n # ... until 'current' is the last node ...\r\n current = current.next\r\n end\r\n \r\n # ... and return data from last node\r\n return current.data\r\n \r\n end",
"def using_last(array)\n array.last\n# returns last item in array \nend",
"def last_uri\n session[:last_path]\n end",
"def last\n to_a.last\n end",
"def last_element(array)\n taylor_swift = [\"Welcome to New York\", \"Blank Space\", \"Style\", \"Out of The Woods\"]\n taylor_swift[-1]\n end",
"def last_of(arr)\n return arr[-1]\nend",
"def last_ele(class_name)\n ele_index class_name, 'last()'\n end",
"def last_ele(class_name)\n ele_index class_name, 'last()'\n end",
"def last\n return each\n end",
"def get_last_request\n\t\tsearch = {phrase: \"\", thumbnail: nil}\n\t\tsearch = searched.pop if @searched != []\n\t\tsearch\n\tend",
"def last_output\n return @output_array[-1]\n end",
"def last_output\n return @output_array[-1]\n end",
"def last_output\n return @output_array[-1]\n end",
"def last_output\n return @output_array[-1]\n end",
"def last\n list.first\n end"
] | [
"0.6217018",
"0.59610254",
"0.58965826",
"0.57708776",
"0.5703214",
"0.5579",
"0.55638975",
"0.5538263",
"0.5533082",
"0.5450115",
"0.5422348",
"0.5418438",
"0.54183555",
"0.5414606",
"0.5413244",
"0.541307",
"0.5410266",
"0.5409679",
"0.54065907",
"0.5404854",
"0.5389307",
"0.5388249",
"0.53808427",
"0.5330397",
"0.5318749",
"0.53151387",
"0.53151387",
"0.53151387",
"0.5308595",
"0.5296632",
"0.52802426",
"0.52795625",
"0.5265126",
"0.5254001",
"0.5242597",
"0.52349883",
"0.521526",
"0.5204598",
"0.5200351",
"0.5197609",
"0.5197022",
"0.51887006",
"0.5181673",
"0.5179573",
"0.5175075",
"0.5163474",
"0.516242",
"0.51571035",
"0.5151087",
"0.513494",
"0.5127969",
"0.51275283",
"0.51198846",
"0.51198846",
"0.51193523",
"0.5110789",
"0.5108924",
"0.51023966",
"0.5097001",
"0.50918597",
"0.508997",
"0.50895065",
"0.5088684",
"0.5085311",
"0.50849235",
"0.507921",
"0.50784993",
"0.5076811",
"0.50618327",
"0.50569564",
"0.5045498",
"0.5040518",
"0.50370204",
"0.50331265",
"0.50306034",
"0.5027891",
"0.50177336",
"0.50151503",
"0.501505",
"0.5013676",
"0.5006826",
"0.4994543",
"0.49895442",
"0.49889803",
"0.49888185",
"0.49873537",
"0.4980535",
"0.49777308",
"0.49767262",
"0.49762762",
"0.4974731",
"0.4974731",
"0.4974048",
"0.49702972",
"0.49694884",
"0.49694884",
"0.49694884",
"0.49694884",
"0.49650037"
] | 0.51422817 | 50 |
Return if form is multipart. The form is multipart when it contains a file or multipart option is set on the form during creation. | def multipart?
return true if @multipart
query_pairs.any?{|pair| pair.respond_to?(:last) && pair.last.is_a?(Array)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multipart?\n @multipart\n end",
"def multipart?\n @multipart\n end",
"def multipart?\n false\n end",
"def multipart?\n message.multipart?\n end",
"def multipart?\n has_content_type? ? !!(main_type =~ /^multipart$/i) : false\n end",
"def multipart?\n\t true\n\tend",
"def multipart?\n http.headers[\"content-type\"] =~ /^multipart/\n end",
"def multipart?\n true unless parts.empty?\n end",
"def has_multipart?(obj); end",
"def multipart?; end",
"def first_multipart_form_part?(form, part)\n self.multipart_forms[form][:parts].first == part\n end",
"def multipart!\n @multipart_form = true\n end",
"def enctype_multipart\n enctype('multipart/form-data')\n end",
"def multipart_form_action?(sym)\n self.multipart_forms.keys.include?(sym)\n end",
"def last_multipart_form_part?(form, part)\n self.multipart_forms[form][:parts].last == part\n end",
"def multipart_report?\n multipart? && sub_type =~ /^report$/i\n end",
"def form?\n self.type == :form\n end",
"def multipart_content_type(env)\n requested_content_type = env['CONTENT_TYPE']\n if requested_content_type.start_with?('multipart/')\n requested_content_type\n else\n 'multipart/form-data'\n end\n end",
"def multipart?\n query_pairs.any?{|pair| pair.respond_to?(:last) && pair.last.is_a?(Array)}\n end",
"def can_upload?\n klass.model_class && mime_types && mime_types.keys.include?(file_mime_type)\n end",
"def ensure_upload_is_file\n return if params.require(:file).respond_to?(:tempfile)\n\n render(\n json: {\n errors: ['\"file\" was not a valid multipart/form-data file'],\n error_keys: [:not_multipart_form_data]\n },\n status: 422\n )\n end",
"def ensure_upload_is_file\n return if params.require(:file).respond_to?(:tempfile)\n\n render(\n json: {\n errors: ['\"file\" was not a valid multipart/form-data file'],\n error_keys: [:not_multipart_form_data]\n },\n status: 422\n )\n end",
"def accepts_file_upload?\n true\n end",
"def accepts_file_upload?\n true\n end",
"def accepts_file_upload?\n true\n end",
"def accepts_file_upload?\n true\n end",
"def accepts_file_upload?\n true\n end",
"def accepts_file_upload?\n true\n end",
"def failed_multipart_upload? response\n response.request_type == :complete_multipart_upload &&\n extract_error_details(response)\n end",
"def multipart; end",
"def is_uploaded_file?(param)\n if param.respond_to?(:has_key?)\n [:filename, :type, :name, :tempfile, :head].each do |k|\n return false if !param.has_key?(k)\n end\n\n return true\n else\n return false\n end\n end",
"def is_file?\n !file_type.empty?\n end",
"def can_upload?\n false\n end",
"def can_do_multifile_upload?\n modern_browser?(browser) && !browser.ie?(9)\n end",
"def local_file?(file)\n file.is_a?(Tempfile) ||\n file.is_a?(ActionDispatch::Http::UploadedFile) ||\n file.is_a?(Rack::Test::UploadedFile)\n end",
"def in_form attrs = nil\n attrs ||= Hash.new\n attrs.merge!( method: 'POST' ) unless attrs.has_key?(:method)\n attrs.merge!( 'accept-charset' => \"UTF-8\") unless attrs.has_key?('accept-charset')\n if attrs.has_key?( :file ) && attrs.delete(:file) == true\n attrs.merge!(:enctype => 'multipart/form-data')\n end\n html_balise 'form', attrs\n end",
"def validate_upload?\n upload? || review? || published? || unpublished_changes?\n end",
"def has_extraction_form_options\n has_extraction_form = false\n extraction_forms = Study.get_extraction_form_list_array(self.id)\n unless extraction_forms.empty?\n has_extraction_form = true\n end\n return has_extraction_form\n end",
"def multiple_file_submission?(question)\n question.specific.multiple_file_submission\n end",
"def multiple_file_submission?(question)\n question.specific.multiple_file_submission\n end",
"def route_upload?\n request.post? && path.match(%r{^/#{doc}/upload$})\n end",
"def is_image?\n if self.mimetype\n self.mimetype =~ %r(image)\n elsif self.file_upload_content_type\n self.file_upload_content_type =~ %r(image)\n end\n end",
"def file?\n case type\n when T_REGULAR then true\n when T_UNKNOWN then nil\n else false\n end\n end",
"def is_upload?(var)\n self[var.to_sym].is_a?(Array) && self[var.to_sym].all? { |up_hash| up_hash.is_a?(Hash) && up_hash.key?(:name) && up_hash.key?(:name) }\n end",
"def sending_file?\n @_body.is_a?(::Rack::File::Iterator)\n end",
"def file?\n type == :file\n end",
"def attachment_with_upload_method\n if method == \"upload\" && !attachment?\n errors.add(:base, \"Please make sure to upload your prescription.\")\n end\n end",
"def has_standard_copy_form?\n is_standard ? false : respond_to?(:standard_copy_form_id) ? !standard_copy_form_id.nil? : forms.any?(&:standard_copy?)\n end",
"def app_accept_alternate_multipart_related\n sword_accepts.find{|a| a.alternate == \"multipart-related\" }\n end",
"def content_type\n @content_type ||= begin\n if attachment?\n \"multipart/mixed; boundary = #{boundary}\"\n else\n \"text/html\"\n end\n end\nend",
"def image?\n self.file_content_type == 'image/png' || self.file_content_type == 'image/jpeg'\n end",
"def valid_image_format?\n VALID_FILE_MIMETYPES.include? self.filetype\n end",
"def content_type\n return @content_type unless @content_type.blank?\n if has_attachments?\n return \"multipart/mixed\"\n elsif !body(:plain).blank? && !body(:html).blank?\n return \"multipart/alternative\"\n elsif body(:html)\n return \"text/html\"\n else\n return \"text/plain\"\n end\n end",
"def invite_by_file?\n invitation_params.is_a?(Tempfile)\n end",
"def invite_by_file?\n invitation_params.is_a?(Tempfile)\n end",
"def invite_by_file?\n invitation_params.is_a?(Tempfile)\n end",
"def attachments?\n !attachments.empty?\n end",
"def attachments?\n self.primary_attachment.file? || self.secondary_attachment.file?\n end",
"def image_upload_allowed?\n company = sender.company\n !!company.settings.recognition_editor_settings[:allow_uploading_images]\n end",
"def has_file_format?\n @file_format\n end",
"def file?\n self.file.file?\n end",
"def body_allowed?\n @status.allows_body? && @request_method.allows_body?\n end",
"def boundary\n return unless multipart?\n @boundary ||= Mail::Field.new(\"content-type\", http.headers[\"content-type\"]).parameters['boundary']\n end",
"def image_file?\n false\n end",
"def attachment?\n attachment.present? && attachment.readable?\n end",
"def validate_content_type!\n if request.headers['Content-Type'] =~ /multipart\\/form-data/\n head 406 unless request.headers['Content-Length'].present? &&\n request.headers['Accept'] === 'application/json'\n else\n head 406 unless request.headers['Accept'] === 'application/json'\n end\n end",
"def supported_format?\n !(@file_set.mime_type & self.class.supported_formats).empty?\n end",
"def valid_body?\n request.feedback.body && valid_json?(request.feedback.body)\n end",
"def image?\n file_type.match(/\\Aimage\\//).present?\n end",
"def multi_submit?\n if self.category.accepts_multiple_submissions == true\n return true\n else\n return false\n end\n end",
"def file?\n original_filename.present?\n end",
"def multipart_upload\n end",
"def has_attachments\n preneed_attachments.present?\n end",
"def fails_required?\n if question.required\n if question.supports_uploads?\n uploaded_file.blank?\n else\n answer.blank?\n end\n end\n end",
"def has_photo?\n send('file_uploader_url').present?\n end",
"def is_mime_type? m\n MIME::Type.new m rescue false\n end",
"def is_mime_type? m\n MIME::Type.new m rescue false\n end",
"def find_or_initialize_multipart_in_progress_form(form_name, form_subject)\n # find or create the in progress form\n # not sure why the polymorphic relationship isn't working here\n in_progress_form = MultipartForm::InProgressForm.where(\n :form_subject_id => form_subject.id, \n :form_subject_type => form_subject.class.to_s, \n :form_name => form_name.to_s).first\n\n # if the form subject is a new_record, in_progress_form should be nil\n # trying to stop weird edge cases from killing me (JH 5-15-2012)\n if form_subject.new_record? || !in_progress_form\n in_progress_form = MultipartForm::InProgressForm.new(\n :form_subject_id => form_subject.id, \n :form_subject_type => form_subject.class.to_s, \n :form_name => form_name.to_s, \n :last_completed_step => \"none\", \n :completed => false)\n end\n return in_progress_form\n end",
"def file?\n !@file.nil?\n end",
"def valid_file\n\n filename = self.file.original_filename\n content_type = self.file.content_type\n\n #The upload should be nonempty.\n if filename == nil\n errors.add_to_base(\"Please enter an image filename\")\n return false\n end\n\n #The upload should have file suffix\n unless filename =~ /\\.(jpg)|(jpeg)|(png)|(gif)$/i\n errors.add_to_base(\"Please use image file with a filename suffix\")\n return false\n end\n\n #The file should be an image file.\n unless content_type =~ /^image/\n errors.add(:content_type, \"is not a recognized format\")\n return false\n end\n return true\n end",
"def valid_file\n\n filename = self.file.original_filename\n content_type = self.file.content_type\n\n #The upload should be nonempty.\n if filename == nil\n errors.add(:base, \"Please enter an image filename\")\n return false\n end\n\n #The upload should have file suffix.\n unless filename =~ /\\.(jpg)|(jpeg)|(png)|(gif)$/i\n errors.add(:base, \"Please use image file with a filename suffix\")\n return false\n end\n\n #The file should be an image file.\n unless content_type =~ /^image/\n errors.add(:content_type, \"is not a recognized format\")\n return false\n end\n return true\n end",
"def rack_file?(value)\n value.is_a?(Hash) && value.key?(:tempfile) && value.key?(:name)\n end",
"def acceptable_content_type?\n content_type.blank? || Mime::HTML == content_type\n end",
"def not_image?(new_file)\n !self.file.content_type.include? 'image'\n end",
"def has_body_as_html?\n if self.content_type == 'application/vnd.ms-word'\n return true\n elsif self.content_type == 'application/pdf'\n return true\n end\n return false\n end",
"def multipart?(column_names)\n return false unless column_names\n column_names.each { |column_name| return true if @scaffold_class.scaffold_column_type(column_name) == :file }\n false\n end",
"def has_attachments?\n !(attachments.nil? || attachments.empty? || attachments[0].empty?)\n end",
"def supported_format?\n !(@file_set.mime_type & self.class.supported_formats).empty? || preservation_file&.original_filename&.first&.downcase&.include?(\".wav\")\n end",
"def renderable?\n !_requires_no_body? &&\n !sending_file? &&\n !ADDITIONAL_HTTP_STATUSES_WITHOUT_BODY.include?(@_status)\n end",
"def is_boundary?(); @type == GRT_BOUNDARY; end",
"def attachment_attributes_valid?\n [:size, :content_type].each do |attr_name|\n enum = attachment_options[attr_name]\n errors.add attr_name, ActiveRecord::Errors.default_error_messages[:inclusion] unless enum.nil? or enum.include?(send(attr_name))\n end\n end",
"def validate\n if filename.nil?\n errors.add_to_base(\"You must choose a file to upload\")\n else\n # Images should only be GIF, JPEG, or PNG\n enum = attachment_options[:content_type]\n unless enum.nil? || enum.include?(send(:content_type))\n errors.add_to_base(\"You can only upload images (GIF, JPEG, or PNG)\")\n end\n # Images should be less than UPLOAD_LIMIT MB.\n enum = attachment_options[:size]\n unless enum.nil? || enum.include?(send(:size))\n msg = \"Images should be smaller than #{UPLOAD_LIMIT} MB\"\n errors.add_to_base(msg)\n end\n end\n end",
"def has_attachment?\n @has_attachment ||=\n mime_parts(\"text/plain\").any? do |type, fn, id, content|\n fn && (type !~ SIGNATURE_ATTACHMENT_TYPE)\n end\n end",
"def okay_to_modify?\n return false if is_xhr?\n return false unless modifiable_content_type?\n true\n end",
"def image?\n (self.file_content_type =~ %r{^(image|(x-)?application)/(x-png|pjpeg|jpeg|jpg|png|gif)$})\n end",
"def attachment?\n !!find_attachment\n end",
"def multipart_form_handler\n form_name = params[:action].to_sym\n form_subject_id = params[:id]\n\n @form_subject = find_or_initialize_multipart_form_subject(form_name, form_subject_id)\n params[:id] = @form_subject.id\n\n in_progress_form = find_or_initialize_multipart_in_progress_form(form_name, @form_subject)\n\n # set the part based on the params or in progress form\n if params[:multipart_form_part]\n part = params[:multipart_form_part].to_sym\n elsif in_progress_form.last_completed_step != \"none\"\n part = get_next_multipart_form_part(form_name, in_progress_form.last_completed_step.to_sym)\n else\n part = self.multipart_forms[form_name][:parts].first\n end\n\n # call and save the part information\n if(part && self.multipart_forms[form_name][:parts].include?(part.to_sym))\n result = self.send(part)\n \n if(part.match(/_update$/))\n if(result && result[:valid] && params[:commit] != self.stay_string )\n completed = redirect_to_next_multipart_form_part(form_name, @form_subject, part)\n\n # if the form has been completed, set last_completed step to the first part of the form (JH 5-24-2012)\n # the next time the user edits the form, they will go to the first page\n # they should not be automatically redirected to the show page\n saved_step = ( completed ? \"none\" : part )\n\n # added form_subject_id in case it was not set when the in_progress_form was created (JH 5-15-2012)\n # this would happen on a new page, but not an edit page\n in_progress_form.update_attributes({\n :form_subject_id => @form_subject.id, \n :last_completed_step => saved_step,\n :completed => completed })\n else\n # render the previous page but stay on this page so we keep the errors\n part = get_previous_multipart_form_part(form_name, part)\n # actually run the part we just found \n # can't believe we missed this one (JH 3-20-2012)\n self.send(part)\n end\n end\n\n # move forward or backwards 2 parts for the previous and next links on the bredcrumb\n skip_update_part = true\n @breadcrumb_links= {\n :previous => get_previous_multipart_form_part(form_name, part, skip_update_part).to_s,\n :next => get_next_multipart_form_part(form_name, part, skip_update_part).to_s,\n }\n\n # needs to be a string so that the view can read it\n @next_multipart_form_part = get_next_multipart_form_part(form_name, part).to_s\n @multipart_form_part = part.to_s\n @available_multipart_form_parts = get_available_multipart_form_parts(form_name, in_progress_form.last_completed_step)\n @multipart_form_path = (self.multipart_forms[form_name][:form_route] + \"_path\").to_sym\n @multipart_form_complete = in_progress_form.completed\n end\n end",
"def type\n stype = \"file\"\n stype = \"atom\" if @filepath.nil? and !@metadata.empty?\n stype = \"multipart\" if !@filepath.nil? and !@metadata.empty?\n stype\n end",
"def image?\n attachment_content_type =~ %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}\n end",
"def image?(new_file)\n self.file.content_type.include? 'image'\n end"
] | [
"0.8513963",
"0.8513963",
"0.84156984",
"0.8367256",
"0.8340908",
"0.82289857",
"0.8173901",
"0.76845795",
"0.76123595",
"0.75042015",
"0.7301946",
"0.7300103",
"0.70108896",
"0.6890594",
"0.67617697",
"0.66707534",
"0.65567577",
"0.6549531",
"0.6347656",
"0.6291106",
"0.6257212",
"0.6257212",
"0.6192632",
"0.6192632",
"0.6192632",
"0.6192632",
"0.6192632",
"0.6192632",
"0.60914147",
"0.6085831",
"0.594448",
"0.58942693",
"0.58812225",
"0.587058",
"0.58560246",
"0.58545136",
"0.5836258",
"0.58288234",
"0.5805327",
"0.5805327",
"0.57903033",
"0.57362795",
"0.5728464",
"0.56717336",
"0.5662555",
"0.5660868",
"0.56572574",
"0.56496745",
"0.56487674",
"0.56346697",
"0.5622872",
"0.56034666",
"0.5597725",
"0.5570955",
"0.5570955",
"0.5570955",
"0.5565628",
"0.555849",
"0.55549365",
"0.55302083",
"0.5520237",
"0.55076957",
"0.55047965",
"0.5504469",
"0.55013466",
"0.5500599",
"0.54899716",
"0.5466443",
"0.5454734",
"0.54502577",
"0.54355586",
"0.54214793",
"0.5417548",
"0.5412712",
"0.53884006",
"0.5383553",
"0.5383553",
"0.5382174",
"0.5377492",
"0.53751504",
"0.53728783",
"0.536885",
"0.5363235",
"0.53497213",
"0.53451234",
"0.53317225",
"0.532589",
"0.53166366",
"0.5304708",
"0.5281358",
"0.52752715",
"0.5271509",
"0.52697235",
"0.52660054",
"0.5263012",
"0.525759",
"0.52468246",
"0.52448297",
"0.52425724",
"0.52425075"
] | 0.6929337 | 13 |
Add form elements to libcurl. | def materialize
query_pairs.each { |pair| form_add(pair.first.to_s, pair.last) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_form_and_submit(agent, creds, url, category, tech, data)\n case category\n when 'extensions'\n puts \"uploading #{category.chop}: #{data[category.chop].to_s}\" unless $quiet\n cat_page = get_page(agent, creds, url + CONFIG, {display: category, tech_hardware: 'custom_custom'})\n frm = cat_page.form('frm_extensions')\n when 'trunks'\n puts \"uploading #{category.chop}: #{data['trunk_name'].to_s}\" unless $quiet\n cat_page = get_page(agent, creds, url + CONFIG, {display: category, tech: tech.upcase})\n frm = cat_page.form('trunkEdit')\n end\n abort 'error: form not found' unless frm\n\n if $debug\n frm.fields.each { |field| puts \"send_sever_request: #{field.name}: #{field.value}\" }\n frm.checkboxes.each { |chkbx| puts \"send_sever_request: #{chkbx.name}: #{chkbx.value}\" }\n frm.radiobuttons.each { |rdb| puts \"send_sever_request: #{rdb.name}: #{rdb.value}\" if rdb.checked }\n end\n # Fill in the form, and submit it!\n data.each { |key, val| frm[key] = val }\n frm.submit\nend",
"def form_search(url, html)\n\n forms = []\n html.css('form').each do |form|\n\n action = form.attr('action')\n\n action = url if action.nil?\n\n # prefix relative base url if no protocol\n unless action =~ /^https?:\\/\\//i\n uri = URI.parse(action)\n\n if action =~ /^\\//\n # absolute path\n src = \"#{uri.scheme}://#{uri.host}#{action}\"\n else\n # relative path\n src = \"#{url}/#{action}\"\n end \n\n end\n\n\n data = { \n method: (form.attr('method') || 'post').downcase, \n action: action,\n params: form.css('*[name]').map do |i| \n { \n name: i.attr('name'), \n value: i.attr('value')\n }\n end\n }\n\n forms << data\n\n # case data[:method]\n # when 'get'\n # puts RestClient.get(form[:action])\n # when 'post'\n # puts RestClient.post(form[:action], form[:params])\n # when 'put'\n # else \n # # do nothing\n # end\n\n # end\n\n end\n\n forms\n\n end",
"def cl_form_tag(callback_url, options={}, &block)\r\n form_options = options.delete(:form) || {}\r\n form_options[:method] = :post\r\n form_options[:multipart] = true\r\n\r\n params = Cloudinary::Uploader.build_upload_params(options.merge(:callback=>callback_url))\r\n params[:signature] = Cloudinary::Utils.api_sign_request(params, Cloudinary.config.api_secret)\r\n params[:api_key] = Cloudinary.config.api_key\r\n\r\n api_url = Cloudinary::Utils.cloudinary_api_url(\"upload\",\r\n {:resource_type => options.delete(:resource_type), :upload_prefix => options.delete(:upload_prefix)})\r\n\r\n form_tag(api_url, form_options) do\r\n content = []\r\n\r\n params.each do |name, value|\r\n content << hidden_field_tag(name, value, :id => nil) if value.present?\r\n end\r\n\r\n content << capture(&block)\r\n\r\n content.join(\"\\n\").html_safe\r\n end\r\n end",
"def form_tag(url_for_options = T.unsafe(nil), options = T.unsafe(nil), &block); end",
"def curl_form_data(uri, form_data=[], options={})\n curl = Pkg::Util::Tool.find_tool(\"curl\") or fail \"Couldn't find curl. Curl is required for posting jenkins to trigger a build. Please install curl and try again.\"\n #\n # Begin constructing the post string.\n # First, assemble the form_data arguments\n #\n post_string = \"-i \"\n form_data.each do |param|\n post_string << \"#{param} \"\n end\n\n # Add the uri\n post_string << \"#{uri}\"\n\n # If this is quiet, we're going to silence all output\n if options[:quiet]\n post_string << \" >/dev/null 2>&1\"\n end\n\n %x{#{curl} #{post_string}}\n return $?.success?\nend",
"def fb_request_form_submit(options={})\n\t\t\t tag(\"fb:request-form-submit\",stringify_vals(options))\n\t\t\tend",
"def add_field name, value\n @params << \"Content-Disposition: form-data; name=\\\"#{name}\\\"\\n\" + \n \"\\n\" + \n \"#{value}\\n\"\n end",
"def test_submit_on_form\n page = @agent.get(\"http://localhost/form_multival.html\")\n form = page.form_with(:name => 'post_form')\n\n assert_not_nil(form)\n assert_equal(2, form.fields_with(:name => 'first').length)\n\n form.fields_with(:name => 'first')[0].value = 'Aaron'\n form.fields_with(:name => 'first')[1].value = 'Patterson'\n\n page = form.submit\n\n assert_not_nil(page)\n\n assert_equal(2, page.links.length)\n assert_not_nil(page.link_with(:text => 'first:Aaron'))\n assert_not_nil(page.link_with(:text => 'first:Patterson'))\n end",
"def parseForm(form)\n # I'm using the format \"name value\" to be able to use the set_options method\n url = Array[\"\", \"url\", form[\"action\"]]\n method = Array[\"\", \"method\", form[\"method\"]]\n hidden_inputs = form.css(\"input[type='hidden']\")\n password_input = form.xpath(\"//input[@type='password']/@name\")\n\n # get the login input\n visible_inputs = form.css(\"input[type!='hidden']\")\n login_input = \"\"\n visible_inputs.each do |el|\n if el.to_s =~ /(login)|(email)|(username)|(user)/i\n login_input = el\n puts \"the login input est : #{el}\"\n break\n end\n end\n\n # create the string with all the hidden parameters\n body = \"\"\n hidden_inputs.each do |el|\n body = body + el[\"name\"] + \"=\" + el[\"value\"] + \"&\"\n end\n\n body = \"#{body}\" + \"#{login_input[\"name\"]}\" + \"=FILE0&\" + \"#{password_input}\" + \"=FILE1\"\n\n # add the question mark if get request\n if method == \"get\"\n body = \"?#{body}\"\n end\n body = Array[\"\", \"body\", body]\n\n\n # write the values in the json object \n options = JSON.parse(get_options(\"http_module\"))\n\n set_options(options, url)\n set_options(options, method)\n set_options(options, body)\nend",
"def post_form(uri, form, headers = T.unsafe(nil)); end",
"def fb_request_form_submit\n tag \"fb:request-form-submit\"\n end",
"def uhook_category_form form\n (form.hidden_field :content_id) + (hidden_field_tag(:from, params[:from]))\n end",
"def submit(form, button = T.unsafe(nil), headers = T.unsafe(nil)); end",
"def construct_form_html(hidden_fields, bucket, secure = true, html_options = {}, &block)\n # now build the html for the form\n form_tag(secure == false ? \"http://#{bucket}.s3.amazonaws.com\" : \"https://#{bucket}.s3.amazonaws.com\", build_form_options(html_options)) do\n hidden_fields.map do |name, value|\n hidden_field_tag(name, value)\n end.join.html_safe + \"\n <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> \n <div class='row fileupload-buttonbar'>\n <div class='col-lg-7'>\n <span class='btn btn-success fileinput-button'>\n <i class='glyphicon glyphicon-plus'></i>\n <span>Add files...</span>\n \".html_safe +\n file_field_tag(:file, :multiple => true) + \"\n </span>\n <button type='submit' class='btn btn-primary start'>\n <i class='glyphicon glyphicon-upload'></i>\n <span>Start upload</span>\n </button>\n <button type='reset' class='btn btn-warning cancel'>\n <i class='glyphicon glyphicon-ban-circle'></i>\n <span>Cancel upload</span>\n </button>\n <button type='button' class='btn btn-danger delete'>\n <i class='glyphicon glyphicon-trash'></i>\n <span>Delete</span>\n </button>\n <input type='checkbox' class='toggle'></input>\n <!-- The loading indicator is shown during file processing -->\n\t <span class='fileupload-loading'></span>\n </div>\n <!-- The global progress information -->\n <div class='col-lg-5 fileupload-progress fade'>\n <!-- The global progress bar -->\n <div class='progress progress-striped active' role='progressbar' aria-valuemin='0' aria-valuemax='100'>\n <div class='progress-bar progress-bar-success' style='width: 0%;'></div>\n </div>\n <!-- The extended global progress information -->\n <div class='progress-extended'> </div>\n </div>\n </div>\n <!-- The table listing the files available for upload/download -->\n <table role='presentation' class='table table-striped' id='upload_files'>\n <tbody class='files'></tbody>\n </table>\".html_safe + (block ? capture(&block) : '')\n end\n end",
"def restful_submit_tag(value, action, url, method, options = {})\n hidden_field_tag(\"__map[#{action}][url]\", url) <<\n hidden_field_tag(\"__map[#{action}][method]\", method.upcase) <<\n submit_tag(value, {:name => \"__rewrite[#{action}]\"}.reverse_merge!(options))\n end",
"def in_form attrs = nil\n attrs ||= Hash.new\n attrs.merge!( method: 'POST' ) unless attrs.has_key?(:method)\n attrs.merge!( 'accept-charset' => \"UTF-8\") unless attrs.has_key?('accept-charset')\n if attrs.has_key?( :file ) && attrs.delete(:file) == true\n attrs.merge!(:enctype => 'multipart/form-data')\n end\n html_balise 'form', attrs\n end",
"def submit\n\t\tset_post_data\n get_response @url\n parse_response\n\tend",
"def submitIncidentForm(page, startYear, endYear)\n form = page.form_with(:action => \"search.php\");\n form['start_year'] = startYear;\n form['end_year'] = endYear;\n page = page.form_with(:action => \"search.php\").click_button();\nend",
"def html_post_form\n expiration = (Time.now + 360).utc.strftime(\"%Y-%m-%dT%H:%M:%SZ\")\n policy_document = %{\n{\"expiration\": \"#{expiration}\",\n \"conditions\": [\n {\"bucket\": \"#{@cloud.bucket}\"},\n [\"starts-with\", \"$key\", \"TE\"],\n {\"success_action_redirect\": \"http://www.google.fr/\"},\n [\"content-length-range\", 0, 1048576]\n ]\n}\n }\n @policy = Base64.encode64(policy_document).gsub(\"\\n\",\"\")\n @signature = Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n @cloud.shared_secret, @policy)\n ).gsub(\"\\n\",\"\")\n end",
"def ajaxform(form, url='/ajax/', style='display:inline;')\n \"<form action='#{url}' method='post' style='#{style}' class='RHA form container'>\" + form.to_s + \"</form>\"\n end",
"def url_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end",
"def test_post_multival\n page = @agent.get(\"http://localhost/form_multival.html\")\n form = page.form_with(:name => 'post_form')\n\n assert_not_nil(form)\n assert_equal(2, form.fields_with(:name => 'first').length)\n\n form.fields_with(:name => 'first')[0].value = 'Aaron'\n form.fields_with(:name => 'first')[1].value = 'Patterson'\n\n page = @agent.submit(form)\n\n assert_not_nil(page)\n\n assert_equal(2, page.links.length)\n assert_not_nil(page.link_with(:text => 'first:Aaron'))\n assert_not_nil(page.link_with(:text => 'first:Patterson'))\n end",
"def import_posts_to_li settings, posts, agent\n puts '********* Post to LinkedIn **************'\n\n posts.each do |post|\n agent.get (settings[:group_url])\n form = agent.page.forms_with(:action => '/groups').first\n form.postTitle = \"#{post[:link]} | #{post[:title]}\"\n form.postText =\"#{post[:link]} #{10.chr} #{post[:title]}\"\n form.field_with(:id => \"post-twit-account-select\").value = settings[:twitter_id]\n form.checkbox_with(:name => /tweet/).check\n form.submit\n ap '[LI]===> ' + post[:title]\n end\n\nend",
"def http_post(curl, data, url)\n\n # Define the post data\n data2 = ''\n\n # Loop through the data[\"post_data\"] passed in to build up the post data string\n data[\"post_data\"].each do |key, value|\n if (data2 != '') then\n data2 = data2 + '&'\n end\n # If the value is null we don't just want it to look like: item=\n if (value.nil?) then\n data2 = data2 + CGI::escape(key.to_s) + '='\n else\n data2 = data2 + CGI::escape(key.to_s) + '=' + CGI::escape(value.to_s)\n end\n end\n\n # Define the url we want to hit\n curl.url = url\n # Specify the headers we want to hit\n curl.headers = data['header']\n\n # perform the call\n curl.post(data2)\n\n curl.headers = nil\n\n # Set headers to nil so none get reused elsewhere\n curl.headers = nil\n\n # return the curl object\n return curl\n\nend",
"def scrape(url)\n scrape = Mechanize.new\n scraper = scrape.history_added = Proc.new { sleep 1.0 }\n scraper.get(url) do |page|\n #finding all data within searchform area of the view layer\n form = page.form_with(id: 'searchform') do |s|\n #assigning new values to query, min_price, and max_price\n s['query'] = \"Loft\" #name\n s['min_price'] = 1000\n s['max_price'] = 2000\n end\n #submitting search request with above values and returning results\n data = form.submit\n data_search_results(data)\n end\nend",
"def onSubmit(request, response, form, errors)\r\n\treturn form\r\n end",
"def add_kyc_form\n service_response = SimpleTokenApi::Request::User.new(\n host_url_with_protocol,\n request.cookies,\n {\"User-Agent\" => http_user_agent}).basic_detail(GlobalConstant::TemplateType.kyc_template_type, params[:t])\n\n # Check if error present or not?\n unless service_response.success?\n render_error_response(service_response)\n return\n end\n\n @presenter_obj = ::Web::Client::Setup.new(service_response, params)\n redirect_to '/token-sale-blocked-region', status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.is_blacklisted_ip?(get_ip_to_aml_countries)\n redirect_to \"/login\", status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.has_sale_ended?\n\n @user = service_response.data[\"user\"]\n\n extra_param = params[:t].present? ? \"?e_t=1\" : \"\"\n redirect_if_step_not_reachable(@user[\"user_token_sale_state\"], GlobalConstant::TokenSaleUserState.kyc_page_allowed_states, extra_param)\n return if has_performed?\n get_ip_to_preferred_aml_country\n set_page_meta_info(@presenter_obj.custom_meta_tags)\n end",
"def _form_url(params)\n #implode params to concat \n url = '?'\n params.each do |key, value|\n #val = URI.escape(unsafe_variable, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))\n safe_key = URI.escape(key.to_s, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))\n safe_value = URI.escape(value.to_s, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))\n url += safe_key + '=' + safe_value + '&'\n end\n url\nend",
"def scaffold_form(url, options={})\n meth = options.delete(:method) || :post\n \"<form action='#{url}' method='#{meth}' #{options[:attributes]}>#{scaffold_token_tag if meth.to_s == 'post'}\"\n end",
"def my_ajax_submit_tag caption, url, html_options={}\n my_ajax_form_tag url do\n submit_tag caption, html_options\n end\n end",
"def test_get_multival\n page = @agent.get(\"http://localhost/form_multival.html\")\n form = page.form_with(:name => 'get_form')\n\n assert_not_nil(form)\n assert_equal(2, form.fields_with(:name => 'first').length)\n\n form.fields_with(:name => 'first')[0].value = 'Aaron'\n form.fields_with(:name => 'first')[1].value = 'Patterson'\n\n page = @agent.submit(form)\n\n assert_not_nil(page)\n\n assert_equal(2, page.links.length)\n assert_not_nil(page.link_with(:text => 'first:Aaron'))\n assert_not_nil(page.link_with(:text => 'first:Patterson'))\n end",
"def onSubmit(request, response, form, errors)\r\n return form\r\n end",
"def onSubmit(request, response, form, errors)\r\n return form\r\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def onSubmit(request, response, form, errors) \r\n return form\r\n end",
"def ogone_form options={}, html={}\n ogone_form_tag(html) do\n output = ogone_fields(options)\n output << \"\\t<input type='submit' value='ga verder naar ogones' id='submit2' name='submit2'>\\n\"\n end\n end",
"def form_add_to_location(location)\n page.execute_script \"window.scrollBy(0,10000)\"\n wait_for_add_link\n add_link.click\n wait_for_drop_down\n drop_down.select location\n end",
"def remote_upload_form_tag( options = {}, &block )\n framename = \"uf#{Time.now.usec}#{rand(1000)}\"\n iframe_options = {\n \"style\" => \"position: absolute; width: 0; height: 0; border: 0;\",\n \"id\" => framename,\n \"name\" => framename,\n \"src\" => ''\n }\n iframe_options = iframe_options.merge(options[:iframe].stringify_keys) if options[:iframe]\n \n form_options = { \"method\" => \"post\" }\n form_options = form_options.merge(options[:html].stringify_keys) if options[:html]\n\n form_options[\"enctype\"] = \"multipart/form-data\"\n\n url = url_for(options[:url])\n\n if options[:force_html]\n form_options[\"action\"] = url_for(options[:url])\n form_options[\"target\"] = framename\n else\n form_options[\"action\"] = if options[:fallback] then url_for(options[:fallback]) else url end\n form_options[\"onsubmit\"] = %(this.action = '#{escape_javascript( url )}'; this.target = '#{escape_javascript( framename )}';)\n form_options[\"onsubmit\"] << options[:before] if options[:before]\n end\n if block_given?\n content = capture(&block)\n concat(tag( :iframe, iframe_options, true ) + '</iframe>', block.binding)\n form_tag( url, form_options, &block )\n else\n tag( :iframe, iframe_options, true ) + '</iframe>' + form_tag( form_options[:action], form_options, &block )\n end\n end",
"def upload_form_tag(url_for_options = {}, options = {}, *parameters_for_url, &proc)\n options[:multipart] = true\n form_tag( url_for_options, options, *parameters_for_url, &proc )\n end",
"def set_form(easy)\n end",
"def onSubmit(request, response, form, errors) \n return form\n end",
"def form_for(record_or_name_or_array, *args, &proc)\n args[0][:url] = fb_sig_add(args[0][:url]) if !args[0].nil? && !args[0][:url].nil?\n super(record_or_name_or_array, *args, &proc)\n end",
"def form_tag(url_for_options = {}, options = {}, &block)\n html_options = html_options_for_form(url_for_options, options)\n if block_given?\n form_tag_with_body(html_options, capture(&block))\n else\n form_tag_html(html_options)\n end\n end",
"def html_form(url_or_path, *args)\n options = args.last.is_a?(Hash) ? args.pop.dup : {}\n # noinspection RubyMismatchedArgumentType\n separator = options.delete(:separator) || \"\\n\"\n content = args.flatten\n content += Array.wrap(yield) if block_given?\n content = content.compact_blank\n form_tag(url_or_path, options) do\n safe_join(content, separator)\n end\n end",
"def addInputs(forms)\n forms.push( {\"description\"=>\"Config\",\n \"label\"=>\"Config\",\"name\"=>\"config\",\n \"property_inputs\"=>[{\"description\"=>\"Stack\",\"label\"=>\"Stack\",\"reference\"=>\".diego_cell\"+deploymentName+\".stack\"},\n {\"description\"=>\"Virtual IP\",\"label\"=>\"Virtual IP\",\"reference\"=>\".ha_proxy\"+deploymentName+\".keepalived_vip\"},\n {\"description\"=>\"Same Keepalived group share same virtual router ID \",\"label\"=>\"Virtual Router ID\",\"reference\"=>\".ha_proxy\"+deploymentName+\".keepalived_virtual_router_id\"}] });\nend",
"def post_form(uri, form, headers = {})\n cur_page = form.page || current_page ||\n Page.new\n\n request_data = form.request_data\n\n log.debug(\"query: #{ request_data.inspect }\") if log\n\n headers = {\n 'Content-Type' => form.enctype,\n 'Content-Length' => request_data.size.to_s,\n }.merge headers\n\n # fetch the page\n page = @agent.fetch uri, :post, headers, [request_data], cur_page\n add_to_history(page)\n page\n end",
"def api_form_actions(object_name, options = {})\n \" <li><div class=\\\"form_actions\\\">\\n \" +\n submit_button(object_name, options[:submit_text]) + \"\\n \" + cancel_link +\n \"\\n </div></li>\"\n end",
"def add_to_basket\n @page.click_button(\"ctl00_contentBody_ctl02_submit\")\n end",
"def initialize\n @agent = Mechanize.new\n @page = @agent.get(@@url)\n @form = @page.forms.first\n end",
"def visit url\n @agent.get url\n @agent.page.form&.submit\n end",
"def fb_request_form(type ,message_param,url,&block)\n content = capture(&block)\n message = @_caught_content[message_param]\n concat(tag(\"fb:request-form\", content,\n {:action=>url,:method=>\"post\",:invite=>true,:type=>type,:content=>message}),\n block.binding)\n end",
"def submit(form, button = nil, headers = {})\n form.add_button_to_query(button) if button\n\n case form.method.upcase\n when 'POST'\n post_form(form.action, form, headers)\n when 'GET'\n get(form.action.gsub(/\\?[^\\?]*$/, ''),\n form.build_query,\n form.page,\n headers)\n else\n raise ArgumentError, \"unsupported method: #{form.method.upcase}\"\n end\n end",
"def submit_without_clicking_button\n path = self.action.blank? ? self.uri : self.action # If no action attribute on form, it submits to the same URI where the form was displayed\n params = {}\n fields.each {|field| params[field.name] = field.value unless field.value.nil? || field.value == [] || params[field.name] } # don't submit the nils, empty arrays, and fields already named\n \n # Convert arrays and hashes in param keys, since test processing doesn't do this automatically\n params = ActionController::UrlEncodedPairParser.new(params).result\n @testcase.make_request(request_method, path, params, self.uri, @xhr)\n end",
"def upload_form(key,content)\n return \"Content-Disposition: form-data; name=\\\"#{CGI::escape(key)}\\\"\\r\\n\" +\n \"\\r\\n\" +\n \"#{content}\\r\\n\"\nend",
"def add_listing(data)\n\t@browser.text_field(:name => 'ListContact').when_present.set data[ 'full_name' ]\n\t@browser.text_field(:name => 'ReqEmail').when_present.set data[ 'email' ]\n\t@browser.text_field(:name => 'ListOrgName').set data[ 'business' ]\n\t@browser.text_field(:name => 'ListAddr1').set data[ 'address' ]\n\t@browser.text_field(:name => 'ListCity').set data[ 'city' ]\n\t@browser.text_field(:name => 'ListState').set data[ 'state' ]\n\t@browser.text_field(:name => 'ListZip').set data[ 'zip' ]\n\t@browser.text_field(:name => 'ListPhone').set data[ 'phone' ]\n\t@browser.text_field(:name => 'ListWebAddress').set data[ 'website' ]\n\t@browser.text_field(:name => 'ListStatement').set data[ 'business_description' ]\n\n\t#Enter Decrypted captcha string here\n\treturn false unless enter_captcha\n\n\t@browser.link(:href => 'thankyou.php').click\n @browser.p(:text => /submission was successful/).wait_until_present\n\ttrue\nend",
"def appendField (name, value, formName=\"\", frameName=\"\")\n \n setField(name, value, formName, frameName, true)\n end",
"def submit(button = T.unsafe(nil), headers = T.unsafe(nil)); end",
"def form_from_options(opts)\n\t\tform_html = ''\n\t\topts.select {|e| e.has_key?(:method) && e[:method].match(/POST|PUT/)}.each do |opt|\n\t\t\tform_html += %Q{<h3>#{opt[:description]}</h3>}\n\t\t\tform_html += %Q{<form method=\"POST\" action=\"#{opt[:href]}\">\\n}\n\t\t\tif opt[:method] != \"POST\"\n\t\t\t\tform_html += %Q{<input type=\"hidden\" name=\"_method\" value=\"#{opt[:method]}\">}\n\t\t\tend\n\n\t\t\tif opt.has_key?(:parameters)\n\t\t\t\topt[:parameters].each do |k, v|\n\t\t\t\t\tform_html += %Q{#{v[:description]} <input type=\"text\" name=\"#{k}\"><br>\\n}\n\t\t\t\tend\n\t\t\tend\n\t\t\tform_html += '<input type=\"submit\" value=\"Do\"></form><br>'\n\t\tend\n\t\treturn form_html\n\tend",
"def form_opts(action=nil)\n opts = model.form_options_for(type, request).dup\n\n opts[:_before_post] = lambda do |form|\n if csrf_hash = request.csrf_token_hash(action)\n csrf_hash.each do |name, value|\n form.tag(:input, :type=>:hidden, :name=>name, :value=>value)\n end\n end\n end\n\n opts\n end",
"def fb_request_form(type,message_param,url,options={},&block)\n content = capture(&block)\n message = @template.instance_variable_get(\"@content_for_#{message_param}\") \n concat(content_tag(\"fb:request-form\", content + token_tag,\n {:action=>url,:method=>\"post\",:invite=>true,:type=>type,:content=>message}.merge(options)),\n block.binding)\n end",
"def add_field\n if request.get?\n @info = Hash.new\n @field_hash = Hash.new\n session[:count] = 1\n else\n @fields = []\n @field_hash = Hash.new\n session[:field_hash] = @field_hash\n form = DynamicForm.find(session[:form_id])\n @info = params[:info]\n if form.fields == \"To be Filled\"\n logger.info 'FIELDS TO BE FILLED'\n form.fields = {}\n else\n @fields = YAML::load(form.fields)\n logger.info \"Loading YAML {line 92}\"\n end \n @fields << @info\n form.fields = @fields.to_yaml\n form.save\n logger.info \"Returned: #{@info}\"\n redirect_to :action => 'add_fields'\n end\n end",
"def submit(opts={})\n msg = \"Submit button not found in form\"\n selector = 'input[type=\"submit\"], input[type=\"image\"], button[type=\"submit\"]'\n if @submit_value\n msg << \" with a value of '#{@submit_value}'\"\n selector.gsub!(/\\]/, \"][value=#{@submit_value}]\")\n end\n raise MissingSubmitError, msg unless tag.select(selector).any?\n fields_hash.update(opts)\n submit_without_clicking_button\n end",
"def parseTarget(url)\n response = Nokogiri::HTML(RestClient.get(url))\n\n forms = response.css('form')\n puts \"there are #{forms.length} forms\"\n forms_attributes = []\n forms.each_with_index do |el, index|\n puts\n forms_attributes[index] = el.to_s.split('>')[0]\n puts \" #{index.to_s.ljust(5)}#{forms_attributes[index]}\"\n end\n puts \" \"\n choice = ask(\"Which form do you want to bruteforce ?\")\n \n return forms[choice.to_i]\nend",
"def submit(button_name=nil, opts={})\n # 1. Loop through the non hidden fields and if they're active and displayed enter the value\n fill_in_field_data\n\n # 2. Submit Form\n submit_button = select_submit_button(button_name, opts)\n\n wait_for_submit(submit_button)\n submit_button.node.click\n\n # 3. Wait for Page page\n wait_for_page(driver, metz)\n\n # 4. Return new Page\n Metallize::Page.new(driver, metz)\n\n end",
"def submit_to_remote(name, value, options = {}) \t\t\n\t\toptions[:html] ||= Hash.new\n\t\toptions[:html] = check_options(options[:html])\n\t\toptions[:html][:class] << 'button'\n\t\tsuper(name, value, options) \n\tend",
"def single_item_action_add_form_fields(form, document)\n single_item_action_form_fields(form, document, 'add')\n end",
"def fill_contact_form(cont_info_hash)\n form = ContactInfoUI::FORM\n cont_info_hash.each do |field_name, value|\n next if field_name.eql?('Obj Reference')\n new_attr_name = Utility.convert_to_underscore(field_name)\n type = eval(\"ContactInfoUI::#{new_attr_name.upcase}['Type']\")\n label = eval(\"ContactInfoUI::#{new_attr_name.upcase}['Label']\")\n ComponentsUtil.fill_field(type, label, value, form)\n end\n ContactInformation.click_btn('Enviar')\n end",
"def postEntityAdd( entity_id, add_referrer_url, add_referrer_name)\n params = Hash.new\n params['entity_id'] = entity_id\n params['add_referrer_url'] = add_referrer_url\n params['add_referrer_name'] = add_referrer_name\n return doCurl(\"post\",\"/entity/add\",params)\n end",
"def externalsoform_params\n params.require(:externalsoform).permit(:url)\n end",
"def form_url\n URL\n end",
"def submit(form_selector='form', submit_matcher='submit', input_values_hash={})\n forms = (self.html/form_selector)\n\n if forms.length != 1\n raise \"Problem with parsing form page -- expected only 1 form tag on `#{self.url}` matching selector `#{form_selector}`, but selected `#{forms.length}` fom tags\\n#{forms.inspect}\"\n end\n\n form_values = Hpricotscape::Form.parse(forms[0])\n full_action_url = if form_values[:action].starts_with?('/')\n \"#{self.url.split('://').first}://#{self.url.split('://').last.split('/').first}#{form_values[:action]}\"\n elsif form_values[:action].index('://').nil?\n \"#{self.url.rpartition('/').first}/#{form_values[:action]}\"\n else\n form_values[:action]\n end\n\n # Allow user to use strings or symbols for input values, and merge them into the form\n form_values[:inputs].keys.each do |k|\n form_values[:inputs][k.to_s] = input_values_hash[k.to_s] if input_values_hash.has_key?(k.to_s)\n form_values[:inputs][k.to_s] = input_values_hash[k.to_sym] if input_values_hash.has_key?(k.to_sym)\n end\n\n submit_key = form_values[:submits].keys.select { |k| k.downcase.index(submit_matcher) }.first\n form_post_body = form_values[:inputs].merge(submit_key => form_values[:submits][submit_key])\n\n _load(full_action_url, form_values[:method], form_post_body)\n end",
"def decorate_form(form, onclick)\r\n\r\n fields = onclick.attr \"onclick\"\r\n fields.to_s =~ /\\{([^}]+)\\}/\r\n fields = $1\r\n fields = fields.split(\",\").map do |e|\r\n arr = e.gsub(\"'\", \"\").split \":\"\r\n arr.push \"\" unless arr.length == 2\r\n arr[0].strip!\r\n arr[1].strip!\r\n arr\r\n end\r\n fields.each do |field|\r\n form_field = form.field_with :name=>field[0]\r\n if form_field.nil?\r\n form.add_field! field[0]\r\n form_field = form.field_with :name=>field[0]\r\n end\r\n form_field.value= field[1]\r\n end\r\n return form\r\n rescue Exception => e\r\n puts e\r\n end",
"def decorate_form(form, onclick)\r\n\r\n fields = onclick.attr \"onclick\"\r\n fields.to_s =~ /\\{([^}]+)\\}/\r\n fields = $1\r\n fields = fields.split(\",\").map do |e|\r\n arr = e.gsub(\"'\", \"\").split \":\"\r\n arr.push \"\" unless arr.length == 2\r\n arr[0].strip!\r\n arr[1].strip!\r\n arr\r\n end\r\n fields.each do |field|\r\n form_field = form.field_with :name=>field[0]\r\n if form_field.nil?\r\n form.add_field! field[0]\r\n form_field = form.field_with :name=>field[0]\r\n end\r\n form_field.value= field[1]\r\n end\r\n return form\r\n rescue Exception => e\r\n puts e\r\n end",
"def scrape_list\n agent = Mechanize.new\n page = agent.get(BASE_URL + @filename + '?lang=eng')\n\n form = page.forms.first\n form['__EVENTTARGET'] = 'ctl00$btnSearch'\n scrape_page form.submit\n end",
"def emit_form(formdata: {})\n if formdata[JIRA] || formdata[CONFLUENCE]\n title = 'Update your JIRA and Confluence IDs (previously submitted)'\n submit_title = 'Update Your ID Mapping'\n else\n title = 'Enter your JIRA and Confluence IDs'\n submit_title = 'Submit Your ID Mapping'\n end\n _whimsy_panel(title, style: 'panel-success') do\n _form.form_horizontal method: 'post' do\n _div.form_group do\n _label.control_label.col_sm_3 'Do you have an Apache JIRA ID?', for: JIRAHAS\n _div.col_sm_9 do\n _select.form_control name: JIRAHAS, id: JIRAHAS, required: true do\n _option value: ''\n _option \"Yes - I have one JIRA ID\", value: 'y', selected: \"#{formdata[JIRAHAS] == 'y' ? 'selected': ''}\"\n _option \"No - I do not have a JIRA ID\", value: 'n', selected: \"#{formdata[JIRAHAS] == 'n' ? 'selected': ''}\"\n _option \"I use multiple JIRA IDs\", value: 'm', selected: \"#{formdata[JIRAHAS] == 'm' ? 'selected': ''}\"\n end\n end\n end\n emit_input(label: 'Enter your Apache JIRA ID (if you have one)', name: JIRA, required: false,\n value: \"#{formdata[JIRA]}\", \n helptext: \"The JIRA ID used on issues.apache.org (usually same as committer ID)\")\n emit_input(label: 'List any other JIRA IDs you personally use, one per line', name: JIRAOTHER, required: false,\n value: \"#{formdata[JIRAOTHER]}\",\n rows: 3, helptext: \"Remember: these should only be personal IDs you use, not project ones.\")\n \n _div.form_group do\n _label.control_label.col_sm_3 'Do you have an Apache Confluence ID?', for: CONFLUENCEHAS\n _div.col_sm_9 do\n _select.form_control name: CONFLUENCEHAS, id: CONFLUENCEHAS, required: true do\n _option value: ''\n _option \"Yes - I have one Confluence ID\", value: 'y', selected: \"#{formdata[CONFLUENCEHAS] == 'y' ? 'selected': ''}\"\n _option \"No - I do not have a Confluence ID\", value: 'n', selected: \"#{formdata[CONFLUENCEHAS] == 'n' ? 'selected': ''}\"\n _option \"I use multiple Confluence IDs\", value: 'm', selected: \"#{formdata[CONFLUENCEHAS] == 'm' ? 'selected': ''}\"\n end\n end\n end\n emit_input(label: 'Enter your Apache Confluence ID (if you have one)', name: CONFLUENCE, required: false,\n value: \"#{formdata[CONFLUENCE]}\", \n helptext: \"The Confluence ID used on cwiki.apache.org (usually same as committer ID)\")\n emit_input(label: 'List any other Confluence IDs you personally use, one per line', name: CONFLUENCEOTHER, required: false,\n value: \"#{formdata[CONFLUENCEOTHER]}\",\n rows: 3, helptext: \"Remember: these should only be personal IDs you use, not project ones.\")\n \n emit_input(label: 'Your Apache Committer ID', name: COMMITTERID, readonly: true,\n value: formdata[COMMITTERID], icon: 'glyphicon-user', iconlabel: 'Committer ID')\n _div.col_sm_offset_3.col_sm_9 do\n _input.btn.btn_default type: 'submit', value: submit_title\n end\n end\n end\nend",
"def forms; end",
"def submit(contents, attrs = {})\n current_form_context.submit(contents, attrs)\n end",
"def add_form(location, form_name, form_oid)\n form_add_to_location location\n enter_form_name.set form_name\n enter_form_oid.set form_oid\n page.find_link('Update').click\n end",
"def button(opts={})\n opts = {:value=>opts} if opts.is_a?(String)\n input = _input(:submit, opts)\n self << input\n input\n end",
"def contact_form_options\n #TODO verify originating domain\n cors_set_access_control_headers\n head :ok\n end",
"def ajax_get\n form_tag(@options[:url], :class => 'button_form', :remote =>true) + \n button_image + \n \"</form>\".html_safe\n end",
"def external_form_post_js( label = \"Submit\", action = '', params = {} )\n return \"<input type='button' value='#{label}' onClick='externalFormPost(\" + action.to_json + \",\" + params.to_json + \")'/>\"\n end",
"def set_form_data(request, params, sep = '&')\n request.body = params.map {|k,v|\n if v.instance_of?(Array)\n v.map {|e| \"#{urlencode(k.to_s)}=#{urlencode(e.to_s)}\"}.join(sep)\n else\n \"#{urlencode(k.to_s)}=#{urlencode(v.to_s)}\"\n end\n }.join(sep)\n\n request.content_type = 'application/x-www-form-urlencoded'\nend",
"def add_credit_card(credit_card, billing_address = nil)\n add_credit_card_form.card_number_input.set credit_card[:card_number]\n add_credit_card_form.name_on_card_input.set credit_card[:card_name]\n\n # display expiration month option\n page.execute_script(\"$('#vin_PaymentMethod_creditCard_expirationDate_Month').css('display','block')\")\n add_credit_card_form.expiration_month_opt.select credit_card[:exp_month]\n\n # display expiration year option\n page.execute_script(\"$('#vin_PaymentMethod_creditCard_expirationDate_Year').css('display','block')\")\n add_credit_card_form.expiration_year_opt.select credit_card[:exp_year]\n\n add_credit_card_form.security_code_input.set credit_card[:security_code]\n\n if billing_address.nil?\n if add_credit_card_form.has_shipping_checked_chk?\n add_credit_card_form.use_shipping_address_chk.click\n else\n add_credit_card_form.use_shipping_address_as_billing_address.click\n end\n else\n fill_billing_address(billing_address)\n end\n\n # submit info\n add_credit_card_form.continue_btn.click\n\n AtgCheckOutReviewPage.new\n end",
"def post_request(url, params)\n res = Net::HTTP.post_form(url, params)\n Nokogiri::HTML(res.body)\n end",
"def forms\n @forms ||= search('form').map do |html_form|\n form = Mechanize::Form.new(html_form, @mech, self)\n form.action ||= @uri.to_s\n form\n end\n end",
"def forms\n @forms ||= search('form').map do |html_form|\n form = Mechanize::Form.new(html_form, @mech, self)\n form.action ||= @uri.to_s\n form\n end\n end",
"def onSubmit(request, response, form, errors)\r\n \r\n # Check the errors first.\r\n if errors.getErrorCount() > 0\r\n # Revert back to the entry screen\r\n form.viewName = \"botverse/linkaddcomment\"\r\n return form\r\n end\r\n \r\n # Get the current link id\r\n cur_session = request.getSession(false)\r\n if cur_session.nil?\r\n @log.error(\"Invalid session object, linkaddcomment\")\r\n form.viewName = 'errorInvalidView'\r\n return form\r\n end\r\n \r\n linkbean = cur_session.getAttribute(BotListSessionManager::CURRENT_LINK_VIEW)\r\n linkId = linkbean.get_id\r\n \r\n # Transform form data into a hbm bean\r\n form.id = linkId\r\n comment = transformFormData(form)\r\n createComment(comment, linkId)\r\n \r\n form.viewName = 'botverse/linkaddcomment_confirm'\r\n return form\r\n end",
"def add_new_pool\n #puts \"clicking add new pool...\"\n #10.times {frm.link(:text=>\"Add New Pool\").flash}\n frm.link(:text=>\"Add New Pool\").click\n #puts \"clicked...\"\n #frm.text_field(:id=>\"questionpool:namefield\").wait_until_present(200)\n AddQuestionPool.new(@browser)\n end",
"def search_form(search_method = nil, additional_values = {})\n additional_jquery :form, :search_forms\n additional_fields = additional_values.collect do |k, v|\n hidden_field_tag(k, v)\n end.join\n\n <<-EOS.html_safe\n<form class=\"search_form\" method=\"get\" action=\"/searches.html\">\n #{hidden_field_tag '_method', 'get'}\n #{hidden_field_tag 'search_method', search_method}\n #{additional_fields}\n #{text_field_tag :query}\n <span class=\"image\">\n <span id=\"search_icon\">#{image_tag 'forms/search.png'}</span>\n <span id=\"loading_icon\" style=\"display: none;\">#{image_tag 'forms/loading.gif'}</span>\n </span>\n</form>\n EOS\n end",
"def submit_form\n county = params[:county]\n item = params[:item]\n callerName = params[:callerName]\n #Caller Name on form was set to be optional, in which case name is recorded as Anonymous\n if callerName == \"\" then callerName = \"Anonymous\" end\n method = params[:method]\n #Retrieving the content if \"Other\" button was chosen in form\n if method == \"other2\" then method = params[:altOther2] end\n disposition = params[:disposition]\n if disposition == \"other3\" then disposition = params[:altOther3] end\n if disposition == \"directly\" then disposition = params[:directly] end\n callType = params[:callType]\n if callType == \"Other\" then callType = params[:altOther] end\n callFor = params[:callFor]\n #Storing form data as session variable\n session[:value] = [county, item, callerName, method, disposition, callType, callFor]\n @vals = session[:value]\n #Submit button was clicked, else save button was clicked\n if params[:submit_clicked]\n client = DropboxApi::Client.new\n ifInTmpFolder = false\n currentYear = Time.now.year\n currentMonth = Time.now.month\n prcFileName = \"\"\n if callFor == \"PRC\"\n prcFileName = \"PRCHotlineStatsMonth#{currentMonth}.csv\"\n else\n prcFileName = \"DEPHotlineStatsMonth#{currentMonth}.csv\"\n end\n path = \"/#{currentYear}/#{prcFileName}\"\n tmpPath = Rails.root.join(\"tmp/#{prcFileName}\")\n #Checks if file with correct month and PRC/DEP already exists\n unless File.exist?(tmpPath) || File.symlink?(tmpPath)\n results = client.search(prcFileName,\"/#{currentYear}\")\n if results.matches.count > 0\n path = results.matches.first.resource.path_lower\n monthCSV = \"\"\n file = client.download(path) do |chunk|\n monthCSV << chunk\n end\n CSV.open(tmpPath, \"at\") do |csv|\n csv << monthCSV\n end\n end\n end\n #Adding to CSV file and uploading back to DropBox with override\n CSV.open(tmpPath, \"at\") do |csv|\n csv << [County.find(county).name.titleize, Item.find(item).name.titleize, callerName, method, disposition, callType, callFor]\n end\n file_content = IO.read tmpPath\n client.upload path, file_content, :mode => :overwrite\n session.delete(:value)\n redirect_to \"/\", notice: \"#{callerName} was added to #{callFor}'s call stats.\"\n #Save button clicked\n else\n redirect_to :back\n end\n\n end",
"def parse_web_form_request\n if !params[:file].blank?\n return [params[:file], 'file']\n elsif !params[:freetext].blank?\n return [params[:freetext], 'text']\n elsif !params[:url].blank?\n return [params[:url], 'url']\n elsif !params[:example_url].blank?\n return [params[:example_url], 'url']\n end \nend",
"def submit_form_with_rest(form_element: nil, action: nil, params: nil, expected_redirect: nil)\n if form_element.nil? && ( action.nil? && params.nil?)\n raise \"Must pass in either a form element to submit or an action url with a parameters hash\"\n end\n\n if form_element\n params = form_element.all(:css, \"input\").inject({}){|result, input| result[input[\"name\"]] = input.value ; result }\n action = form_element[\"action\"]\n end\n\n rest_request(:post, action, payload: params, format: :html, retry_login: true, expected_redirect: expected_redirect)\n end",
"def get_pages (page, form, event_target)\n link = page.links_with(:class => 'rgCurrentPage')[0]\n /(ctl00[^']+)/.match(link.href).each do |another_page|\n form.add_field!('__EVENTTARGET', another_page)\n form.add_field!('__EVENTARGUMENT', '')\n yield form.submit\n end\nend",
"def build_add_bintip_station_form(action,caption)\n\n codes = BintipStation.find(:all).map {|g|[g.bintip_station_code,g.id]}\n field_configs = Array.new\n\tfield_configs[0] = {:field_type => 'DropDownField',\n\t\t\t\t\t\t:field_name => 'bintip_station_code',\n\t\t\t\t\t\t:settings => {:list => codes}}\n\n\n\tbuild_form(nil,field_configs,action,'bintip_station',caption)\n\n\n\n end",
"def btag1; catdet.form(:name, 'rpcControlRemSettingForm').text_field(:name, 'assetTag1'); end",
"def html_form\n f = String.new\n f << form_operation.in_hidden(name:'operation')\n f << id.in_hidden(name:'quiz[id]', id:\"quiz_id-#{id}\")\n # Le temps courant, au cas où, pour voir si le formulaire n'est\n # pas soumis trop vite\n f << NOW.in_hidden(name: 'quiz[time]')\n f << questions_formated\n f << bouton_soumission_ou_autre.in_div(class: 'buttons')\n\n f = f.force_encoding('utf-8').in_form(id: form_id, class:'quiz', action: form_action)\n end",
"def add_form(klass=nil) \n # {{{\n form = model_form(:model => klass, :action => :perform_add)\n return form\n end",
"def create_webform(title, fields, browser = @browser)\n browser.navigate.to($config['sut_url'] + create_webform_url)\n Log.logger.debug(\"Entering new webform title '#{title}'\")\n fields.each{|fieldname|\n self.add_webform_component(fieldname)\n }\n self.add_webform_title(title)\n message = self.save_webform(browser)\n return message\n end"
] | [
"0.60855335",
"0.60110116",
"0.5937936",
"0.5933206",
"0.5758307",
"0.57352376",
"0.57140595",
"0.5671017",
"0.5659895",
"0.56042874",
"0.5586499",
"0.5574012",
"0.55718565",
"0.5553367",
"0.5511366",
"0.5467106",
"0.5408678",
"0.54013824",
"0.53831685",
"0.5332916",
"0.5332659",
"0.5313331",
"0.5298474",
"0.5289116",
"0.5260114",
"0.5251158",
"0.52385867",
"0.52194405",
"0.5196676",
"0.5193526",
"0.5188598",
"0.5159202",
"0.5159202",
"0.51584154",
"0.51584154",
"0.51584154",
"0.51584154",
"0.51436824",
"0.5125328",
"0.51108295",
"0.50910276",
"0.50689816",
"0.5066879",
"0.50636554",
"0.505914",
"0.5054663",
"0.50544167",
"0.50313485",
"0.502836",
"0.502732",
"0.502253",
"0.5022493",
"0.5022138",
"0.50215274",
"0.50188893",
"0.5003408",
"0.5003278",
"0.50019485",
"0.49931648",
"0.49879318",
"0.49765503",
"0.4971488",
"0.49351987",
"0.49089617",
"0.49074775",
"0.49070942",
"0.48959383",
"0.48956916",
"0.48955846",
"0.48788315",
"0.4875476",
"0.4858504",
"0.48518598",
"0.48486876",
"0.48486876",
"0.4845518",
"0.4831745",
"0.4826791",
"0.48252547",
"0.48219702",
"0.4817243",
"0.48027182",
"0.47995222",
"0.47947076",
"0.47943532",
"0.4792067",
"0.47918344",
"0.478984",
"0.478984",
"0.47862",
"0.47851145",
"0.47724652",
"0.47688335",
"0.47662687",
"0.47520614",
"0.47482926",
"0.47482795",
"0.47476915",
"0.47444174",
"0.47394386",
"0.47393194"
] | 0.0 | -1 |
before_action :authorize_owner, only: [:edit, :destroy, :update] | def new
@cocktail = Cocktail.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authorize_edit\n authorize! :edit, @opportunity\n end",
"def edit\n authorize! :update, @user\n end",
"def edit\n authorize @user_information\n end",
"def allow_edit(owner)\n return true if allow(owner)\n respond_to do |format|\n format.html { redirect_to user_path(session[:user_id]), notice: 'You are not authorized to perform the action' }\n end\n end",
"def edit\n authorize @car\n end",
"def owner\n redirect_to shelters_path, notice: 'Woah there! Only owners can edit shelters.' unless current_user.owner || current_user.admin\n end",
"def edit\n authorize! :edit, @user, :id => current_user.id\n end",
"def show\n # authorize Admin\n end",
"def user_action_on_resource_authorized\n end",
"def edit\n authorize! :edit, @profile\n end",
"def edit\n authorize @volunteer_position\n end",
"def show\n authorize! :update, Hospital\n end",
"def check_update_permission\n return if owner? || @article.is_public_editable\n redirect_to articles_url\n end",
"def owner_only\n unless current_user == @organism.owner\n flash[:alert] = \"Vous ne pouvez executer cette action car vous n'êtes pas le propriétaire de la base\"\n redirect_to admin_organisms_url\n end\n\n end",
"def edit\n @car = Car.find(params[:id])\n\n if current_user.admin == true\n authorize @car\n end\n\n\n authorize @car\n end",
"def owner\n @mycars = Car.where(user_id: @user.id)\n authorize @mycars\n end",
"def authorize_admin!\n authorize! :manage, :all\n end",
"def owner_only\n unless current_user == @organism.owner\n flash[:alert] = \"Vous ne pouvez executer cette action car vous n'êtes pas le propriétaire de la base\"\n redirect_to admin_organisms_url\n end\n end",
"def edit\n @user = User.find(params[:id])\n authorize! :update, @user \n end",
"def authorize_admin\n authorize! :update, convention.events.new\n end",
"def authorize_owner\n head :unauthorized unless current_user.owns_nilm?(@nilm)\n end",
"def authorize\n return_unauthorized unless current_user && current_user.can_modify_user?(params[:id])\n end",
"def edit\n authorize @category\n end",
"def access_control\n \n end",
"def show \n #if current_user.company_id == @user.company_id \n authorize @user \n end",
"def authorize\n end",
"def authorize\n end",
"def check_ownership\n redirect_to animals_path, notice: \"You are not authorized for that action.\" if !current_user&.admin? && Animal.find(params[:id]).owner != current_user\n end",
"def edit\n require_user\n end",
"def authorize\n render json: { status: 200, msg: 'You are not allowed to do this update' } unless current_user && current_user.can_modify_user?(params[:id])\n end",
"def authorize_access\r\n # authorize!(action_name.to_sym, \"#{controller_name}_controller\".camelcase.constantize)\r\n end",
"def authorize_as_owner\n username = params[:id]\n unless session[:username] == username\n redirect_to(:controller => \"portfolio\", :action => \"default\", :id => session[:username])\n end \n end",
"def edit\n enforce_update_permission(@user)\n end",
"def appctrl_ensure_is_owner\n model = controller_name.camelize.singularize.constantize # :-)\n @item = model.find( params[ :id ] )\n\n if ( @item.user_id != current_user.id )\n render_optional_error_file( 401 ) unless current_user.is_admin?\n end\n end",
"def authorize_users\n authorize :user\n end",
"def update\n redirect_to :owners #no permit\n end",
"def edit\n @user = User.shod(params[:id])\n authorize! :update, @user\n end",
"def require_object_owner\n if User.find(params[:user_id]) != current_user\n flash[:error] = \"Sorry! Viewing not authorized.\"\n redirect_to :back\n end\n end",
"def show\n authorize User\n end",
"def show\n authorize User\n end",
"def pundit_authorize\n authorize [:admin, @testimonial||:testimonial]\n end",
"def edit\n @user = User.find(params[:id])\n\n #this works, but we can do better.\n authorize! :edit, @user\n end",
"def authenticate_owner!\n category = Category.find(params[:id])\n render \"errors/404\" unless category.order != 0 && category.setup.venture.user_id == current_user.id\n end",
"def show\n authorize @admin\n end",
"def show\n authorize @other\n end",
"def authorize_admin_profiles\n authorize convention, :view_attendees?\n end",
"def authorize_admin\n permission = params[:action] == 'update' ? :manage : :read\n authorize! permission, convention.event_proposals.new(status: 'reviewing')\n end",
"def edit\n @user = User.friendly.find(params[:id])\n if not_owner_check(@user)\n redirect_to current_user\n end\n end",
"def before_action \n end",
"def authorize_access\n # byebug\n redirect_to root_path, alert: \"Access Denied\" unless can? :modify, Post\n end",
"def self_edit_only\n #if current_user.id != Integer(params[:id]) && !current_user.is_admin\n if !can_edit\n redirect_to user_url, :notice => \"You don't have permission to do that.\"\n else\n end\n end",
"def authorization(action, object = \"default - missing something?\")\n if action == \"create\"\n not_authorised and return unless current_user.can_create?\n elsif action == \"update\"\n not_authorised and return unless current_user.can_update?(object)\n elsif action == \"destroy\"\n not_authorised and return unless current_user.can_destroy?(object)\n elsif action == \"owner\"\n not_authorised and return unless current_user.owner?(object)\n elsif action == \"admin\"\n not_authorised and return unless current_user.admin_only\n end\n end",
"def allow_to\n # owner of story can do anything? editing?\n super :owner, :all => true\n # approved users can create new stories\n super :user, :only => [:show, :index, :search, :new, :create]\n # everybody can list and watch\n super :all, :only => [:show, :index, :search]\n end",
"def show\n authorize @s_other\n end",
"def edit\n @user = current_user\n\n authorize! @tool\n end",
"def pre_authorize_cb; end",
"def authorize_inherited_resource!\n authorize! :show, parent if parent?\n authorize! authorizable_action, authorize_resource? ? resource : resource_class\n end",
"def show\n authorize @career\n end",
"def edit\n # Listing 9.14: Finding the correct user is now handled by the correct_user before_action.\n end",
"def edit\n @city = City.find(params[:id])\n authorize @city\n end",
"def edit_my_details\n @user = User.find_by_id(current_user.id)\n authorize! :edit_my_details, User\n end",
"def show\n authorize! :create, Administrator\n end",
"def authorize_admin\n redirect_to root_path unless current.user.immortal?\n end",
"def authorize_admin\n redirect_to :login unless current_user.permission.manage_app ||\n current_user.permission.manage_attrs ||\n current_user.permission.manage_achievement_categories ||\n current_user.permission.manage_talent_trees ||\n current_user.permission.manage_talents ||\n current_user.permission.manage_quests ||\n current_user.permission.manage_skills ||\n current_user.permission.manage_achievements ||\n current_user.permission.manage_items ||\n current_user.permission.manage_titles\n end",
"def authorize_controller!\n authorize! action_name.to_sym, full_controller_name\n end",
"def authorization; end",
"def authorize_author\n redirect_to '/login' unless self.user_access > 1 || current_user.access == 3\n end",
"def authorize\n render json: { error: 'You are not authorized to modify this data'} , status: 401 unless current_user && current_user.can_modify_user?(params[:id])\n end",
"def pre_authorize_cb=(_arg0); end",
"def can_edit?(someone)\n owner_id.to_s == someone.id.to_s\n end",
"def authorize?(person)\n person.is_admin?\n end",
"def validate_owner\n unless @article.owner == current_user\n redirect_to root_path, notice: 'You do not have edit access to the article!'\n end\n end",
"def user_permitted_to_edit(item)\n item.user == current_user \n end",
"def can_edit?(user)\n\n end",
"def run_filters\n set_user\n authorize\n end",
"def authorize_resource(*args); end",
"def canEdit?(user=current_user,owner=nil)\n return false if user.nil?\n return true if user.name == owner.name\n return true if self.isAdmin?(user)\n false\n end",
"def show\n authorize @info_practice\n end",
"def authorize_manage_obj_content!\n authorize! :manage_content, @object\n end",
"def show\n authorize!\n end",
"def show\n authorize!\n end",
"def show\n authorize!\n end",
"def show\n authorize EmployeeType\n end",
"def edit\n authorize @vlan\n end",
"def authorize\n render json: { error: 'You are not authorized to modify this data'} , status: 401 unless current_user && current_user.can_modify_user?(params[:id])\n end",
"def owner_required\n ## before filter for owner of channel. \n if logged_in? && current_user.login == THUMBWEBS_AUTHORIZED_USER\n return true\n else\n flash[:error] = \"Unauthorized Access-Must be logged-in as owner.\"\n redirect_to thumbwebs_root_path\n end\nend",
"def authorize_user\n @profile = current_user.profile\n return if @profile\n flash[:alert] = \"You can only edit your own profile\"\n redirect_to profile_path\n end",
"def edit_authorized(current_user)\n return self.user_id == current_user.id\n end",
"def edit_authorized(current_user)\n return self.user_id == current_user.id\n end",
"def show\n # authorize @item\n end",
"def authorize?(_user)\n true\n end",
"def authorize?(_user)\n true\n end",
"def show\n authorize @user\n end",
"def show\n authorize @user\n end",
"def check_ownership \t\n \taccess_denied(:redirect => @check_ownership_of) unless current_user_owns?(@check_ownership_of)\n end",
"def owner_authorize(member_id)\n unless logged_in? and (current_member.id == member_id or admin?)\n unauthorized_access\n end\n end",
"def authorize_admin!\n redirect_to login_path unless current_user\n end",
"def ckeditor_authenticate\n authorize! action_name, @asset\n end",
"def permitted?\n Article.can_edit?(@user)\n end",
"def ownerOrAdmin\n if not signed_in? && (Greenroof.find_by_id(params[:id]).user_id == current_user.id || current_user.admin?)\n redirect_to root_url\n end\n end",
"def authorize_user\n unless @api_user.permit? params[:controller], params[:action]\n head :unauthorized and return\n end\n end"
] | [
"0.7743605",
"0.7657641",
"0.74859446",
"0.73679274",
"0.7248306",
"0.7236876",
"0.72187275",
"0.71852714",
"0.7177464",
"0.71415037",
"0.71286076",
"0.7087862",
"0.7082044",
"0.70409507",
"0.7020739",
"0.6992041",
"0.6975335",
"0.69707924",
"0.6953136",
"0.69500065",
"0.69463116",
"0.69419074",
"0.6939318",
"0.6938255",
"0.69373363",
"0.6930981",
"0.6930981",
"0.69078827",
"0.68859035",
"0.6883859",
"0.687746",
"0.68735605",
"0.6859808",
"0.68503404",
"0.68485343",
"0.6840747",
"0.68385917",
"0.682876",
"0.6816516",
"0.6816516",
"0.6801389",
"0.67875844",
"0.67872876",
"0.67865115",
"0.67846906",
"0.6771686",
"0.6753921",
"0.67534673",
"0.6733148",
"0.6726305",
"0.67170227",
"0.67127895",
"0.66809225",
"0.66767323",
"0.66710067",
"0.66659063",
"0.6660643",
"0.6654929",
"0.66518736",
"0.6646312",
"0.6636335",
"0.6627621",
"0.66079783",
"0.6592119",
"0.6588914",
"0.6584505",
"0.6584114",
"0.6582374",
"0.6582187",
"0.65811926",
"0.65799004",
"0.65601814",
"0.6557916",
"0.65312207",
"0.65263903",
"0.6525593",
"0.65185267",
"0.6517984",
"0.6517022",
"0.65142196",
"0.65142196",
"0.65142196",
"0.65129644",
"0.6511195",
"0.6508717",
"0.6498346",
"0.64838856",
"0.64699334",
"0.64699334",
"0.64668757",
"0.6461261",
"0.6461261",
"0.6459042",
"0.6459042",
"0.6451594",
"0.644253",
"0.6436684",
"0.64360476",
"0.64343363",
"0.6432141",
"0.6431277"
] | 0.0 | -1 |
GET /spaceships/1 GET /spaceships/1.json | def show
@spaceship = Spaceship.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @spaceship }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_spaceship\n @Spaceship = Spaceship.find(params[:id])\n end",
"def destroy\n @spaceship = Spaceship.find(params[:id])\n @spaceship.destroy\n\n respond_to do |format|\n format.html { redirect_to spaceships_url }\n format.json { head :no_content }\n end\n end",
"def show\n @space = Space.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @space }\n end\n end",
"def index\n @ships = Ship.all\n end",
"def index\n @ships = Ship.all\n end",
"def index\n if params['user_id']\n @user = User.find(params['user_id'])\n @spaces = @user.spaces.visible_by(current_user)\n else\n @spaces = Space.visible_by(current_user).first(10)\n end\n #render json: @spaces.as_json(only: [:id, :name, :description, :updated_at, :user_id])\n render json: SpacesRepresenter.new(@spaces).to_json\n end",
"def show\n @clientship = current_user.clientships.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientship }\n end\n end",
"def index\n @spaces = Space.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spaces }\n end\n end",
"def show\n puts @fleet.id\n @ship_hash = @fleet.get_ships\n end",
"def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship }\n end\n end",
"def index\n @clientships = current_user.clientships.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientships }\n end\n end",
"def new\n @spaceship = Spaceship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spaceship }\n end\n end",
"def index\n @player_ships = PlayerShip.all\n end",
"def show\n @ship_class = ShipClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship_class }\n end\n end",
"def create\n @spaceship = Spaceship.new(params[:spaceship])\n\n respond_to do |format|\n if @spaceship.save\n format.html { redirect_to @spaceship, notice: 'Spaceship was successfully created.' }\n format.json { render json: @spaceship, status: :created, location: @spaceship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spaceship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n render json: Space.all\n end",
"def index\n @fleet_ships = FleetShip.all\n end",
"def show\n @space = Space.find(params[:id]) \n end",
"def show\n @myspace = Myspace.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myspace }\n end\n end",
"def show\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @internship }\n end\n end",
"def show\n if @space.is_private && !belongs_to_user\n head :unauthorized\n else\n newSpace = @space\n newSpace.graph = @space.cleaned_graph\n render json: SpaceRepresenter.new(newSpace).to_json\n end\n end",
"def index\n @ships = Ship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ships }\n end\n end",
"def destroy\n @clientship = current_user.clientships.find(params[:id])\n @clientship.destroy\n\n respond_to do |format|\n format.html { redirect_to clientships_url }\n format.json { head :ok }\n end\n end",
"def show\n @intern = Intern.find(params[:id])\n @internships = Internship.where(intern_id: @intern.id)\n respond_to do |format|\n format.html #show.html.erb\n format.json { render json: @intern }\n end\n end",
"def update\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n if @spaceship.update_attributes(params[:spaceship])\n format.html { redirect_to @spaceship, notice: 'Spaceship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spaceship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @mapspace = Mapspace.find(params[:id])\n render :template => \"mapspaces/show\"\n end",
"def show\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @space_cat }\n end\n end",
"def show\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n format.html \n format.json { render :json => @internship }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :no_content }\n end\n end",
"def index\n @cartships = Cartship.all\n end",
"def index\n @shipings = Shiping.all\n end",
"def index\n @spacecrafts = Spacecraft.all\n end",
"def index\n @shipments = Shipment.all\n render json: @shipments\n end",
"def show\n @space_user = SpaceUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @space_user }\n end\n end",
"def show\n @ship = Ship.find(params[:id])\n \n @ordereditems = ShipItem.find(:all, :conditions => {:ship_id => \"#{@ship.id}\"}, :joins => :item, :order => \"slot\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def show\n render json: @space_station\n end",
"def destroy\n @discipleship.destroy\n respond_to do |format|\n format.html { redirect_to discipleships_url }\n format.json { head :no_content }\n end\n end",
"def index\n if params['user_id']\n @user = User.find(params['user_id'])\n if current_user && @user.id == current_user.id\n organization_ids = @user.organizations.map {|o| o.id}\n @spaces = @user.spaces.where(organization_id: [nil] + organization_ids)\n else\n @spaces = @user.spaces.is_public\n end\n elsif params['organization_id']\n if current_user && current_user.member_of?(params['organization_id'])\n @spaces = Organization.find(params['organization_id']).spaces\n else\n @spaces = Organization.find(params['organization_id']).spaces.is_public\n end\n end\n render json: SpacesRepresenter.new(@spaces).to_json\n end",
"def show\n @pic_space = PicSpace.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic_space }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end",
"def show\n @open_space = current_user.open_spaces.get(params[:id])\n\n respond_to do |format|\n if (@open_space) then\n format.html { render :layout => 'application' }\n format.xml { render :xml => @open_space }\n format.json { render :json => @open_space }\n else\n format.html { render :text => \"No such object\", :status => 404}\n format.xml { render :xml => @open_space }\n format.json { render :json => @open_space }\n end\n end\n end",
"def p1ships\n @p1ships\n end",
"def index\n @manifestships = Manifestship.all\n end",
"def destroy\n @ship.destroy\n respond_to do |format|\n format.html { redirect_to ships_url, notice: 'Ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end",
"def show\n @friendship = @user.friendships.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friendship }\n end\n end",
"def show\n @monitorship = Monitorship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monitorship }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to(internships_url) }\n format.json { head :ok }\n end\n end",
"def destroy\n @space = Space.find(params[:id])\n\n @space.destroy\n\n respond_to do |format|\n format.html { redirect_to spaces_url }\n format.json { head :no_content }\n end\n end",
"def list_spaces_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SpacesApi.list_spaces ...'\n end\n # resource path\n local_var_path = '/video/v1/spaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'ListSpacesResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['accessToken']\n\n new_options = opts.merge(\n :operation => :\"SpacesApi.list_spaces\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SpacesApi#list_spaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @ship_armor_slots = ShipArmorSlot.all\n end",
"def index\n @discipleships = Discipleship.all\n end",
"def index\n # @ships = Ship.paginate(:page => params[:page], :per_page => 5)\n #sorts the ship list by empire and name (remember #sort_by sorts \n #from left to right so you can have multiple criteria)\n ships = Ship.all\n @ships = ships.sort_by { |v| [v[:empire_image], v[:cost]] }\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ships }\n end\n end",
"def index\n \n @shipments = Shipment.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shipments }\n end\n end",
"def index\n @shipments = Shipment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shipments }\n end\n end",
"def refresh\n @all_ships = @field.reduce(:|).find_all { |x| x }\n end",
"def update\n if @space.update(space_params)\n render json: @space, status: :ok\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def show\n @job_ship = JobShip.find(params[:id])\n end",
"def find_space_in_system(slug, params={}, headers=default_headers)\n @logger.info(\"Retrieving Space \\\"#{slug}\\\"\")\n get(\"#{@api_url}/spaces/#{slug}\", params, headers)\n end",
"def destroy\n @player_ship.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_url, notice: 'Player ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def show\n @ship = Ship.find(params[:id])\n @weapon = WeaponCard.find_by_ship_id(params[:id])\n @weapon_card = WeaponCard.new\n weapon_names = Weapon.all\n @weapon_names = {}\n weapon_names.each do |name|\n @weapon_names[name.name] = name.id\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ship }\n format.js\n end\n end",
"def index\n @pic_spaces = PicSpace.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pic_spaces }\n end\n end",
"def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html { render layout: 'dialog'} # show.html.erb\n format.json { render json: @ship }\n end\n end",
"def get_space(opts = {})\n data, _status_code, _headers = get_space_with_http_info(opts)\n return data\n end",
"def show\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def show\n @ship_methods = ShipMethods.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship_methods }\n end\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def show\n can_edit = current_user && @space.editable_by_user?(current_user)\n has_proper_token = @space.shareable_link_enabled && @space.shareable_link_token == request.headers['HTTP_SHAREABLE_LINK_TOKEN']\n if @space.is_public? || can_edit || has_proper_token\n newSpace = @space\n newSpace.graph = @space.cleaned_graph\n render json: SpaceRepresenter.new(newSpace).to_json(\n user_options: {current_user_can_edit: can_edit, rendered_using_token: has_proper_token}\n )\n else\n head :unauthorized\n end\n end",
"def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url }\n format.json { head :no_content }\n end\n end",
"def set_ships_sub\n @ships_sub = ShipsSub.find(params[:id])\n end",
"def index\n @championships = Championship.all\n\n render json: @championships\n end",
"def index\n @ship_groups = ShipGroup.all\n end",
"def index\n @steamshiplines = Steamshipline.all\n end",
"def index\n @job_ships = JobShip.all\n @user = current_user\n end",
"def show\n @internships_user = InternshipsUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internships_user }\n end\n end",
"def index\n @space = Space.find(params[:space_id])\n @leases = Lease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leases }\n end\n end",
"def show\n render json: @championship\n end",
"def get_spaces_to_pass\n return nil unless @start_space\n return nil unless @end_space\n\n dijkstra = Dijkstra.new(SpaceConnection.all)\n path = dijkstra.shortest_path(@start_space.id, @end_space.id)\n path\n end",
"def create\n @space = Space.new(space_params)\n @space.user = current_user\n if @space.save\n render json: @space\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def index\n @internships = Internship.all\n @current_user = User.find(current_user.id)\n respond_with(@internships)\n end",
"def index\n @shipfleets = Shipfleet.all\n end",
"def index\n @spaces = Space.all\n\n # Index, downcase, and capitalize the categories\n dot_index = 0\n @spaces.group_by{|s| s.category.downcase}.each do |group|\n dot_color = Space.dot_colors[dot_index]\n group.last.each do |space|\n space.category = group.first.capitalize\n space.dot_color = dot_color\n end\n dot_index += 1\n end\n\n # Don't bother with generating markers for JSON\n respond_to do |format|\n format.html {\n\n @json = @spaces.to_gmaps4rails do |space, marker|\n marker.infowindow render_to_string(:partial => \"/spaces/marker\", :locals => { :space => space})\n marker.picture({\n :picture => \"http://maps.google.com/intl/en_us/mapfiles/ms/micons/#{space.dot_color}-dot.png\",\n :width => 32,\n :height => 32\n })\n marker.title space.name\n marker.json({ :id => space.id })\n end\n }\n format.json #render json\n end\n end",
"def show\n @shard = Shard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shard }\n end\n end",
"def show\n @championship = Championship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @championship }\n end\n end",
"def index\n @kinships = Kinship.all\n end",
"def new\n \n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ship }\n end\n end",
"def query_ships_at_a_port port_name\n Ship.joins(:ports).where(\"ports.name\" => port_name)\n end",
"def index\n #@shipments = Shipment.all\n @shipments = Shipment.accessible_by(current_ability)\n end",
"def index\n @space_stations = SpaceStation.all\n\n render json: @space_stations, include: :astronauts\n\n end",
"def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @friendships }\n end\n end",
"def destroy\n @ship_class = ShipClass.find(params[:id])\n @ship_class.destroy\n\n respond_to do |format|\n format.html { redirect_to ship_classes_url }\n format.json { head :no_content }\n end\n end",
"def spaces_list_with_http_info(account_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SpacesApi.spaces_list ...'\n end\n # verify the required parameter 'account_id' is set\n if @api_client.config.client_side_validation && account_id.nil?\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling SpacesApi.spaces_list\"\n end\n # resource path\n local_var_path = '/accounts/{account_id}/spaces'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Space>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SpacesApi#spaces_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n response = ::Phrase::Response.new(data, headers)\n return response, status_code, headers\n end",
"def show\n @game = Game.find(params[:id])\n @moves = @game.moves\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def set_ship\n @ship = Ship.find(params[:id])\n end"
] | [
"0.6912334",
"0.6850876",
"0.6655734",
"0.6593635",
"0.6593635",
"0.6578572",
"0.65641755",
"0.65522325",
"0.64784205",
"0.645288",
"0.6362502",
"0.6340898",
"0.6309388",
"0.624591",
"0.6204399",
"0.6168204",
"0.6147271",
"0.6136464",
"0.6070756",
"0.606848",
"0.60638136",
"0.6057336",
"0.6043964",
"0.5984949",
"0.5971305",
"0.59647006",
"0.596261",
"0.5919786",
"0.59114116",
"0.5901312",
"0.58542633",
"0.5850413",
"0.58484465",
"0.5838",
"0.58375835",
"0.5817789",
"0.5810312",
"0.5801966",
"0.5800232",
"0.5798347",
"0.5788388",
"0.5788388",
"0.57670337",
"0.5766208",
"0.57644385",
"0.5716182",
"0.5679422",
"0.5679422",
"0.5679422",
"0.56760645",
"0.56679595",
"0.56675434",
"0.5655247",
"0.56500036",
"0.56384087",
"0.5637097",
"0.5625323",
"0.56213474",
"0.5619213",
"0.56162876",
"0.5615166",
"0.56113267",
"0.5609655",
"0.5603185",
"0.5591978",
"0.5591161",
"0.55839765",
"0.5575129",
"0.5572608",
"0.5543317",
"0.55427253",
"0.5541796",
"0.5541796",
"0.55407447",
"0.5537916",
"0.5525283",
"0.5515536",
"0.55147123",
"0.5508753",
"0.5501893",
"0.5497027",
"0.549154",
"0.548386",
"0.5482723",
"0.548074",
"0.54778427",
"0.54682827",
"0.54676723",
"0.5461005",
"0.5457051",
"0.5455717",
"0.5451839",
"0.54320645",
"0.5424833",
"0.54225206",
"0.5421745",
"0.5420425",
"0.5416277",
"0.54158455",
"0.541488"
] | 0.749515 | 0 |
GET /spaceships/new GET /spaceships/new.json | def new
@spaceship = Spaceship.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @spaceship }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @spaceship = Spaceship.new(params[:spaceship])\n\n respond_to do |format|\n if @spaceship.save\n format.html { redirect_to @spaceship, notice: 'Spaceship was successfully created.' }\n format.json { render json: @spaceship, status: :created, location: @spaceship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spaceship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @space = Space.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @space }\n end\n end",
"def new\n \n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ship }\n end\n end",
"def new\n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ship }\n end\n end",
"def new\n @ship_class = ShipClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ship_class }\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to @space, notice: 'Space was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space }\n else\n format.html { render action: 'new' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(params[:space])\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to @space, notice: 'Space was successfully created.' }\n format.json { render json: @space, status: :created, location: @space }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n @space.user = current_user\n if @space.save\n render json: @space\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to root_path, notice: \"Space was successfully created.\" }\n format.json { render :show, status: :created, location: @space }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to spaces_path, notice: 'Friend was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space }\n else\n format.html { render action: 'new' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ship = Ship.new(params[:ship])\n respond_to do |format|\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @internship = Internship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @internship }\n end\n end",
"def new\n @internship = Internship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @internship }\n end\n end",
"def create\n @newspace = current_user.created_spaces.new(space_params)\n\n respond_to do |format|\n if @newspace.save && update_subscription(@newspace)\n\n current_user.spaces << @newspace # Creates the join record to add the admin to this space\n\n format.html { redirect_to space_members_path(@newspace), notice: 'Space was successfully created.' }\n format.json { render :show, status: :created, location: @newspace }\n else\n format.html { render :new }\n format.json { render json: @mewspace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @space_cat = SpaceCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @space_cat }\n end\n end",
"def create\n @internship = Internship.new(params[:internship])\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to @internship, notice: 'Internship was successfully created.' }\n format.json { render json: @internship, status: :created, location: @internship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @myspace = Myspace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @myspace }\n end\n end",
"def create\n @ship_class = ShipClass.new(params[:ship_class])\n\n respond_to do |format|\n if @ship_class.save\n format.html { redirect_to @ship_class, notice: 'Ship class was successfully created.' }\n format.json { render json: @ship_class, status: :created, location: @ship_class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @ship_methods = ShipMethods.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship_methods }\n end\n end",
"def new\n @battle = Battle.new\n @ships = Ship.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @battle }\n end\n end",
"def new_ambassadorship\n @ambassadorship = Ambassadorship.new(ambassadorship_params)\n end",
"def new\n if User.find(current_user.id).internship_authorization\n @internship = Internship.new\n respond_with(@internship)\n else\n flash[:notice] = \"You cannot create an internship\"\n redirect_to internships_url\n end\n end",
"def create\n @discipleship = Discipleship.new(discipleship_params)\n\n respond_to do |format|\n if @discipleship.save\n format.html { redirect_to @discipleship, notice: 'Discipleship was successfully created.' }\n format.json { render action: 'show', status: :created, location: @discipleship }\n else\n format.html { render action: 'new' }\n format.json { render json: @discipleship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = current_user\n @internship = @user.internships.build(params[:internship])\n #@internship = Internship.new(params[:internship])\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to @internship, notice: 'Internship was successfully created.' }\n format.json { render json: @internship, status: :created, location: @internship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @spaces_mine = Space.mine(current_user.id)\n raise Space::NotAllowed, '공간 생성 한도를 초과했습니다.' if over_space_limit\n @space = Space.new(space_params.merge(user_id: current_user.id))\n @space.save\n flash.now[:error] = @space.errors.messages[:url] if @space.errors.any?\n broadcast_create_space(@space)\n end",
"def create\n @spacecraft = Spacecraft.new(spacecraft_params)\n\n respond_to do |format|\n if @spacecraft.save\n format.html { redirect_to @spacecraft, notice: 'Spacecraft was successfully created.' }\n format.json { render action: 'show', status: :created, location: @spacecraft }\n else\n format.html { render action: 'new' }\n format.json { render json: @spacecraft.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @clientship = Clientship.new\n @users = User.all\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clientship }\n end\n end",
"def create\n @ship_methods = ShipMethods.new(params[:ship_methods])\n\n respond_to do |format|\n if @ship_methods.save\n flash[:notice] = 'ShipMethods was successfully created.'\n format.html { redirect_to(@ship_methods) }\n format.xml { render :xml => @ship_methods, :status => :created, :location => @ship_methods }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ship_methods.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spaceship }\n end\n end",
"def new\n @ship = Ship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def create\n @myspace = Myspace.new(params[:myspace])\n\n respond_to do |format|\n if @myspace.save\n format.html { redirect_to @myspace, notice: 'Myspace was successfully created.' }\n format.json { render json: @myspace, status: :created, location: @myspace }\n else\n format.html { render action: \"new\" }\n format.json { render json: @myspace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shipcount = Shipcount.new(shipcount_params)\n\n respond_to do |format|\n if @shipcount.save\n format.html { redirect_to @shipcount, notice: 'Shipcount was successfully created.' }\n format.json { render action: 'show', status: :created, location: @shipcount }\n else\n format.html { render action: 'new' }\n format.json { render json: @shipcount.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space_station = SpaceStation.new(space_station_params)\n\n if @space_station.save\n render json: @space_station, status: :created, location: @space_station\n else\n render json: @space_station.errors, status: :unprocessable_entity\n end\n end",
"def create\n @space = Space.new(space_params)\n @space.user = current_user\n\n if !space_params.has_key? :is_private\n @space.is_private = @space.user.prefers_private?\n if @space.organization\n @space.is_private = @space.is_private || @space.organization.prefers_private?\n end\n end\n\n if @space.save\n render json: SpaceRepresenter.new(@space).to_json(user_options: {current_user_can_edit: true})\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def new\n @ship = Ship.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship }\n end\n end",
"def create\n @ship = Ship.new(params[:ship])\n @ship.game_id = @game.id\n @ship.health = @ship.ship_type.length\n @ship.vertical = true\n @ship.player_id = @player.id\n\n respond_to do |format|\n if @ship.save\n format.html { redirect_to [@game, @ship], notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @player_ship = PlayerShip.new(player_ship_params)\n\n respond_to do |format|\n if @player_ship.save\n format.html { redirect_to @player_ship, notice: 'Player ship was successfully created.' }\n format.json { render :show, status: :created, location: @player_ship }\n else\n format.html { render :new }\n format.json { render json: @player_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @internship = Internship.new(params[:internship])\n \n respond_to do |format|\n if @internship.save\n format.html { redirect_to(@internship, :notice => 'Internship was successfully created.') }\n format.xml { render :xml => @internship, :status => :created, :location => @internship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ship = Ship.new(params[:ship])\n\n respond_to do |format|\n if @ship.save\n flash[:notice] = 'Ship was successfully created.'\n format.html { redirect_to(@ship) }\n format.xml { render :xml => @ship, :status => :created, :location => @ship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n \n @ship = current_user.create_ship(ship_params)\n \n\n respond_to do |format|\n if @ship!=nil\n current_user.activeShip = @ship.id\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render :show, status: :created, location: @ship }\n else\n format.html { render :new }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to ships_path, notice: 'Kauf nicht erfolgreich!' }\n \n end\n end\n end",
"def create\n @ship_placement = ShipPlacement.new(ship_placement_params)\n\n respond_to do |format|\n if @ship_placement.save\n format.html { redirect_to @ship_placement, notice: 'Ship placement was successfully created.' }\n format.json { render :show, status: :created, location: @ship_placement }\n else\n format.html { render :new }\n format.json { render json: @ship_placement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @open_space = current_user.open_spaces.new\n\n respond_to do |format|\n format.html { render :layout => false }# new.html.erb\n format.xml { render :xml => @open_space }\n end\n end",
"def new\n @mentorship = Mentorship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mentorship }\n end\n end",
"def new\n \t@internship_position = InternshipPosition.new\n\n \trespond_to do |format|\n \t\tformat.html #new.html.erb\n \t\tformat.json { render json: @internship_position }\n \tend\n end",
"def new\n authenticate_user!\n @server = Server.new\n @rackspace_servers = Server.rackspace_servers\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n end\n end",
"def new\n @shipping = scope.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shipping }\n end\n end",
"def create\n @friendship = @user.friendships.new(params[:friendship])\n\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to [@game, @user, @friendship], notice: 'Friendship was successfully created.' }\n format.json { render json: [@game, @user, @friendship], status: :created, location: [@game, @user, @friendship] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorization(\"create\")\n\n @sharespace = Sharespace.new(sharespace_params)\n\n respond_to do |format|\n if @sharespace.save\n format.html { redirect_to @sharespace, notice: 'Sharespace was successfully created.' }\n format.json { render :show, status: :created, location: @sharespace }\n else\n format.html { render :new }\n format.json { render json: @sharespace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @shipdesign = Shipdesign.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shipdesign }\n end\n end",
"def create\n @space_cat = SpaceCat.new(params[:space_cat])\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render json: @space_cat, status: :created, location: @space_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @shipment = Shipment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shipment }\n end\n end",
"def new\n @pic_space = PicSpace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pic_space }\n end\n end",
"def new\n @space = Space.new\n end",
"def create\n @shiping = Shiping.new(shiping_params)\n @user = current_user\n\n respond_to do |format|\n if @shiping.save\n format.html { redirect_to @shiping, notice: 'Shiping was successfully created.' }\n format.json { render :show, status: :created, location: @shiping }\n else\n format.html { render :new }\n format.json { render json: @shiping.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shipfleet = Shipfleet.new(shipfleet_params)\n\n respond_to do |format|\n if @shipfleet.save\n format.html { redirect_to @shipfleet, notice: 'Shipfleet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @shipfleet }\n else\n format.html { render action: 'new' }\n format.json { render json: @shipfleet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space_cat = SpaceCat.new(space_cat_params)\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space_cat }\n else\n format.html { render action: 'new' }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_game \n\t\t@game = create_game message[:player], message[:ships]\n\t\tWebsocketRails[:updates].trigger(:created_game, @game)\n\tend",
"def new\n @monitorship = Monitorship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @monitorship }\n end\n end",
"def create\n @mentorship = Mentorship.new(params[:mentorship])\n\n respond_to do |format|\n if @mentorship.save\n format.html { redirect_to mentorships_url, notice: 'Mentorship was successfully created.' }\n format.json { render json: @mentorship, status: :created, location: @mentorship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mentorship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @shipment = Shipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shipment }\n end\n end",
"def new\n @shipment = Shipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shipment }\n end\n end",
"def create\n @cartship = Cartship.new(cartship_params)\n\n respond_to do |format|\n if @cartship.save\n format.html { redirect_to @cartship, notice: 'Cartship criado com sucesso.' }\n format.json { render :show, status: :created, location: @cartship }\n else\n format.html { render :new }\n format.json { render json: @cartship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space_reservation = SpaceReservation.new(space_reservation_params)\n\n respond_to do |format|\n if @space_reservation.save\n format.html { redirect_to @space_reservation, notice: 'Space reservation was successfully created.' }\n format.json { render :show, status: :created, location: @space_reservation }\n else\n format.html { render :new }\n format.json { render json: @space_reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @internships_user = InternshipsUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @internships_user }\n end\n end",
"def create\n @space_form = Space::Form.new(space: current_team.spaces.new,\n user: current_user,\n attributes: space_params)\n\n authorize @space_form.space, :create?\n\n respond_to do |format|\n if @space_form.save\n format.html do\n redirect_to case\n when @space_form.space.access_control.private? then space_members_path(@space_form.space)\n else space_pages_path(@space_form.space)\n end\n end\n format.json { render :show, status: :created, location: @space_form.space }\n else\n format.html { render :new }\n format.json { render json: @space_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @shard = Shard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shard }\n end\n end",
"def new\n @gossip = Gossip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gossip }\n end\n end",
"def create\n @space_type = SpaceType.new(space_type_params)\n authorize! :create, @space_type\n\n respond_to do |format|\n if @space_type.save\n format.html { redirect_to @space_type, notice: t('.create_ok') }\n format.json { render action: 'show', status: :created, location: @space_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @space_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @open_space = current_user.open_spaces.new(params[:open_space])\n\n respond_to do |format|\n if (@open_space && @open_space.save)\n format.html { redirect_to(@open_space, :notice => 'Open space was successfully created.') }\n format.xml { render :xml => @open_space, :status => :created, :location => @open_space }\n format.js \n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @open_space.errors, :status => :unprocessable_entity }\n format.js { render :json => @open_space.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def load_spaceship\n @Spaceship = Spaceship.find(params[:id])\n end",
"def create\n group = Group.find(params[:group_id])\n unless @current_user.id == group.user_id\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n @space = Space.new(space_params)\n if @space.save\n render json: @space, status: :created\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def create\n @fleet_ship = FleetShip.new(fleet_ship_params)\n\n respond_to do |format|\n if @fleet_ship.save\n format.html { redirect_to @fleet_ship, notice: 'Fleet ship was successfully created.' }\n format.json { render :show, status: :created, location: @fleet_ship }\n else\n format.html { render :new }\n format.json { render json: @fleet_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @spawner = Spawner.new\n @fieldtrips = Fieldtrip.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spawner }\n end\n end",
"def destroy\n @spaceship = Spaceship.find(params[:id])\n @spaceship.destroy\n\n respond_to do |format|\n format.html { redirect_to spaceships_url }\n format.json { head :no_content }\n end\n end",
"def create\n @township = Township.new(township_params)\n\n respond_to do |format|\n if @township.save\n format.html { redirect_to @township, notice: 'Township was successfully created.' }\n format.json { render :show, status: :created, location: @township }\n else\n format.html { render :new }\n format.json { render json: @township.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @manifestship = Manifestship.new(manifestship_params)\n\n respond_to do |format|\n if @manifestship.save\n format.html { redirect_to @manifestship, notice: 'Manifestship was successfully created.' }\n format.json { render :show, status: :created, location: @manifestship }\n else\n format.html { render :new }\n format.json { render json: @manifestship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @max_ships=50 \n @ship_group = ShipGroup.new(ship_group_params)\n @ship_name =Unit.find(@ship_group.unit_id).name\n respond_to do |format|\n if @ship_group.save\n format.html { redirect_to @ship_group, notice: 'Ship group was successfully created.' }\n format.json { render :show, status: :created, location: @ship_group }\n else\n format.html { render :new }\n format.json { render json: @ship_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @safe_space = SafeSpace.new(safe_space_params)\n\n respond_to do |format|\n if @safe_space.save\n format.html { redirect_to @safe_space, notice: 'Safe space was successfully created.' }\n format.json { render :show, status: :created, location: @safe_space }\n else\n format.html { render :new }\n format.json { render json: @safe_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @office_space = OfficeSpace.new(office_space_params)\n\n respond_to do |format|\n if @office_space.save\n format.html { redirect_to @office_space, notice: 'Office space was successfully created.' }\n format.json { render :show, status: :created, location: @office_space }\n else\n format.html { render :new }\n format.json { render json: @office_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clientship = current_user.clientships.build(:client_id => params[:client_id], :fee => params[:fee])\n\n respond_to do |format|\n if @clientship.save\n format.html { redirect_to @clientship, notice: 'Clientship was successfully created.' }\n format.json { render json: @clientship, status: :created, location: @clientship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clientship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @monitorship = Monitorship.new(params[:monitorship])\n\n respond_to do |format|\n if @monitorship.save\n format.html { redirect_to @monitorship, notice: 'Monitorship was successfully created.' }\n format.json { render json: @monitorship, status: :created, location: @monitorship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @monitorship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_shippment(items)\n fill_boxes(items)\n shippment_object\n make_json_object\n end",
"def new\n @friendship = Friendship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friendship }\n end\n end",
"def new\n @friendship = Friendship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friendship }\n end\n end",
"def new\n @sprint = Sprint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sprint }\n end\n end",
"def new\n @stashed_inventory = StashedInventory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stashed_inventory }\n end\n end",
"def create\n @space_user = SpaceUser.new(params[:space_user])\n\n respond_to do |format|\n if @space_user.save\n format.html { redirect_to space_users_path, notice: 'Space user was successfully created.' }\n format.json { render json: @space_user, status: :created, location: @space_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @society_member_ship = SocietyMemberShip.new(society_member_ship_params)\n\n respond_to do |format|\n if @society_member_ship.save\n format.html { redirect_to @society_member_ship, notice: 'Society member ship was successfully created.' }\n format.json { render :show, status: :created, location: @society_member_ship }\n else\n format.html { render :new }\n format.json { render json: @society_member_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @stone = Stone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stone }\n end\n end",
"def create\n @ship_armor_slot = ShipArmorSlot.new(ship_armor_slot_params)\n\n respond_to do |format|\n if @ship_armor_slot.save\n format.html { redirect_to @ship_armor_slot, notice: 'Ship armor slot was successfully created.' }\n format.json { render :show, status: :created, location: @ship_armor_slot }\n else\n format.html { render :new }\n format.json { render json: @ship_armor_slot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @routing = Routing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @routing }\n end\n end",
"def create\n @job_ship = JobShip.new(job_ship_params)\n if @job_ship.save\n redirect_to @job_ship, notice: 'Job ship was successfully created.'\n else\n render 'new'\n end\n end",
"def new\n @space_user = SpaceUser.new\n @space_user.space_id = current_space.id\n @space_user.user_id = params[:user_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @space_user }\n end\n end",
"def new\n @shift = Shift.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shift }\n end\n end",
"def new\n @primary = current_user\n @friendship = Friendship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friendship }\n end\n end",
"def create\n @shipdesign = Shipdesign.new(params[:shipdesign])\n\n respond_to do |format|\n if @shipdesign.save\n format.html { redirect_to @shipdesign, notice: 'Shipdesign was successfully created.' }\n format.json { render json: @shipdesign, status: :created, location: @shipdesign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shipdesign.errors, status: :unprocessable_entity }\n end\n end\n end",
"def friendships_create(options = {})\n @req.post(\"/1.1/friendships/create.json\", options)\n end",
"def index\n @ships = Ship.all\n end",
"def index\n @ships = Ship.all\n end",
"def create\n @game = Game.new(game_params)\n\n @game.save\n\n old_map = Map.find(params[:game][:map_id]) \n @game.map = old_map.dup\n old_map.spaces.each do |old_space|\n new_space = old_space.dup\n @game.map.spaces << new_space\n end\n @game.map.save\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.7296353",
"0.6984411",
"0.69628364",
"0.6823614",
"0.6733631",
"0.6665979",
"0.66434836",
"0.65606123",
"0.6524445",
"0.6505506",
"0.6435907",
"0.6389318",
"0.6389318",
"0.63241774",
"0.629617",
"0.6291355",
"0.6264541",
"0.62360275",
"0.62093776",
"0.6184651",
"0.6151153",
"0.61313283",
"0.6105895",
"0.60857946",
"0.60722226",
"0.6062269",
"0.60601324",
"0.60579824",
"0.60348475",
"0.6026668",
"0.6009736",
"0.60031563",
"0.6002965",
"0.59998167",
"0.59980756",
"0.5991887",
"0.5951931",
"0.5930232",
"0.59279734",
"0.5906924",
"0.5905569",
"0.59051466",
"0.5904372",
"0.5891374",
"0.58840925",
"0.5874269",
"0.58740145",
"0.58738476",
"0.5871998",
"0.5871075",
"0.5869292",
"0.58678573",
"0.58631146",
"0.5861127",
"0.58524084",
"0.58506",
"0.5841528",
"0.5838443",
"0.5837623",
"0.5834288",
"0.5834288",
"0.5833498",
"0.58302003",
"0.58266175",
"0.58211625",
"0.5816199",
"0.58103704",
"0.5785287",
"0.5783883",
"0.57831717",
"0.5776259",
"0.57712793",
"0.57640797",
"0.57438946",
"0.5742393",
"0.57329017",
"0.5723939",
"0.5697451",
"0.56951976",
"0.56862277",
"0.5685728",
"0.568568",
"0.56802213",
"0.56802213",
"0.56721556",
"0.5642876",
"0.56352997",
"0.5613996",
"0.5595488",
"0.5594559",
"0.55908555",
"0.55908006",
"0.55755097",
"0.55723274",
"0.55685866",
"0.5552195",
"0.55515504",
"0.5523894",
"0.5523894",
"0.5517757"
] | 0.76457113 | 0 |
POST /spaceships POST /spaceships.json | def create
@spaceship = Spaceship.new(params[:spaceship])
respond_to do |format|
if @spaceship.save
format.html { redirect_to @spaceship, notice: 'Spaceship was successfully created.' }
format.json { render json: @spaceship, status: :created, location: @spaceship }
else
format.html { render action: "new" }
format.json { render json: @spaceship.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @space = Space.new(space_params)\n @space.user = current_user\n if @space.save\n render json: @space\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to @space, notice: 'Space was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space }\n else\n format.html { render action: 'new' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to root_path, notice: \"Space was successfully created.\" }\n format.json { render :show, status: :created, location: @space }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(params[:space])\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to @space, notice: 'Space was successfully created.' }\n format.json { render json: @space, status: :created, location: @space }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ship = Ship.new(params[:ship])\n respond_to do |format|\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to spaces_path, notice: 'Friend was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space }\n else\n format.html { render action: 'new' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ship = Ship.new(params[:ship])\n @ship.game_id = @game.id\n @ship.health = @ship.ship_type.length\n @ship.vertical = true\n @ship.player_id = @player.id\n\n respond_to do |format|\n if @ship.save\n format.html { redirect_to [@game, @ship], notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ship_params\n params.require(:ship).permit(:name, :ships_id, :stations_id, :level, :activeShip)\n end",
"def create\n \n @ship = current_user.create_ship(ship_params)\n \n\n respond_to do |format|\n if @ship!=nil\n current_user.activeShip = @ship.id\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render :show, status: :created, location: @ship }\n else\n format.html { render :new }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to ships_path, notice: 'Kauf nicht erfolgreich!' }\n \n end\n end\n end",
"def destroy\n @spaceship = Spaceship.find(params[:id])\n @spaceship.destroy\n\n respond_to do |format|\n format.html { redirect_to spaceships_url }\n format.json { head :no_content }\n end\n end",
"def ship_params\n params.require(:ship).permit(:name, :crew, :has_astromech, :speed, :armament,\n pilots_attributes: [:id, :_destroy, :first_name, :last_name, :call_sign])\n end",
"def create\n @newspace = current_user.created_spaces.new(space_params)\n\n respond_to do |format|\n if @newspace.save && update_subscription(@newspace)\n\n current_user.spaces << @newspace # Creates the join record to add the admin to this space\n\n format.html { redirect_to space_members_path(@newspace), notice: 'Space was successfully created.' }\n format.json { render :show, status: :created, location: @newspace }\n else\n format.html { render :new }\n format.json { render json: @mewspace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space_station = SpaceStation.new(space_station_params)\n\n if @space_station.save\n render json: @space_station, status: :created, location: @space_station\n else\n render json: @space_station.errors, status: :unprocessable_entity\n end\n end",
"def create\n @player_ship = PlayerShip.new(player_ship_params)\n\n respond_to do |format|\n if @player_ship.save\n format.html { redirect_to @player_ship, notice: 'Player ship was successfully created.' }\n format.json { render :show, status: :created, location: @player_ship }\n else\n format.html { render :new }\n format.json { render json: @player_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def createShips\n for ship in Ship.find(:all, :order => \"id\")\n self.my_ships.build(ship_id: ship.id)\n self.enemy_ships.build(ship_id: ship.id)\n end\n self.save\n end",
"def create\n \n @ship = Ship.new(params[:ship])\n @ship.character_id = session[:character_id]\n @ship.port_id = 7\n @ship.save\n \n @ship_attribute = ShipAttribute.new()\n @ship_attribute.ship_id = @ship.id\n @ship_attribute.cargo = 100\n @ship_attribute.weapon_slot = 2\n @ship_attribute.mast_slot = 2\n @ship_attribute.crew_slot = 1\n @ship_attribute.custom_slot = 0\n @ship_attribute.rudder_slot = 1\n @ship_attribute.structure = 50\n @ship.update_attribute(:curr_hp, \"#{@ship_attribute.structure}\")\n \n @ship.create_std_items\n \n respond_to do |format|\n @ship_attribute.save\n session.delete(:registering)\n session[:character_id] = nil\n flash[:notice] = 'Ship was successfully created.'\n format.html { redirect_to(@ship) }\n format.xml { render :xml => @ship, :status => :created, :location => @ship }\n end\n end",
"def create\n @spaces_mine = Space.mine(current_user.id)\n raise Space::NotAllowed, '공간 생성 한도를 초과했습니다.' if over_space_limit\n @space = Space.new(space_params.merge(user_id: current_user.id))\n @space.save\n flash.now[:error] = @space.errors.messages[:url] if @space.errors.any?\n broadcast_create_space(@space)\n end",
"def create\n @safe_space = SafeSpace.new(safe_space_params)\n\n respond_to do |format|\n if @safe_space.save\n format.html { redirect_to @safe_space, notice: 'Safe space was successfully created.' }\n format.json { render :show, status: :created, location: @safe_space }\n else\n format.html { render :new }\n format.json { render json: @safe_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @spaceship = Spaceship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spaceship }\n end\n end",
"def create\n \n @max_ships=50 \n @ship_group = ShipGroup.new(ship_group_params)\n @ship_name =Unit.find(@ship_group.unit_id).name\n respond_to do |format|\n if @ship_group.save\n format.html { redirect_to @ship_group, notice: 'Ship group was successfully created.' }\n format.json { render :show, status: :created, location: @ship_group }\n else\n format.html { render :new }\n format.json { render json: @ship_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n @space.user = current_user\n\n if !space_params.has_key? :is_private\n @space.is_private = @space.user.prefers_private?\n if @space.organization\n @space.is_private = @space.is_private || @space.organization.prefers_private?\n end\n end\n\n if @space.save\n render json: SpaceRepresenter.new(@space).to_json(user_options: {current_user_can_edit: true})\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def create\n group = Group.find(params[:group_id])\n unless @current_user.id == group.user_id\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n @space = Space.new(space_params)\n if @space.save\n render json: @space, status: :created\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def create\n @ship_class = ShipClass.new(params[:ship_class])\n\n respond_to do |format|\n if @ship_class.save\n format.html { redirect_to @ship_class, notice: 'Ship class was successfully created.' }\n format.json { render json: @ship_class, status: :created, location: @ship_class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ship_placement = ShipPlacement.new(ship_placement_params)\n\n respond_to do |format|\n if @ship_placement.save\n format.html { redirect_to @ship_placement, notice: 'Ship placement was successfully created.' }\n format.json { render :show, status: :created, location: @ship_placement }\n else\n format.html { render :new }\n format.json { render json: @ship_placement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @internship = Internship.new(params[:internship])\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to @internship, notice: 'Internship was successfully created.' }\n format.json { render json: @internship, status: :created, location: @internship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_shippment(items)\n fill_boxes(items)\n shippment_object\n make_json_object\n end",
"def create\n @fleet_ship = FleetShip.new(fleet_ship_params)\n\n respond_to do |format|\n if @fleet_ship.save\n format.html { redirect_to @fleet_ship, notice: 'Fleet ship was successfully created.' }\n format.json { render :show, status: :created, location: @fleet_ship }\n else\n format.html { render :new }\n format.json { render json: @fleet_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space_form = Space::Form.new(space: current_team.spaces.new,\n user: current_user,\n attributes: space_params)\n\n authorize @space_form.space, :create?\n\n respond_to do |format|\n if @space_form.save\n format.html do\n redirect_to case\n when @space_form.space.access_control.private? then space_members_path(@space_form.space)\n else space_pages_path(@space_form.space)\n end\n end\n format.json { render :show, status: :created, location: @space_form.space }\n else\n format.html { render :new }\n format.json { render json: @space_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"def make\n @spaces.each { |position| position.occupied = true }\n # pp \"made ship: #{@spaces}\"\n end",
"def create\n @discipleship = Discipleship.new(discipleship_params)\n\n respond_to do |format|\n if @discipleship.save\n format.html { redirect_to @discipleship, notice: 'Discipleship was successfully created.' }\n format.json { render action: 'show', status: :created, location: @discipleship }\n else\n format.html { render action: 'new' }\n format.json { render json: @discipleship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shiping = Shiping.new(shiping_params)\n @user = current_user\n\n respond_to do |format|\n if @shiping.save\n format.html { redirect_to @shiping, notice: 'Shiping was successfully created.' }\n format.json { render :show, status: :created, location: @shiping }\n else\n format.html { render :new }\n format.json { render json: @shiping.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @space.update(space_params)\n render json: @space, status: :ok\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def create\n @shipfleet = Shipfleet.new(shipfleet_params)\n\n respond_to do |format|\n if @shipfleet.save\n format.html { redirect_to @shipfleet, notice: 'Shipfleet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @shipfleet }\n else\n format.html { render action: 'new' }\n format.json { render json: @shipfleet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @spacecraft = Spacecraft.new(spacecraft_params)\n\n respond_to do |format|\n if @spacecraft.save\n format.html { redirect_to @spacecraft, notice: 'Spacecraft was successfully created.' }\n format.json { render action: 'show', status: :created, location: @spacecraft }\n else\n format.html { render action: 'new' }\n format.json { render json: @spacecraft.errors, status: :unprocessable_entity }\n end\n end\n end",
"def fleet_ship_params\n params.require(:fleet_ship).permit(:ship_id, :fleet_id)\n end",
"def create_space_with_http_info(create_space_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SpacesApi.create_space ...'\n end\n # verify the required parameter 'create_space_request' is set\n if @api_client.config.client_side_validation && create_space_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_space_request' when calling SpacesApi.create_space\"\n end\n # resource path\n local_var_path = '/video/v1/spaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_space_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'SpaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['accessToken']\n\n new_options = opts.merge(\n :operation => :\"SpacesApi.create_space\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SpacesApi#create_space\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @ship = Ship.new(params[:ship])\n\n respond_to do |format|\n if @ship.save\n flash[:notice] = 'Ship was successfully created.'\n format.html { redirect_to(@ship) }\n format.xml { render :xml => @ship, :status => :created, :location => @ship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = current_user\n @internship = @user.internships.build(params[:internship])\n #@internship = Internship.new(params[:internship])\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to @internship, notice: 'Internship was successfully created.' }\n format.json { render json: @internship, status: :created, location: @internship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n if @spaceship.update_attributes(params[:spaceship])\n format.html { redirect_to @spaceship, notice: 'Spaceship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spaceship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space_reservation = SpaceReservation.new(space_reservation_params)\n\n respond_to do |format|\n if @space_reservation.save\n format.html { redirect_to @space_reservation, notice: 'Space reservation was successfully created.' }\n format.json { render :show, status: :created, location: @space_reservation }\n else\n format.html { render :new }\n format.json { render json: @space_reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ship_methods = ShipMethods.new(params[:ship_methods])\n\n respond_to do |format|\n if @ship_methods.save\n flash[:notice] = 'ShipMethods was successfully created.'\n format.html { redirect_to(@ship_methods) }\n format.xml { render :xml => @ship_methods, :status => :created, :location => @ship_methods }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ship_methods.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def job_ship_params\n params.require(:ship).permit(:ship_id, :job_id, :user_id)\n end",
"def create\n @office_space = OfficeSpace.new(office_space_params)\n\n respond_to do |format|\n if @office_space.save\n format.html { redirect_to @office_space, notice: 'Office space was successfully created.' }\n format.json { render :show, status: :created, location: @office_space }\n else\n format.html { render :new }\n format.json { render json: @office_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @society_member_ship = SocietyMemberShip.new(society_member_ship_params)\n\n respond_to do |format|\n if @society_member_ship.save\n format.html { redirect_to @society_member_ship, notice: 'Society member ship was successfully created.' }\n format.json { render :show, status: :created, location: @society_member_ship }\n else\n format.html { render :new }\n format.json { render json: @society_member_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @township = Township.new(township_params)\n\n respond_to do |format|\n if @township.save\n format.html { redirect_to @township, notice: 'Township was successfully created.' }\n format.json { render :show, status: :created, location: @township }\n else\n format.html { render :new }\n format.json { render json: @township.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorization(\"create\")\n\n @sharespace = Sharespace.new(sharespace_params)\n\n respond_to do |format|\n if @sharespace.save\n format.html { redirect_to @sharespace, notice: 'Sharespace was successfully created.' }\n format.json { render :show, status: :created, location: @sharespace }\n else\n format.html { render :new }\n format.json { render json: @sharespace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @friendship = @user.friendships.new(params[:friendship])\n\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to [@game, @user, @friendship], notice: 'Friendship was successfully created.' }\n format.json { render json: [@game, @user, @friendship], status: :created, location: [@game, @user, @friendship] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ship_placement_params\n params.require(:ship_placement).permit(:ship_id, :game_id, :top_left_value, :orientation)\n end",
"def create\n @myspace = Myspace.new(params[:myspace])\n\n respond_to do |format|\n if @myspace.save\n format.html { redirect_to @myspace, notice: 'Myspace was successfully created.' }\n format.json { render json: @myspace, status: :created, location: @myspace }\n else\n format.html { render action: \"new\" }\n format.json { render json: @myspace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def space_params\n params.require(:space).permit(:name, :spaceType, :multiplier, :area)\n end",
"def create\n @space = current_user.spaces.build(space_params)\n @space.photos << Photo.where(space_token: @space.token)\n\n respond_to do |format|\n if @space.save\n flash[:success] = \"空间创建成功\"\n format.html { redirect_to @space }\n format.json { render :show, status: :created, location: @space }\n else\n format.html { render :new }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space_user = SpaceUser.new(params[:space_user])\n\n respond_to do |format|\n if @space_user.save\n format.html { redirect_to space_users_path, notice: 'Space user was successfully created.' }\n format.json { render json: @space_user, status: :created, location: @space_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shipcount = Shipcount.new(shipcount_params)\n\n respond_to do |format|\n if @shipcount.save\n format.html { redirect_to @shipcount, notice: 'Shipcount was successfully created.' }\n format.json { render action: 'show', status: :created, location: @shipcount }\n else\n format.html { render action: 'new' }\n format.json { render json: @shipcount.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @manifestship = Manifestship.new(manifestship_params)\n\n respond_to do |format|\n if @manifestship.save\n format.html { redirect_to @manifestship, notice: 'Manifestship was successfully created.' }\n format.json { render :show, status: :created, location: @manifestship }\n else\n format.html { render :new }\n format.json { render json: @manifestship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def build_ships\n 5.times do\n ship = self.ships.build\n ship.populate\n end\n end",
"def place_ships_on_the_field ships, field\n\t\tships.each do |ship|\n\t\t\tif ship.to_i == 10 then field[ship] = Symbols::SHIP + ' '\n\t\t\telse field[ship] = Symbols::SHIP\n\t\t\tend\n\t\tend\n\tend",
"def create\n @ship_armor_slot = ShipArmorSlot.new(ship_armor_slot_params)\n\n respond_to do |format|\n if @ship_armor_slot.save\n format.html { redirect_to @ship_armor_slot, notice: 'Ship armor slot was successfully created.' }\n format.json { render :show, status: :created, location: @ship_armor_slot }\n else\n format.html { render :new }\n format.json { render json: @ship_armor_slot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def shipfleet_params\n params.require(:shipfleet).permit(:ship_id, :fleet_id, :amount)\n end",
"def create \n @mentorship = Mentorship.new(params[:mentorship])\n \n # REFACTOR: This probably belongs in the model\n # Instead of having a separate params[:skills] should just have params[:mentorship][:skills]\n # And handle all this skill setting in the model.\n skills = []\n params[:skills].keys.each do |skill_id|\n skill = Skill.find(skill_id)\n skills << skill\n end\n @mentorship.skills = skills\n\n respond_to do |format|\n if @mentorship.save\n flash[:notice] = 'Mentorship was successfully created.'\n format.html { redirect_to created_mentorship_url(@mentorship) }\n format.xml { render :xml => @mentorship, :status => :created, :location => @mentorship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mentorship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def load_spaceship\n @Spaceship = Spaceship.find(params[:id])\n end",
"def ships_sub_params\n params.require(:ships_sub).permit(:name)\n end",
"def create\n @mentorship = Mentorship.new(params[:mentorship])\n\n respond_to do |format|\n if @mentorship.save\n format.html { redirect_to mentorships_url, notice: 'Mentorship was successfully created.' }\n format.json { render json: @mentorship, status: :created, location: @mentorship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mentorship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def fill_field\n SHIPS.each { |size| put_ship(size) }\n end",
"def create\n @space_type = SpaceType.new(space_type_params)\n authorize! :create, @space_type\n\n respond_to do |format|\n if @space_type.save\n format.html { redirect_to @space_type, notice: t('.create_ok') }\n format.json { render action: 'show', status: :created, location: @space_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @space_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cartship = Cartship.new(cartship_params)\n\n respond_to do |format|\n if @cartship.save\n format.html { redirect_to @cartship, notice: 'Cartship criado com sucesso.' }\n format.json { render :show, status: :created, location: @cartship }\n else\n format.html { render :new }\n format.json { render json: @cartship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @internship = Internship.new(params[:internship])\n \n respond_to do |format|\n if @internship.save\n format.html { redirect_to(@internship, :notice => 'Internship was successfully created.') }\n format.xml { render :xml => @internship, :status => :created, :location => @internship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def space_params\n params.require(:space).permit(:name, :image, :detail, :facility_id, :image_cache, :remove_image)\n end",
"def create\n @monitorship = Monitorship.new(params[:monitorship])\n\n respond_to do |format|\n if @monitorship.save\n format.html { redirect_to @monitorship, notice: 'Monitorship was successfully created.' }\n format.json { render json: @monitorship, status: :created, location: @monitorship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @monitorship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n @game.save\n\n old_map = Map.find(params[:game][:map_id]) \n @game.map = old_map.dup\n old_map.spaces.each do |old_space|\n new_space = old_space.dup\n @game.map.spaces << new_space\n end\n @game.map.save\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spaceship }\n end\n end",
"def create\n @open_space = current_user.open_spaces.new(params[:open_space])\n\n respond_to do |format|\n if (@open_space && @open_space.save)\n format.html { redirect_to(@open_space, :notice => 'Open space was successfully created.') }\n format.xml { render :xml => @open_space, :status => :created, :location => @open_space }\n format.js \n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @open_space.errors, :status => :unprocessable_entity }\n format.js { render :json => @open_space.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @ship.destroy\n respond_to do |format|\n format.html { redirect_to ships_url, notice: 'Ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @shipdesign = Shipdesign.new(params[:shipdesign])\n\n respond_to do |format|\n if @shipdesign.save\n format.html { redirect_to @shipdesign, notice: 'Shipdesign was successfully created.' }\n format.json { render json: @shipdesign, status: :created, location: @shipdesign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shipdesign.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @job_ship = JobShip.new(job_ship_params)\n if @job_ship.save\n redirect_to @job_ship, notice: 'Job ship was successfully created.'\n else\n render 'new'\n end\n end",
"def friendships_create(options = {})\n @req.post(\"/1.1/friendships/create.json\", options)\n end",
"def create\n @ship_fitting = ShipFitting.new(ship_fitting_params)\n\n respond_to do |format|\n if @ship_fitting.save\n format.html { redirect_to @ship_fitting, notice: 'Ship fitting was successfully created.' }\n format.json { render :show, status: :created, location: @ship_fitting }\n else\n format.html { render :new }\n format.json { render json: @ship_fitting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def spacecraft_params\n params.require(:spacecraft).permit(:name, :crew, :lat, :long)\n end",
"def destroy\n @discipleship.destroy\n respond_to do |format|\n format.html { redirect_to discipleships_url }\n format.json { head :no_content }\n end\n end",
"def create\n @shipment = Shipment.new(shipment_params)\n\n if @shipment.save\n render json: @shipment\n else\n render json: @shipment.errors, status: :unprocessable_entity\n end\n end",
"def cartship_params\n params.require(:cartship).permit(:cart_id, :product_id, :quantity)\n end",
"def create\n @clientship = current_user.clientships.build(:client_id => params[:client_id], :fee => params[:fee])\n\n respond_to do |format|\n if @clientship.save\n format.html { redirect_to @clientship, notice: 'Clientship was successfully created.' }\n format.json { render json: @clientship, status: :created, location: @clientship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clientship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def place_ships!\n\t\t[\n\t\t\t['T', 2],\n\t\t\t['D', 3],\n\t\t\t['S', 3],\n\t\t\t['B', 4],\n\t\t\t['C', 5]\n\t\t].each do |ship|\n\t\t\tplace_ship(ship[0], ship[1])\n\t\tend\n\tend",
"def add_ship(a_ship)\n\tres = [a_ship]\n\tif(ships.size < 0)\n\t\tships = ships + res\n else\n\t\tset_ships(res)\n\tend\n end",
"def create\n space = Space.find(params[:space_id])\n group = Group.find(space.group_id)\n group_member_ids = Member.where(group_id: group.id).pluck(:user_id)\n unless group_member_ids.include?(@current_user.id)\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n @reservation = Reservation.new(reservation_params)\n\n if @reservation.save\n render json: @reservation, status: :created\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end",
"def player_ship_params\n params.require(:player_ship).permit(:captain_id, :ship_id, :name, :fuel_total, :fuel_remaining, :cargo_spaces, :fighters)\n end",
"def destroy\n @player_ship.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_url, notice: 'Player ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def shiping_params\n params.require(:shiping).permit(:title, :description, :dizhi, :user_id)\n end",
"def create\n @space_cat = SpaceCat.new(space_cat_params)\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space_cat }\n else\n format.html { render action: 'new' }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def index\n @ships = Ship.all\n end",
"def index\n @ships = Ship.all\n end",
"def create\n @internship = Internship.new(params[:internship])\n @internship.description.strip!\n @internship.owner_hash = cookies[:hash] \n \n fields = params[:fields].split(\",\")\n fields.each do |desc|\n @internship.fields << Field.new(:description => desc.strip)\n end\n\n respond_to do |format|\n if @internship.save\n #format.html { redirect_to @internship }\n format.js\n #format.json { render :json => @internship, :status => :created, :location => @internship }\n else\n format.js {render :action => :create_error }\n #format.html { render :json => @internship.errors, :status => :unprocessable_entity }\n end\n end \n end",
"def create\n @space_cat = SpaceCat.new(params[:space_cat])\n\n respond_to do |format|\n if @space_cat.save\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully created.' }\n format.json { render json: @space_cat, status: :created, location: @space_cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def place_ships(ships, board)\n placed = []\n rows = board.size\n cols = board.first.size\n\n while ships.any?\n length = ships.first\n orientation = rand(2) == 0 ? 'h' : 'v'\n\n if orientation == 'h'\n height = 1\n width = length\n else\n height = length\n width = 1\n end\n\n x = rand(cols - width)\n y = rand(rows - height)\n ship = Ship.new(x, y, orientation, length)\n\n if ship.coords.none? { |x, y| placed.map(&:coords).flatten(1).include? [x, y] }\n placed << ship\n ships.shift\n end\n end\n\n placed\n end",
"def update_ships\n # A data structure to store the ships in\n\n ships = [\n [\"Brittana\", [\"Brittany P.\", \"Santana L.\"]],\n [\"Faberry\", [\"Quinn F.\", \"Rachel B.\"]],\n [\"Flanamotta\", [\"Rory F.\", \"Sugar\"]],\n [\"Sory\", [\"Rory F.\", \"Sam E.\"]],\n [\"Seblaine\", [\"Sebastian S.\", \"Blaine A.\"]],\n [\"Santofsky\", [\"D. Karofsky\", \"Santana L.\"]],\n [\"Bartie\", [\"Brittany P.\", \"Artie A.\"]],\n [\"Tike\", [\"Mike C.\", \"Tina C.\"]],\n [\"Pezberry\", [\"Santana L.\", \"Rachel B.\"]],\n [\"Pizes\", [\"Lauren Z.\", \"Puck\"]],\n [\"St. Berry\", [\"Jesse sJ.\", \"Rachel B.\"]],\n [\"Kill\", [\"Kurt H.\", \"Will S.\"]],\n [\"Puckurt\", [\"Kurt H.\", \"Puck\"]],\n [\"Artina\", [\"Tina C.\", \"Artie A.\"]],\n [\"Partie\", [\"Puck\", \"Artie A.\"]],\n [\"Blainofskyve\", [\"Blaine A.\", \"D. Karofsky\"]],\n [\"Klaine\", [\"Kurt H.\", \"Blaine A.\"]],\n [\"Hummelberry\", [\"Kurt H.\", \"Rachel B.\"]],\n [\"Furt\", [\"Kurt H.\", \"Finn H.\"]],\n [\"Pinn\", [\"Puck\", \"Finn H.\"]],\n [\"Samcedes\", [\"Sam E.\", \"Mercedes J.\"]],\n [\"Artcedes\", [\"Artie A.\", \"Mercedes J.\"]],\n [\"Finchel\", [\"Finn H.\", \"Rachel B.\"]],\n [\"Puckleberry\", [\"Puck\", \"Rachel B.\"]],\n [\"Wemma\", [\"Will S.\", \"Emma P.\"]]\n ]\n\n ships.each do |ship_data|\n ship = Ship.find_by_name(ship_data[0])\n\n # Make sure the ship doesn't already exist\n if !ship\n\n # create a new ship\n ship = Ship.new()\n ship.name = ship_data[0]\n ship.save\n\n # For each character in the ship\n ship_characters = ship_data[1]\n generate_log(\"Generating New Ship: #{ship_data[0]} between #{ship_data[1]}\")\n ship_characters.each do |ship_character|\n character = generate_character(ship_character)\n # Save the relationship\n relationship = Relationship.new()\n relationship.ship = ship\n relationship.character = character\n relationship.save\n\n end\n else\n ship.update_attributes(:name => ship_data[0])\n ship.save\n generate_log(\"Updating: #{ship_data[0]} between #{ship_data[1]}\")\n\n\n end\n end\nend",
"def space_params\n params.require(:space).permit(:name, :description, :url, :is_public, :user_id)\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end"
] | [
"0.6713618",
"0.6478278",
"0.6451725",
"0.6440632",
"0.6364032",
"0.63469845",
"0.62720066",
"0.6269905",
"0.62597173",
"0.6215008",
"0.61268187",
"0.61099136",
"0.61027986",
"0.60991967",
"0.6039852",
"0.6034618",
"0.6031819",
"0.6023402",
"0.5977067",
"0.5971664",
"0.59510875",
"0.59437704",
"0.59296715",
"0.5915583",
"0.59110206",
"0.5896704",
"0.58688605",
"0.58487517",
"0.5847418",
"0.5842556",
"0.58156806",
"0.58065015",
"0.57856745",
"0.576669",
"0.5765445",
"0.5746321",
"0.5726911",
"0.57264054",
"0.57146674",
"0.57137024",
"0.57116663",
"0.570595",
"0.5702117",
"0.5687099",
"0.56622636",
"0.56528777",
"0.5649943",
"0.5639489",
"0.56232166",
"0.561948",
"0.56167567",
"0.5594215",
"0.5591372",
"0.558225",
"0.558154",
"0.55789804",
"0.5563642",
"0.55576104",
"0.5554516",
"0.553328",
"0.5525595",
"0.55239296",
"0.55179554",
"0.5511933",
"0.55059177",
"0.5503145",
"0.5498707",
"0.5487187",
"0.5483396",
"0.54639834",
"0.54637146",
"0.54424083",
"0.54300237",
"0.5427068",
"0.54124314",
"0.53961015",
"0.5387191",
"0.5384334",
"0.53829485",
"0.53802425",
"0.5375994",
"0.53702205",
"0.5366898",
"0.5364161",
"0.53599447",
"0.5354891",
"0.53486204",
"0.53438044",
"0.5341369",
"0.5340216",
"0.5340216",
"0.5331344",
"0.5331344",
"0.53290075",
"0.532319",
"0.53129125",
"0.53112197",
"0.52997494",
"0.52861965",
"0.52861965"
] | 0.7412879 | 0 |
PUT /spaceships/1 PUT /spaceships/1.json | def update
@spaceship = Spaceship.find(params[:id])
respond_to do |format|
if @spaceship.update_attributes(params[:spaceship])
format.html { redirect_to @spaceship, notice: 'Spaceship was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @spaceship.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if @space.update(space_params)\n render json: @space, status: :ok\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def destroy\n @spaceship = Spaceship.find(params[:id])\n @spaceship.destroy\n\n respond_to do |format|\n format.html { redirect_to spaceships_url }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @space.update(space_params)\n format.html { redirect_to @space, notice: \"Space was successfully updated.\" }\n format.json { render :show, status: :ok, location: @space }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @space = Space.find(params[:id])\n \n respond_to do |format|\n if @space.update_attributes(params[:space])\n format.html { redirect_to @space, notice: 'Space was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n logger.info(params)\n @space = Space.find(params[:id])\n respond_to do |format|\n if @space.update(space_params)\n flash[:info] = \"空间更新成功!\"\n format.html { redirect_to @space }\n format.json { render :show, status: :ok, location: @space }\n else\n format.html { render :edit }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def update_space_in_system(slug, body, headers=default_headers)\n @logger.info(\"Updating Space \\\"#{slug}\\\"\")\n put(\"#{@api_url}/spaces/#{slug}\", body, headers)\n end",
"def create\n @spaceship = Spaceship.new(params[:spaceship])\n\n respond_to do |format|\n if @spaceship.save\n format.html { redirect_to @spaceship, notice: 'Spaceship was successfully created.' }\n format.json { render json: @spaceship, status: :created, location: @spaceship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spaceship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @space.update(space_params)\n format.html { redirect_to @space, notice: 'Space was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @space_id = args[:space_id] if args.key?(:space_id)\n end",
"def update\n respond_to do |format|\n old_name = @space_type.name\n if @space_type.update(space_type_params)\n @space_type.spaces.each { |s| s.touch }\n format.html { redirect_to @space_type, notice: t('.update_ok') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @space_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def update\n raise User::NotAuthorized, '수정할 권한이 없습니다.' unless @space.updatable_by?(current_user)\n @space.update_attributes(space_params)\n\n broadcast_update_space(@space)\n end",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ship.update(ship_params)\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship }\n else\n format.html { render :edit }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n format.html { redirect_to @ship, notice: 'Ship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def set_space\n @space = Space.find(params[:id])\n end",
"def update\n @space_station = SpaceStation.find(params[:id])\n\n if @space_station.update(space_station_params)\n head :no_content\n else\n render json: @space_station.errors, status: :unprocessable_entity\n end\n end",
"def set_space(space_id = params[:id])\n @space = Space.find(space_id)\n end",
"def load_spaceship\n @Spaceship = Spaceship.find(params[:id])\n end",
"def update\n @clientship = current_user.clientships.find(params[:id])\n\n respond_to do |format|\n if @clientship.update_attributes(params[:clientship])\n format.html { redirect_to @clientship, notice: 'Clientship was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorization(\"update\", @sharespace)\n\n respond_to do |format|\n if @sharespace.update(sharespace_params)\n format.html { redirect_to @sharespace, notice: 'Sharespace was successfully updated.' }\n format.json { render :show, status: :ok, location: @sharespace }\n else\n format.html { render :edit }\n format.json { render json: @sharespace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ship_placement.update(ship_placement_params)\n format.html { redirect_to @ship_placement, notice: 'Ship placement was successfully updated.' }\n format.json { render :show, status: :ok, location: @ship_placement }\n else\n format.html { render :edit }\n format.json { render json: @ship_placement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @space.update(space_params) && update_subscription(@space)\n format.html { redirect_to edit_space_url(@space), notice: 'Space was successfully updated.' }\n format.json { render :show, status: :ok, location: @space }\n else\n format.html { render :edit }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @safe_space.update(safe_space_params)\n format.html { redirect_to @safe_space, notice: 'Safe space was successfully updated.' }\n format.json { render :show, status: :ok, location: @safe_space }\n else\n format.html { render :edit }\n format.json { render json: @safe_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_ships\n # A data structure to store the ships in\n\n ships = [\n [\"Brittana\", [\"Brittany P.\", \"Santana L.\"]],\n [\"Faberry\", [\"Quinn F.\", \"Rachel B.\"]],\n [\"Flanamotta\", [\"Rory F.\", \"Sugar\"]],\n [\"Sory\", [\"Rory F.\", \"Sam E.\"]],\n [\"Seblaine\", [\"Sebastian S.\", \"Blaine A.\"]],\n [\"Santofsky\", [\"D. Karofsky\", \"Santana L.\"]],\n [\"Bartie\", [\"Brittany P.\", \"Artie A.\"]],\n [\"Tike\", [\"Mike C.\", \"Tina C.\"]],\n [\"Pezberry\", [\"Santana L.\", \"Rachel B.\"]],\n [\"Pizes\", [\"Lauren Z.\", \"Puck\"]],\n [\"St. Berry\", [\"Jesse sJ.\", \"Rachel B.\"]],\n [\"Kill\", [\"Kurt H.\", \"Will S.\"]],\n [\"Puckurt\", [\"Kurt H.\", \"Puck\"]],\n [\"Artina\", [\"Tina C.\", \"Artie A.\"]],\n [\"Partie\", [\"Puck\", \"Artie A.\"]],\n [\"Blainofskyve\", [\"Blaine A.\", \"D. Karofsky\"]],\n [\"Klaine\", [\"Kurt H.\", \"Blaine A.\"]],\n [\"Hummelberry\", [\"Kurt H.\", \"Rachel B.\"]],\n [\"Furt\", [\"Kurt H.\", \"Finn H.\"]],\n [\"Pinn\", [\"Puck\", \"Finn H.\"]],\n [\"Samcedes\", [\"Sam E.\", \"Mercedes J.\"]],\n [\"Artcedes\", [\"Artie A.\", \"Mercedes J.\"]],\n [\"Finchel\", [\"Finn H.\", \"Rachel B.\"]],\n [\"Puckleberry\", [\"Puck\", \"Rachel B.\"]],\n [\"Wemma\", [\"Will S.\", \"Emma P.\"]]\n ]\n\n ships.each do |ship_data|\n ship = Ship.find_by_name(ship_data[0])\n\n # Make sure the ship doesn't already exist\n if !ship\n\n # create a new ship\n ship = Ship.new()\n ship.name = ship_data[0]\n ship.save\n\n # For each character in the ship\n ship_characters = ship_data[1]\n generate_log(\"Generating New Ship: #{ship_data[0]} between #{ship_data[1]}\")\n ship_characters.each do |ship_character|\n character = generate_character(ship_character)\n # Save the relationship\n relationship = Relationship.new()\n relationship.ship = ship\n relationship.character = character\n relationship.save\n\n end\n else\n ship.update_attributes(:name => ship_data[0])\n ship.save\n generate_log(\"Updating: #{ship_data[0]} between #{ship_data[1]}\")\n\n\n end\n end\nend",
"def show\n @spaceship = Spaceship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spaceship }\n end\n end",
"def set_spacecraft\n @spacecraft = Spacecraft.find(params[:id])\n end",
"def ship_params\n params.require(:ship).permit(:name, :ships_id, :stations_id, :level, :activeShip)\n end",
"def update\n @ship_class = ShipClass.find(params[:id])\n\n respond_to do |format|\n if @ship_class.update_attributes(params[:ship_class])\n format.html { redirect_to @ship_class, notice: 'Ship class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ship_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_space_type_params\n params.require(:space_type).permit(:id, :name)\n end",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n flash[:notice] = 'Ship was successfully updated.'\n format.html { redirect_to(@ship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ship = Ship.find(params[:id])\n\n respond_to do |format|\n if @ship.update_attributes(params[:ship])\n flash[:notice] = 'Ship was successfully updated.'\n format.html { redirect_to(@ship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_ship\n @ship = Ship.find(params[:id])\n end",
"def set_ship\n @ship = Ship.find(params[:id])\n end",
"def update\n \n @space = Space.find(params[:id])\n @space.update(space_params)\n \n if @space.save\n redirect_to @space, notice: 'El Espacio fue actualizado satisfactoriamente'\n else\n render :edit\n end\n \n end",
"def update\n respond_to do |format|\n if @spacecraft.update(spacecraft_params)\n format.html { redirect_to @spacecraft, notice: 'Spacecraft was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @spacecraft.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n @space.user = current_user\n if @space.save\n render json: @space\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def update\n @space_form = Space::Form.new(space: @space,\n user: current_user,\n attributes: space_params)\n\n authorize @space, :update?\n\n respond_to do |format|\n if @space_form.save\n format.html { redirect_to space_pages_path(@space_form.space), notice: 'Space was successfully updated.' }\n format.json { render :show, status: :ok, location: @space_form.space }\n else\n format.html { render :edit }\n format.json { render json: @space_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_shipfleet\n @shipfleet = Shipfleet.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @player_ship.update(player_ship_params)\n format.html { redirect_to @player_ship, notice: 'Player ship was successfully updated.' }\n format.json { render :show, status: :ok, location: @player_ship }\n else\n format.html { render :edit }\n format.json { render json: @player_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @facility_space.update(facility_space_params)\n format.html { redirect_to @facility_space, notice: 'Facility space was successfully updated.' }\n format.json { render :show, status: :ok, location: @facility_space }\n else\n format.html { render :edit }\n format.json { render json: @facility_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :ok }\n end\n end",
"def update\n respond_to do |format|\n if @office_space.update(office_space_params)\n format.html { redirect_to @office_space, notice: 'Office space was successfully updated.' }\n format.json { render :show, status: :ok, location: @office_space }\n else\n format.html { render :edit }\n format.json { render json: @office_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def make\n @spaces.each { |position| position.occupied = true }\n # pp \"made ship: #{@spaces}\"\n end",
"def update\n group = Group.find(params[:group_id])\n unless @current_user.id == group.user_id\n return render json: { message: \"You are not permitted to perform this operation.\" }, status: :forbidden\n end\n if @space.update(space_params)\n render json: @space, status: :created\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def set_fleet_ship\n @fleet_ship = FleetShip.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @fleet_ship.update(fleet_ship_params)\n format.html { redirect_to @fleet_ship, notice: 'Fleet ship was successfully updated.' }\n format.json { render :show, status: :ok, location: @fleet_ship }\n else\n format.html { render :edit }\n format.json { render json: @fleet_ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :no_content }\n end\n end",
"def update\n @open_space = current_user.open_spaces.get(params[:id])\n\n respond_to do |format|\n if @open_space.update(params[:open_space])\n format.html { redirect_to(@open_space, :notice => 'Open space was successfully updated.') }\n format.xml { head :ok }\n format.js \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @open_space.errors, :status => :unprocessable_entity }\n format.js { render :json => @open_space.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n if @internship.update_attributes(params[:internship])\n format.html { redirect_to @internship, notice: 'Internship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n if @internship.update_attributes(params[:internship])\n format.html { redirect_to @internship, notice: 'Internship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ship\n if @reservation.update(ship_params) && @reservation.ship\n redirect_to reservations_path, notice: \"Reservation shipped.\"\n else\n render :mark_shipped, alert: @reservation.errors\n end\n end",
"def update\n @myspace = Myspace.find(params[:id])\n\n respond_to do |format|\n if @myspace.update_attributes(params[:myspace])\n format.html { redirect_to @myspace, notice: 'Myspace was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @myspace.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shiping.update(shiping_params)\n format.html { redirect_to @shiping, notice: 'Shiping was successfully updated.' }\n format.json { render :show, status: :ok, location: @shiping }\n else\n format.html { render :edit }\n format.json { render json: @shiping.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end",
"def set_ships_sub\n @ships_sub = ShipsSub.find(params[:id])\n end",
"def ship_params\n params.require(:ship).permit(:name, :crew, :has_astromech, :speed, :armament,\n pilots_attributes: [:id, :_destroy, :first_name, :last_name, :call_sign])\n end",
"def create\n @ship = Ship.new(params[:ship])\n @ship.game_id = @game.id\n @ship.health = @ship.ship_type.length\n @ship.vertical = true\n @ship.player_id = @player.id\n\n respond_to do |format|\n if @ship.save\n format.html { redirect_to [@game, @ship], notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @clientship = current_user.clientships.find(params[:id])\n @clientship.destroy\n\n respond_to do |format|\n format.html { redirect_to clientships_url }\n format.json { head :ok }\n end\n end",
"def create\n @ship = Ship.new(params[:ship])\n respond_to do |format|\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render json: @ship, status: :created, location: @ship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shipcount.update(shipcount_params)\n format.html { redirect_to @shipcount, notice: 'Shipcount was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shipcount.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to @space, notice: 'Space was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space }\n else\n format.html { render action: 'new' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @space_scene.update(space_scene_params)\n format.html { redirect_to @space_scene, notice: 'Space scene was successfully updated.' }\n format.json { render :show, status: :ok, location: @space_scene }\n else\n format.html { render :edit }\n format.json { render json: @space_scene.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(params[:space])\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to @space, notice: 'Space was successfully created.' }\n format.json { render json: @space, status: :created, location: @space }\n else\n format.html { render action: \"new\" }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @shipfleet.update(shipfleet_params)\n format.html { redirect_to @shipfleet, notice: 'Shipfleet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shipfleet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @ship.destroy\n respond_to do |format|\n format.html { redirect_to ships_url, notice: 'Ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def update\n @space_cat = SpaceCat.find(params[:id])\n\n respond_to do |format|\n if @space_cat.update_attributes(params[:space_cat])\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @ship = current_user.create_ship(ship_params)\n \n\n respond_to do |format|\n if @ship!=nil\n current_user.activeShip = @ship.id\n if @ship.save\n format.html { redirect_to @ship, notice: 'Ship was successfully created.' }\n format.json { render :show, status: :created, location: @ship }\n else\n format.html { render :new }\n format.json { render json: @ship.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to ships_path, notice: 'Kauf nicht erfolgreich!' }\n \n end\n end\n end",
"def set_player_ship\n @player_ship = PlayerShip.find(params[:id])\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to root_path, notice: \"Space was successfully created.\" }\n format.json { render :show, status: :created, location: @space }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @space_cat.update(space_cat_params)\n format.html { redirect_to @space_cat, notice: 'Space cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @space_cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_space\n @space = current_user.spaces.friendly.find(params[:id])\n end",
"def set_space\n @space = @location.spaces.find_by_permalink(params[:space_id])\n raise ActiveRecord::RecordNotFound unless @space\n end",
"def update\n respond_to do |format|\n if @parking_space.update()\n format.html { redirect_to @parking_space, notice: 'Parking space was successfully updated.' }\n format.json { render :show, status: :ok, location: @parking_space }\n else\n format.html { render :edit }\n format.json { render json: @parking_space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @space = Space.new(space_params)\n\n respond_to do |format|\n if @space.save\n format.html { redirect_to spaces_path, notice: 'Friend was successfully created.' }\n format.json { render action: 'show', status: :created, location: @space }\n else\n format.html { render action: 'new' }\n format.json { render json: @space.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @space_user = SpaceUser.find(params[:id])\n\n respond_to do |format|\n if @space_user.update_attributes(params[:space_user])\n format.html { redirect_to space_users_path, notice: 'Space user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @space_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def fill_field\n SHIPS.each { |size| put_ship(size) }\n end",
"def destroy\n @space = Space.find(params[:id])\n\n @space.destroy\n\n respond_to do |format|\n format.html { redirect_to spaces_url }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @space_reservation.update(space_reservation_params)\n format.html { redirect_to @space_reservation, notice: 'Space reservation was successfully updated.' }\n format.json { render :show, status: :ok, location: @space_reservation }\n else\n format.html { render :edit }\n format.json { render json: @space_reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_space\n @space = Space.friendly.find(params[:id])\n redirect_to root_path unless @space.present?\n end",
"def update\n @ship_methods = ShipMethods.find(params[:id])\n\n respond_to do |format|\n if @ship_methods.update_attributes(params[:ship_methods])\n flash[:notice] = 'ShipMethods was successfully updated.'\n format.html { redirect_to(@ship_methods) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ship_methods.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @internship = Internship.find(params[:id])\n\n if @internship.update_attributes(params[:internship])\n flash[:notice] = 'Internship was successfully updated.'\n end\n respond_with(@internship)\n end",
"def place_ships_on_the_field ships, field\n\t\tships.each do |ship|\n\t\t\tif ship.to_i == 10 then field[ship] = Symbols::SHIP + ' '\n\t\t\telse field[ship] = Symbols::SHIP\n\t\t\tend\n\t\tend\n\tend",
"def update\n filtered_params = space_params.reject { |k,v| k == 'previous_updated_at' }\n if @space.update(filtered_params)\n @space.take_checkpoint(current_user) if @space.needs_checkpoint?\n render json: SpaceRepresenter.new(@space).to_json(user_options: {current_user_can_edit: true}), status: :ok\n else\n render json: @space.errors, status: :unprocessable_entity\n end\n end",
"def fleet_ship_params\n params.require(:fleet_ship).permit(:ship_id, :fleet_id)\n end",
"def update\n respond_to do |format|\n if @discipleship.update(discipleship_params)\n format.html { redirect_to @discipleship, notice: 'Discipleship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @discipleship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @ship = Ship.new(params[:ship])\n @ship.character_id = session[:character_id]\n @ship.port_id = 7\n @ship.save\n \n @ship_attribute = ShipAttribute.new()\n @ship_attribute.ship_id = @ship.id\n @ship_attribute.cargo = 100\n @ship_attribute.weapon_slot = 2\n @ship_attribute.mast_slot = 2\n @ship_attribute.crew_slot = 1\n @ship_attribute.custom_slot = 0\n @ship_attribute.rudder_slot = 1\n @ship_attribute.structure = 50\n @ship.update_attribute(:curr_hp, \"#{@ship_attribute.structure}\")\n \n @ship.create_std_items\n \n respond_to do |format|\n @ship_attribute.save\n session.delete(:registering)\n session[:character_id] = nil\n flash[:notice] = 'Ship was successfully created.'\n format.html { redirect_to(@ship) }\n format.xml { render :xml => @ship, :status => :created, :location => @ship }\n end\n end",
"def space_params\n params.require(:space).permit(:name, :image, :detail, :facility_id, :image_cache, :remove_image)\n end",
"def new\n @spaceship = Spaceship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spaceship }\n end\n end",
"def set_mapspace\n @mapspace = Mapspace.find(params[:id])\n end",
"def put_ship(ship)\n return false if ship.cordinates.map{ |x| @board[x]}.reduce(:+) != EMPTY\n ship.cordinates.map{ |x| @board[x] = ship.size}\n true\n end",
"def destroy\n @player_ship.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_url, notice: 'Player ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7006186",
"0.6673637",
"0.6661903",
"0.6658144",
"0.6597776",
"0.6574459",
"0.6551795",
"0.65341336",
"0.63493514",
"0.63277406",
"0.63232774",
"0.6322382",
"0.6322382",
"0.62951064",
"0.6262661",
"0.62561697",
"0.62507707",
"0.62293136",
"0.62293136",
"0.62293136",
"0.62293136",
"0.62293136",
"0.62286997",
"0.6208972",
"0.61775327",
"0.6122808",
"0.61044836",
"0.6095657",
"0.6017722",
"0.6003815",
"0.59551054",
"0.5945213",
"0.59432745",
"0.59359866",
"0.5926719",
"0.59150267",
"0.5896089",
"0.5895689",
"0.5895689",
"0.58936125",
"0.58936125",
"0.5883571",
"0.5882684",
"0.5873783",
"0.5871154",
"0.58644307",
"0.5855098",
"0.58535415",
"0.585221",
"0.58521825",
"0.5826801",
"0.58245456",
"0.5820713",
"0.5817987",
"0.58116543",
"0.579038",
"0.5769168",
"0.5769168",
"0.5765611",
"0.5760489",
"0.5741853",
"0.5740768",
"0.5740768",
"0.57310593",
"0.57112694",
"0.57057005",
"0.57053554",
"0.56846726",
"0.5682538",
"0.5679323",
"0.5678968",
"0.56723166",
"0.56691384",
"0.566909",
"0.5657016",
"0.56551635",
"0.56546795",
"0.5650471",
"0.56493694",
"0.56364715",
"0.56278265",
"0.56262505",
"0.5611253",
"0.56057245",
"0.5601227",
"0.55973643",
"0.5582412",
"0.55812377",
"0.5580186",
"0.55737036",
"0.55641794",
"0.55607074",
"0.55434924",
"0.5538314",
"0.551811",
"0.5514799",
"0.55111676",
"0.5507682",
"0.5501144",
"0.5491782"
] | 0.7239147 | 0 |
DELETE /spaceships/1 DELETE /spaceships/1.json | def destroy
@spaceship = Spaceship.find(params[:id])
@spaceship.destroy
respond_to do |format|
format.html { redirect_to spaceships_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to ships_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @clientship = current_user.clientships.find(params[:id])\n @clientship.destroy\n\n respond_to do |format|\n format.html { redirect_to clientships_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @discipleship.destroy\n respond_to do |format|\n format.html { redirect_to discipleships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @space = Space.find(params[:id])\n\n @space.destroy\n\n respond_to do |format|\n format.html { redirect_to spaces_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship.destroy\n respond_to do |format|\n format.html { redirect_to ships_url, notice: 'Ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to(internships_url) }\n format.json { head :ok }\n end\n end",
"def destroy\n @ab_reltionship.destroy\n respond_to do |format|\n format.html { redirect_to ab_reltionships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @monitorship = Monitorship.find(params[:id])\n @monitorship.destroy\n\n respond_to do |format|\n format.html { redirect_to monitorships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipfleet.destroy\n respond_to do |format|\n format.html { redirect_to shipfleets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @player_ship.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_url, notice: 'Player ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fleet_ship.destroy\n respond_to do |format|\n format.html { redirect_to fleet_ships_url, notice: 'Fleet ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship_class = ShipClass.find(params[:id])\n @ship_class.destroy\n\n respond_to do |format|\n format.html { redirect_to ship_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @manifestship.destroy\n respond_to do |format|\n format.html { redirect_to manifestships_url, notice: 'Manifestship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url, notice: 'Space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url, notice: 'Space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipcount.destroy\n respond_to do |format|\n format.html { redirect_to shipcounts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url, notice: \"Space was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space = @basic.spaces.find(params[:id])\n @space.destroy\n respond_to do |format|\n format.html { redirect_to edit_basic_path(@basic), notice: 'Space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @spacecraft.destroy\n respond_to do |format|\n format.html { redirect_to spacecrafts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @myspace = Myspace.find(params[:id])\n @myspace.destroy\n\n respond_to do |format|\n format.html { redirect_to myspaces_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize @space, :destroy?\n\n @space.destroy\n respond_to do |format|\n format.html { redirect_to spaces_url(@space.team), notice: 'Space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shiping.destroy\n respond_to do |format|\n format.html { redirect_to shipings_url, notice: 'Shiping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to(internships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @replyship = Replyship.find(params[:id])\n @replyship.destroy\n\n respond_to do |format|\n format.html { redirect_to(replyships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ship_methods = ShipMethods.find(params[:id])\n @ship_methods.destroy\n\n respond_to do |format|\n format.html { redirect_to(ship_methods_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @memeber_ship = MemeberShip.find(params[:id])\n @memeber_ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(memeber_ships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ship_placement.destroy\n respond_to do |format|\n format.html { redirect_to ship_placements_url, notice: 'Ship placement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship_group.destroy\n respond_to do |format|\n format.html { redirect_to ship_groups_url, notice: 'Ship group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space.destroy\n head :no_content\n end",
"def destroy\n @space.destroy\n head :no_content\n end",
"def destroy\n authorization(\"destroy\", @sharespace)\n\n @sharespace.destroy\n respond_to do |format|\n format.html { redirect_to sharespaces_url, notice: 'Sharespace was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space_type.destroy\n respond_to do |format|\n format.html { redirect_to space_types_url, status: 303 }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ambassadorship.destroy\n @ambassadorship = Ambassadorship.new(area: @ambassadorship.area)\n respond_to do |format|\n format.html { redirect_to ambassadorships_url, notice: t('.notice') }\n format.json { head :no_content }\n format.js { render :destroy }\n end\n end",
"def destroy\n @society_member_ship.destroy\n respond_to do |format|\n format.html { redirect_to society_member_ships_url, notice: 'Society member ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @township.destroy\n respond_to do |format|\n format.html { redirect_to townships_url, notice: 'Township was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @open_space = current_user.open_spaces.get(params[:id])\n @open_space.destroy\n\n respond_to do |format|\n format.html { redirect_to(open_spaces_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @shipdesign = Shipdesign.find(params[:id])\n @shipdesign.destroy\n\n respond_to do |format|\n format.html { redirect_to shipdesigns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mentorship = Mentorship.find(params[:id])\n @mentorship.destroy\n\n respond_to do |format|\n format.html { redirect_to mentorships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship_fitting.destroy\n respond_to do |format|\n format.html { redirect_to ship_fittings_url, notice: 'Ship fitting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @voivodeship = Voivodeship.find(params[:id])\n @voivodeship.destroy\n\n respond_to do |format|\n format.html { redirect_to voivodeships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship.destroy\n respond_to do |format|\n format.html { redirect_to friendships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @championship = Championship.find(params[:id])\n @championship.destroy\n\n respond_to do |format|\n format.html { redirect_to championships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space_cat = SpaceCat.find(params[:id])\n @space_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @followship.destroy\n respond_to do |format|\n format.html { redirect_to followships_url, notice: 'Followship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shard = Shard.find(params[:id])\n @shard.destroy\n\n respond_to do |format|\n format.html { redirect_to shards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @facility_space.destroy\n respond_to do |format|\n format.html { redirect_to facility_spaces_url, notice: 'Facility space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_ship.destroy\n redirect_to job_ships_url, notice: 'Job ship was successfully destroyed.'\n end",
"def destroy\n @steamshipline.destroy\n respond_to do |format|\n format.html { redirect_to steamshiplines_url, notice: 'Steamshipline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship_armor_slot.destroy\n respond_to do |format|\n format.html { redirect_to ship_armor_slots_url, notice: 'Ship armor slot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ship_weapon.destroy\n respond_to do |format|\n format.html { redirect_to ship_weapons_url, notice: 'Ship weapon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pic_space = PicSpace.find(params[:id])\n @pic_space.destroy\n\n respond_to do |format|\n format.html { redirect_to pic_spaces_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mentorship = Mentorship.find(params[:id])\n @mentorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(mentorships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n WasabbiModship.transaction do\n @wasabbi_modship = WasabbiModship.find(params[:id])\n @wasabbi_modship.destroy\n\n respond_to do |format|\n format.html { redirect_to(wasabbi_modships_url) }\n format.xml { head :ok }\n end\n end\n end",
"def destroy\n @kojenadults_classe_ship = KojenadultsClasseShip.find(params[:id])\n @kojenadults_classe_ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(kojenadults_classe_ships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to friendships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship = @user.friendships.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to game_user_friendships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @office_space.destroy\n respond_to do |format|\n format.html { redirect_to office_spaces_url, notice: 'Office space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @safe_space.destroy\n respond_to do |format|\n format.html { redirect_to safe_spaces_url, notice: 'Safe space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_regedship = StudentRegedship.find(params[:id])\n @student_regedship.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_regedships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n raise User::NotAuthorized, '삭제할 권한이 없습니다.' unless @space.updatable_by?(current_user)\n @space.destroy\n\n broadcast_delete_space(@space)\n end",
"def destroy\n @space_station.destroy\n\n head :no_content\n end",
"def destroy\n @inventorship = Inventorship.find(params[:id])\n @inventorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventorships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @space_cat.destroy\n respond_to do |format|\n format.html { redirect_to space_cats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @authorship = Authorship.find(params[:id])\n @authorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(authorships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @followship.destroy\n respond_to do |format|\n format.html { redirect_to followships_url, notice: 'Followship was successfully unfollowed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @authorship = Authorship.find(params[:id])\n @authorship.destroy\n\n respond_to do |format|\n format.html { redirect_to authorships_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @space_user = SpaceUser.find(params[:id])\n @space_user.destroy\n\n respond_to do |format|\n format.html { redirect_to space_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipment = Shipment.find(params[:id])\n @shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipment = Shipment.find(params[:id])\n @shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipment = Shipment.find(params[:id])\n @shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stone = Stone.find(params[:id])\n @stone.destroy\n\n respond_to do |format|\n format.html { redirect_to stones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n ship = Sailing.joins(:travelling_parties => :party_registers).find_by(\"party_registers.id\" => params[:id]).cruise_ship_name\n @party_register.destroy\n respond_to do |format|\n format.html { redirect_to user_dashboard_path, notice: \"You have left #{ship} sailing\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fellowship.destroy\n respond_to do |format|\n format.html { redirect_to fellowships_url, notice: 'Fellowship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @championship.destroy\n\n head :no_content\n end",
"def destroy\n @shipmment_item.destroy\n respond_to do |format|\n format.html { redirect_to shipmment_items_url, notice: \"Shipmment item was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n # Logic to delete a record\n @shipment = Shipment.find(params[:id])\n @shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @discipleship_class.destroy\n respond_to do |format|\n format.html { redirect_to discipleship_classes_url, notice: 'Discipleship class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @server1 = Server1.find(params[:id])\n @server1.destroy\n\n respond_to do |format|\n format.html { redirect_to server1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @internships_user = InternshipsUser.find(params[:id])\n @internships_user.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space_amenity.destroy\n respond_to do |format|\n format.html { redirect_to space_amenities_url, notice: 'Space amenity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @espace.destroy\n respond_to do |format|\n format.html { redirect_to espaces_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: UserBoards.delete(params[\"id\"])\n end",
"def destroy\n @internship.destroy\n @complete_internship = current_user.student.complete_internship\n respond_to do |format|\n format.html { redirect_to @complete_internship }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space_reservation.destroy\n respond_to do |format|\n format.html { redirect_to space_reservations_url, notice: 'Space reservation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @committees_voivodeship = CommitteesVoivodeship.find(params[:id])\n @committees_voivodeship.destroy\n\n respond_to do |format|\n format.html { redirect_to committees_voivodeships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guardianship = Guardianship.find(params[:id])\n @guardianship.destroy\n\n respond_to do |format|\n format.html { redirect_to guardianships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipping = scope.find(params[:id])\n @shipping.destroy\n\n respond_to do |format|\n format.html { redirect_to shippings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @parking_space.destroy\n respond_to do |format|\n format.html { redirect_to parking_spaces_url, notice: 'Parking space was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gossip = Gossip.find(params[:id])\n @gossip.destroy\n\n respond_to do |format|\n format.html { redirect_to gossips_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @space_scene.destroy\n respond_to do |format|\n format.html { redirect_to space_scenes_url, notice: 'Space scene was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipment = Shipment.find(params[:id])\n @shipment.destroy\n \n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hop.destroy\n respond_to do |format|\n format.html { redirect_to hops_url, notice: 'Hop was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.74584836",
"0.7456517",
"0.7437676",
"0.7378187",
"0.7368963",
"0.7368963",
"0.7284748",
"0.7280078",
"0.7257336",
"0.72509706",
"0.72509706",
"0.72509706",
"0.71888006",
"0.71787786",
"0.71521485",
"0.7068189",
"0.70637536",
"0.7053948",
"0.7050484",
"0.70380163",
"0.7018138",
"0.7018138",
"0.7017709",
"0.7013161",
"0.6987876",
"0.69814765",
"0.6925396",
"0.6884413",
"0.6868359",
"0.6858707",
"0.6822126",
"0.6812247",
"0.6808232",
"0.67897147",
"0.67738175",
"0.67616665",
"0.67616665",
"0.67524546",
"0.67469746",
"0.67404604",
"0.67118067",
"0.6710172",
"0.6695476",
"0.6693164",
"0.66665006",
"0.66657287",
"0.6597958",
"0.6566037",
"0.65596014",
"0.6558975",
"0.65584123",
"0.6550318",
"0.6548807",
"0.6540775",
"0.65342534",
"0.65317774",
"0.6530241",
"0.65204155",
"0.65195066",
"0.6510406",
"0.6503675",
"0.6492104",
"0.64817506",
"0.6475994",
"0.6471719",
"0.64672273",
"0.64671355",
"0.6464221",
"0.64625293",
"0.6459486",
"0.6450862",
"0.643035",
"0.64296305",
"0.6407933",
"0.63953364",
"0.63953364",
"0.63953364",
"0.6379774",
"0.6357646",
"0.63574654",
"0.63438284",
"0.6336603",
"0.63352174",
"0.63319606",
"0.6316323",
"0.6308965",
"0.63029534",
"0.6301841",
"0.6282411",
"0.62788707",
"0.6272811",
"0.6254754",
"0.6253642",
"0.62447923",
"0.624151",
"0.62362313",
"0.6233367",
"0.622832",
"0.62031966",
"0.6199872"
] | 0.815735 | 0 |
We can always render a static viewer, even if the blob is too large. | def render_error
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @dataservice_blob = Dataservice::Blob.find(params[:id])\n # leaving manual authorization in place because of the params check and the formatting error options\n is_authorized = is_admin? || (@dataservice_blob && @dataservice_blob.token == params[:token]) || current_visitor.has_role?('researcher')\n\n respond_to do |format|\n format.html {\n raise Pundit::NotAuthorizedError unless is_authorized\n render\n }\n format.xml {\n raise Pundit::NotAuthorizedError unless is_authorized\n render :xml => @dataservice_blob\n }\n format.png {\n _handle_rendering_blob(is_authorized)\n }\n format.blob {\n _handle_rendering_blob(is_authorized)\n }\n end\n end",
"def rendered_asset_view(asset)\n return '' unless asset.can_download?\n\n our_renderer = Seek::Renderers::RendererFactory.instance.renderer(asset.content_blob)\n if our_renderer.external_embed? && !cookie_consent.allow_embedding?\n # If embedding external content is not allowed, then server a link instead\n content = \"This embedded content is blocked due to your cookie settings\"\n else\n content = Rails.cache.fetch(\"#{asset.cache_key}/#{asset.content_blob.cache_key}\") do\n our_renderer.render\n end\n end\n if content.blank?\n ''\n else\n content_tag(:div, class: 'renderer') do\n content.html_safe\n end\n end\n end",
"def show\n send_file_by_disk_key @blob, content_type: @blob.content_type\n rescue ActionController::MissingFile, ActiveStorage::FileNotFoundError\n head :not_found\n rescue ActiveStorage::IntegrityError\n head :unprocessable_entity\n end",
"def show\n\n #render plain: @myimage\n end",
"def display_image \r\n self.image.variant(resize_to_limit: [1000, 1000]) \r\n end",
"def small\n attachments.first.file.url(:small)\n rescue StandardError => exc\n logger.error(\"Message for the log file while retrieving small preview #{exc.message}\")\n 'empty_file.png'\n end",
"def large\n attachments.first.file.url(:large)\n rescue StandardError => exc\n logger.error(\"Message for the log file while retrieving large preview #{exc.message}\")\n 'empty_file.png'\n end",
"def show\n respond_to do |format|\n format.html { @photo.generate unless @photo.exists? }\n format.jpg { render_preview(@photo) }\n end\n end",
"def blob; end",
"def blob; end",
"def preview\n render 'preview', :layout => false\n end",
"def display_image\n image.variant(resize_to_limit: [500, 500])\n end",
"def display_image\n image.variant(resize_to_limit: [500, 500])\n end",
"def display_image\n image.variant(resize_to_limit: [500, 500])\n end",
"def display_image\n image.variant(resize_to_limit: [500, 500])\n end",
"def display_image\n image.variant(resize_to_limit: [500, 500])\n end",
"def display_image\n image.variant(resize_to_limit: [500, 500])\n end",
"def preview\n render :template => \"preview\", :layout => false\n end",
"def display_image\n image.variant(resize_to_limit: [500,500])\n end",
"def render_document; end",
"def meta\n blob = ActiveStorage::Blob.find_signed(params[:id])\n\n render json: { blob: blob, url: rails_blob_url(blob) }\n end",
"def show\n url = params[:url]\n width = params[:maxwidth] || '100%'\n height = params[:maxheight] || '100%'\n format = request.query_parameters[:format]\n\n if (width =~ /^[0-9]+(%|px)?$/) == nil\n raise ActionController::RoutingError.new('Incorrect width')\n end\n if (height =~ /^[0-9]+(%|px)?$/) == nil\n raise ActionController::RoutingError.new('Incorrect height')\n end\n\n uri = URI.parse(url)\n\n if uri.host != request.host\n raise ActionController::RoutingError.new('URL origin not allowed')\n end\n\n begin\n uuid = /(\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12})/.match(uri.path)[0]\n rescue NoMethodError\n raise ActionController::RoutingError.new('UUID not found in URL')\n end\n\n begin\n viz = CartoDB::Visualization::Member.new(id: uuid).fetch\n rescue KeyError\n raise ActionController::RoutingError.new('Visualization not found: ' + uuid)\n end\n\n url = URI.join(public_visualizations_show_url(id: uuid) + \"/\", 'embed_map')\n html = \"<iframe width='#{width}' height='#{height}' frameborder='0' src='#{url}' allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>\"\n\n response_data = {\n :type => 'rich',\n :version => '1.0',\n :width => width,\n :height => height,\n :title => viz.name,\n :html => html\n }\n\n if format == 'xml'\n render xml: response_data.to_xml(root: 'oembed')\n else\n render json: response_data.to_json\n end\n end",
"def render_viewer_in_context(document, block)\n canvas = choose_canvas_id(block)\n if params[:controller] == 'spotlight/catalog'\n render partial: current_exhibit.required_viewer.to_partial_path,\n locals: { document: document, block: block, canvas: canvas }\n else\n render partial: current_exhibit.required_viewer.default_viewer_path,\n locals: { document: document, block: block, canvas: canvas }\n end\n end",
"def show\n if (Settler[:search_luminis_crawler_ips] || []).include?(request.remote_ip)\n render file: '/attachments/show.html.haml'\n else\n set_cache_control\n # Upload file to user\n upload_file\n end\n end",
"def send_thumbnail\n response.set_header('Access-Control-Allow-Origin', '*')\n response.headers[\"Last-Modified\"] = Time.now.httpdate.to_s\n response.headers[\"Content-Type\"] = 'image/jpeg'\n response.headers[\"Content-Disposition\"] = 'inline'\n path = Hyrax::DerivativePath.derivative_path_for_reference(identifier, 'thumbnail')\n begin\n IO.foreach(path).each do |buffer|\n response.stream.write(buffer)\n end\n ensure\n response.stream.close\n end\n end",
"def show\n\n matches = params[:size].match(\"([0-9]+)x([0-9]+).*\") if params[:size]\n\n default_size = 200\n min_size = 16\n max_size = 200\n\n if matches\n\n width = matches[1].to_i\n height = matches[2].to_i\n\n if ((width < min_size) || (width > max_size) || (height < min_size) || (height > max_size))\n width = default_size\n height = default_size\n end\n\n else\n width = 200\n height = 200\n end\n \n send_cached_data(\"public/pictures/show/#{width.to_i}x#{height.to_i}/#{params[:id].to_i}.jpg\",\n :type => 'image/jpeg', :disposition => 'inline') {\n\n img = Magick::Image.from_blob(@picture.data).first\n img = img.change_geometry(\"#{width}x#{height}>\") do |c, r, i| i.resize(c, r) end\n\n img.format = \"jpg\"\n img.to_blob\n }\n\n end",
"def preview\n if (Rails.env.development? || is_admin?) && (params[:id].nil? || params[:show_test_object])\n @obj_path = \"/test/test.obj\"\n flash[:alert] = \"Displaying the test object\"\n elsif !@obj_path\n flash[:alert] = \"Could not locate file to preview\"\n end\n render :layout => false\n end",
"def large\n @medium = Medium.find(params[:id]) \n respond_to do |format|\n format.html { render :template => 'pictures/large' }# large.rhtml\n end\n end",
"def preview\n end",
"def preview\n end",
"def preview\n contents = Plan.filter!(params[:contents])\n render :text => contents, :content_type => 'text/html'\n end",
"def show\n render_general(@image)\n end",
"def blob(id)\n head \"/blobs/#{id}\"\n end",
"def record(width, height, &rendering_code); end",
"def show\n if @image then \n if stale?(:last_modified => @object.updated_at.utc, :etag => @object)\n respond_to do |format|\n format.html { render :action => :edit unless File.exist?(view_path) }\n format.xml { render :xml => @object.to_xml }\n format.any { send(\"show_#{params[:format]}\") } if respond_to?(\"show_#{params[:format]}\") \n end\n end\n else\n show_jpg\n end\n end",
"def show\n @content_image = @post.content_images.find(params[:id]) if @post\n# @content_image = @blog.content_images.find(params[:id]) if @blog\n headers['Content-Length'] = @content_image.size\n send_data @content_image.db_file.data, \n :type => @content_image.content_type, \n :disposition => 'inline', \n :filename => @content_image.filename\n end",
"def blob(arg)\r\n file MojoMagick::tempfile(arg)\r\n end",
"def blob\n read_repo\n if @branches.count < 1\n render :template => 'repositories/newrepo'\n return\n end\n\n params[:action] = \"blob\"\n\n @blob = @repository.get_blob(@branch, @path)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repository }\n end\n end",
"def preview\n\t\trender :layout => false\n\tend",
"def display_image\n image.variant resize_to_limit: Settings.validation.post.img_resize\n end",
"def show\n @small_generator = SmallGenerator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @small_generator }\n format.pdf do\n pdf = SmallGeneratorsPdf.new @small_generator, view_context\n send_data pdf.render,\n type: \"application/pdf\",\n disposition: \"inline\",\n filename: \"#{@small_generator.model}.pdf\"\n end\n end\n end",
"def content_preview(options = {})\n file = Store::File.find_by(id: store_file_id)\n if !file\n raise \"No such file #{store_file_id}!\"\n end\n raise 'Unable to generate preview' if options[:silence] != true && preferences[:content_preview] != true\n\n image_resize(file.content, 200)\n end",
"def snap\n @cleaner.photo = params[:photo][:file]\n content_type = content_type(@cleaner.photo_file_name)\n @cleaner.photo_content_type = content_type if content_type\n @cleaner.save!\n render :text => @cleaner.photo.url(:large)\n end",
"def view_image\n \n @image = Productimage.find(params[:id])\n #@page_title = \"Large Image - \" + @image.product.title\n @page_title = \"View Large Image\"\n render(:file => \"#{RAILS_ROOT}/app/views/templates/#{Shop.def_template_name}/frontend/#{action_name}.html.erb\", \n :layout => false)\n rescue\n render :layout=>nil, :inline=>\"ERROR CODE: 8807.\"\n end",
"def stream\n render_layout\n\n pdf_content\n end",
"def static_page_preview_for role\n StaticPageHelper.preview_for(role)\n end",
"def show_file\n options = { type: @static_page.custom_file.file.content_type,\n disposition: 'inline' }\n send_file @static_page.custom_file.path, options\n end",
"def original\n \tobject.file.url(:large)\n end",
"def thumbnail(size); end",
"def show\n @bg_gray = true\n respond_to do |format|\n format.html\n format.pdf do\n render :pdf => 'obj_vend_pdf', \n :template => 'vendedors/obj_vend_pdf.html.erb',\n :layout => 'pdf.html.erb',\n :orientation => 'Portrait',# default Portrait\n :page_size => 'Legal'\n end\n end\n end",
"def preview?\n false\n end",
"def render_placeholder(request, response)\n @placeholder_img_path ||= File.expand_path(\n \"../#{Config.placeholder_image}\",\n File.dirname(__FILE__)\n )\n\n # serve an UMBRELLA wita a bit of binary magic\n request.halt(200, response.headers({\n 'Content-Type' => 'image/png',\n 'Cache-Control' => 'no-cache, no-store, must-revalidate',\n 'Content-Length' => UMBRELLA.length\n }), UMBRELLA.scan(/../).map(&:hex).pack(\"c*\")) unless File.exist?(@placeholder_img_path)\n\n @placeholder_img_type = File.extname(Config.placeholder_image).tr('.', '')\n\n Config.il.l(binding, :placeholder)\n\n @raw_data_size ||= File.size(@placeholder_img_path).to_s\n @raw_data ||= File.read(@placeholder_img_path)\n\n response.headers 'Content-Type' => @placeholder_img_type == 'svg' ? 'xml/svg' : \"image/#{@placeholder_img_type}\"\n response.headers 'Cache-Control' => 'no-cache, no-store, must-revalidate'\n response.headers 'Content-Length' => @raw_data_size\n\n request.halt(200, response.headers, @raw_data)\n end",
"def blob\n nil\n end",
"def web_viewer_type\n # Add more conditions as and when supported\n case\n when web_image? then :image\n when web_video? then :video\n when Rack::Mime.match?(mime_type, 'application/pdf') then :pdf\n when backing_store == :g_docs &&\n url.end_with?('/pub', '/pub?embedded=true')\n\n :g_docs_published\n else nil\n end\n end",
"def serve_image\n\n # http://stackoverflow.com/questions/9462785/referencing-model-with-string-input\n # https://github.com/carrierwaveuploader/carrierwave/issues/614\n # model.avatar.file.filename\n # model[:avatar]\n # model.avatar_identifier\n # File.basename(model.file.path)\n\n\n if params[:id] && params[:model] && params[:type] && params[:id_image] && params[:uploader]\n\n model = params[:model].singularize.classify.constantize.find(params[:id_image])\n name = model.read_attribute(params[:uploader].to_s)\n image_name = \"#{params[:type]}_#{name}\"\n\n image_path = File.join(Rails.root,\"images\",Rails.env, params[:model], params[:uploader], params[:id_image],image_name)\n\n unless send_file( image_path,disposition: 'inline', type: 'image/jpeg', x_sendfile: true )\n return \"some default image\" # ensure views have css defining the size of thumbnail, that way default image is the proper size\n end\n end\n\n end",
"def preview_page(name, data, format)\n page = @page_class.new(self)\n ext = @page_class.format_to_ext(format.to_sym)\n path = @page_class.cname(name) + '.' + ext\n blob = OpenStruct.new(:name => path, :data => data)\n page.populate(blob, path)\n page.version = @access.commit('HEAD')\n page\n end",
"def create_homepage_thumbnail\n image = Image.from_blob(self.photo_image).first\n thumbnail = image.resize_to_fill(320,240, gravity=CenterGravity)\n thumbnail.to_blob\n end",
"def display_if_requested(image, viewer)\n\n return unless viewer\n\n #Create a viewer pathname.\n if viewer.include?('%')\n command = viewer.sub('%', \"\\\"#{image}\\\"\") \n else\n command = \"#{viewer} \\\"#{image}\\\"\"\n end\n\n #Execute the viewer.\n puts `#{command}`\n\nend",
"def show\n image = Image.find_by_name(params[:id])\n send_data image.content, :filename=>image.name, :type => image.content_type, :disposition => 'inline'\n end",
"def full_size\n @medium = Medium.find(params[:id]) \n respond_to do |format|\n format.html { render :partial => 'pictures/full_size' }# large.rhtml\n end\n end",
"def thumbnail\n if user_signed_in?\n send_thumbnail\n else\n evaluate_thumbnail_visibility\n end\n end",
"def show\n\n # Define cache headers that lets the content be cached in 350 days.\n # Cache busters in the path to the static resources will make sure they are\n # invalidating when chanced, since the URL will change.\n response.headers['Cache-Control'] = 'public, max-age=30240000'\n\n render :text => resource_data, :content_type => content_type\n\n end",
"def show\n send_data(attachment.attachment.read, filename: attachment.filename, type: attachment.content_type)\n end",
"def show\n set_riffblob\n @riffblobs = @riffblob.childs\n end",
"def blob\n generate\n storage.get(path).body\n end",
"def preview\n attachments.first.file.url(:preview)\n rescue StandardError => exc\n logger.error(\"Message for the log file while retrieving preview #{exc.message}\")\n 'empty_file.png'\n end",
"def main_preview_img_header_variant\n if realty.preview_img.attached?\n view_context.image_tag realty.preview_img.variant(resize: '750X484^').processed, class: 'img-responsive project_img_top box-shadow img-rounded'\n end\n end",
"def show\n send_data(@document.file_content,\n type: @document.content_type,\n filename: @document.filename)\n end",
"def show\n @work = Work.find(params[:id])\n # @imgtag = \"gallery/\" + @work.name + \".jpg\"\n # unless FileTest.exists?(\"#{RAILS_ROOT}/public/images/#{@imgtag}\")\n # @imgtag = \"NoImg.jpg\"\n # end\n @imgtag = @work.photo.url\n @sizex = @work.sizex\n @sizey = @work.sizey\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @work }\n end\n end",
"def set_blob\n @blob = Blob.find(params[:id])\n end",
"def thumbnail\n account = EvernoteAccount.find(session[:evernote_account_id])\n uri_string = ENV[\"EVERNOTE_URL\"] + \"/shard/\" + account.shard + \"/thm/note/\" + params[:note_guid]\n if params[:size]\n uri_string += \"?size=\" + params[:size]\n end\n response = Net::HTTP.post_form(URI.parse(uri_string), \"auth\" => account.token)\n render :text => response.body, :status => 200, :content_type => response.content_type\n end",
"def set_blob\n @blob = Blob.find(params[:id])\n end",
"def show_preview path\n @windows.load_preview path\n end",
"def show\n send_data(@document.file_contents,\n type: @document.content_type,\n filename: @document.filename)\n end",
"def show\n return render_404 unless uploader&.exists?\n\n if cache_publicly?\n # We need to reset caching from the applications controller to get rid of the no-store value\n headers['Cache-Control'] = ''\n expires_in 5.minutes, public: true, must_revalidate: false\n else\n expires_in 0.seconds, must_revalidate: true, private: true\n end\n\n disposition = uploader.image_or_video? ? 'inline' : 'attachment'\n\n uploaders = [uploader, *uploader.versions.values]\n uploader = uploaders.find { |version| version.filename == params[:filename] }\n\n return render_404 unless uploader\n\n workhorse_set_content_type!\n send_upload(uploader, attachment: uploader.filename, disposition: disposition)\n end",
"def thumbnail_for(commit_id, add_public = true)\n prefix = data_path.dup\n prefix.sub!('public', '') unless add_public\n \"#{prefix}/thumbnails/#{commit_id}\"\n end",
"def show\n respond_to do |format|\n format.jpeg { send_data @recipe_image.resize }\n end\n end",
"def render_thumbnail(document, _options = {})\n isbn_values = document.fetch(:isbn_valid_ssm, [])\n oclc_values = document.fetch(:oclc_number_ssim, [])\n lccn_values = document.fetch(:lccn_ssim, [])\n\n if isbn_values.empty? && oclc_values.empty? && lccn_values.empty?\n content_tag(:span, '',\n class: \"fas fa-responsive-sizing faspsu-#{document[:format][0].parameterize}\")\n else\n content_tag(:span, '',\n class: \"fas fa-responsive-sizing faspsu-#{document[:format][0].parameterize}\",\n data: { isbn: isbn_values,\n oclc: oclc_values,\n lccn: lccn_values,\n type: 'bibkeys' })\n end\n end",
"def show\n @cv = Cv.find(params[:id])\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"cv. #{@cv_params}\",\n page_size: 'A4',\n template: \"cvs/show.html.erb\",\n layout: \"pdf.html\",\n lowquality: true,\n zoom: 1,\n dpi: 75\n end\n end\n end",
"def show\n smartrender\n end",
"def show\n smartrender\n end",
"def show_plain\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: @document.name,\n template: \"documents/plain.pdf.erb\",\n locals: {:document => @document},\n layout: 'layouts/application.pdf.erb',\n :margin => { :bottom => 45, :top => 66, :left => 0 },\n header: {\n html: {\n template: 'documents/templates/header.pdf.erb',\n layout: 'plain.html.erb',\n locals: { :document => @document }\n }\n },\n show_as_html: params.key?('debug')\n end\n end\n end",
"def show\n respond_to do |format|\n format.html\n format.pdf {\n render pdf: 'show',\n layout: 'pdf_report.html',\n page_size: (params[:visit_report_print_size] == 'A5' ? 'A5' : 'A4' rescue 'A4'),\n zoom: RUBY_PLATFORM =~ /win32/ ? 1.3 : 1,\n disable_smart_shrinking: RUBY_PLATFORM =~ /win32/ ? true : false,\n print_media_type: true,\n dpi: 300,\n no_background: false, \n encoding: 'utf8',\n image: true,\n margin: { top: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_top.to_i rescue \"\") : (@print_setting.a_five_visit_report_margin_top.to_i rescue \"\") ),\n bottom: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_bottom.to_i rescue \"\") : (@print_setting.a_five_visit_report_margin_bottom.to_i rescue \"\")),\n left: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_left rescue \"\") : (@print_setting.a_five_visit_report_margin_left rescue \"\")),\n right: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_right rescue \"\") : (@print_setting.a_five_visit_report_margin_right rescue \"\" ) )},\n show_as_html: params[:debug].present?\n }\n end\n\n end",
"def show\n @origami = Origami.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @origami }\n format.pdf\n end\n end",
"def blob?\n @blob\n end",
"def show \n render :file => cache_file and return if cached_file?\n \n @document = Document.find_by_path(request_path)\n \n raise ActiveRecord::RecordNotFound unless @document and (@document.published? or @document.allowed? current_user, 'read')\n\n respond_to do |format|\n format.html do\n setup_view_environment\n render :template => view_for\n end\n format.xml { render :xml => @document.to_xml(:only => [:title, :summary, :body, :published_at, :permalink]) }\n format.rss { render :template => 'pages/feed.rss.builder' }\n end\n\n cache_this_page!\n end",
"def show\n respond_to do |format|\n format.png { send_image @user.raw_image_data, :png }\n format.jpg { send_image @user.raw_image_data, :jpeg }\n format.html { }\n end\n end",
"def render_length; end",
"def get_preview\n get_filtered_dataset false, 10\n end",
"def create\n record = Document.new :attachment => params[:media]\n record.title = params[:title_placeholder] != '0' ? '' : params[:title]\n record.description = params[:description_placeholder] != '0' ? '' : params[:description]\n record.user_id = current_user.id\n if !record.save\n if record.errors.added? :attachment, :too_large\n return render :file => Rails.root.join('public/413.html'), :layout => false, :status => 413\n end\n @errors = convert_document_error_messages record.errors\n end\n render :layout => false\n end",
"def show\n document_id = (params[:id] || params[:document_id]).to_i\n return forbidden if Document.exists?(document_id) and not current_document\n return not_found unless current_page\n\n respond_to do |format|\n format.html do\n @exclude_platformjs = true\n @embed_options = {\n container: '#DC-embed-container',\n }\n if params[:embed] == 'true'\n merge_embed_config\n # We have a special, extremely stripped-down show page for when we're\n # being iframed. The normal show page can also be iframed, but there\n # will be a flash of unwanted layout elements before the JS/CSS \n # arrives which removes them.\n @embedded = true\n @exclude_analytics = true\n render template: 'pages/show_embedded'\n else\n @include_analytics = true\n make_oembeddable(current_page)\n set_minimal_nav text: 'Read the full document',\n xs_text: 'Full document',\n link: current_page.contextual_url\n end\n end\n \n format.json do\n @response = current_document_json\n render_cross_origin_json\n end\n \n format.js do\n render :js => \"DV.loadJSON(#{current_document_json});\"\n end\n\n #format.txt { send_page_text }\n \n #format.gif { send_page_image }\n end\n end",
"def maybe_view_link_to(member)\n if member.kind_of?(Asset) && member.content_type&.start_with?(\"image/\")\n yield\n else\n # image thumb is in a link, but right next to filename with same link.\n # Suppress image thumb from assistive technology to avoid un-useful double\n # link. https://www.sarasoueidan.com/blog/keyboard-friendlier-article-listings/\n link_to(download_path(member.leaf_representative.file_category, member.leaf_representative, disposition: :inline),\n view_link_attributes.merge(\"aria-hidden\" => \"true\", \"tabindex\" => -1)) do\n yield\n end\n end\n end",
"def large_image\n if request.get? or request.post?\n @picture = Productimage.find(params[:pid])\n render :partial=>\"templates/#{Shop.def_template_name}/frontend/large\"\n \t \n end \n end",
"def show\n send_data(@attachment.file_contents,\n type: @attachment.content_type,\n filename: @attachment.filename)\n end",
"def show\n @document = Attached.find(params[:id])\n\n rootString = root_url.to_s.gsub(\"?locale=\", \"\")\n\n if request.referer\n if request.referer.include?(rootString + \"events/\" + @document.event_id.to_s) or request.referer.include?(rootString + \"manage_attached/\" + @document.event_id.to_s)\n data = open(@document.attached_url(:original)) \n send_data data.read, filename: @document.attached_file_name, type: @document.attached_content_type, disposition: 'inline', stream: 'true'\n return\n end\n end\n \n redirect_to root_url, alert: \"This document can only be viewed through the event page\"\n \n end",
"def render\n Vedeu.render_output(output) if visible?\n end",
"def new\n authorize Dataservice::Blob\n @dataservice_blob = Dataservice::Blob.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dataservice_blob }\n end\n end",
"def large\n if image.on_storage?\n variant(1200)\n else\n relevant_assets_cache.select { |item| item.width <= 1200 }.sort_by(&:width).last.url\n end\n end",
"def show\n\n @object_type = ObjectType.includes(items: [{ locator: :wizard }, :sample]).find(params[:id])\n @handler = view_context.make_handler @object_type\n\n @sample_type = SampleType.find(@object_type.sample_type_id) if @object_type.sample?\n\n @image_url = \"#{Bioturk::Application.config.image_server_interface}#{@object_type.image}\"\n\n respond_to do |format|\n format.html { render layout: 'aq2' } # show.html.erb\n format.json { render json: @object_type }\n end\n\n end",
"def show\n @blobs_component = BlobsComponent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @blobs_component }\n end\n end",
"def show\n @upload_preview = UploadPreview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @upload_preview }\n end\n end"
] | [
"0.62957287",
"0.6171491",
"0.5988713",
"0.59141815",
"0.5828085",
"0.57239807",
"0.5690204",
"0.56749",
"0.56532973",
"0.56532973",
"0.56460613",
"0.5642755",
"0.5642755",
"0.5642755",
"0.5642755",
"0.5642755",
"0.5642755",
"0.564145",
"0.56070065",
"0.5602173",
"0.5598186",
"0.5588665",
"0.55351734",
"0.5524715",
"0.55189633",
"0.5470117",
"0.545382",
"0.5446732",
"0.54418296",
"0.54418296",
"0.541647",
"0.5410007",
"0.5380254",
"0.537661",
"0.5340815",
"0.53358334",
"0.5312409",
"0.5300129",
"0.5298642",
"0.5279613",
"0.5278413",
"0.5269598",
"0.52690804",
"0.52679",
"0.5263021",
"0.52585644",
"0.5257799",
"0.52454376",
"0.52409256",
"0.5225069",
"0.52120703",
"0.52081674",
"0.5207994",
"0.5206445",
"0.52031183",
"0.51999503",
"0.5179523",
"0.5177069",
"0.51764345",
"0.51741874",
"0.51740336",
"0.51699346",
"0.515391",
"0.5152931",
"0.5152603",
"0.5147784",
"0.5143848",
"0.514079",
"0.5135946",
"0.51353735",
"0.51333463",
"0.5113999",
"0.51086974",
"0.50953406",
"0.50947",
"0.50917816",
"0.5091357",
"0.5088135",
"0.50873226",
"0.5082547",
"0.5082547",
"0.50795025",
"0.5073526",
"0.5073227",
"0.5071865",
"0.50677043",
"0.5059343",
"0.5056242",
"0.5053432",
"0.50463444",
"0.50424695",
"0.50406355",
"0.5037648",
"0.5034228",
"0.5033369",
"0.5031704",
"0.50292635",
"0.5023566",
"0.5016907",
"0.50097644",
"0.50060743"
] | 0.0 | -1 |
Make sure the message has valid message ids for the message, and fetch them | def fetch_message_ids field
self[field] ? self[field].message_ids || [self[field].message_id] : []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_existing_message_id\n id = Message.all.first&.id\n return if id.nil?\n\n get \"/messages/#{id}\"\n assert last_response.ok?\n assert_equal 'application/vnd.api+json', last_response.headers['Content-Type']\n\n response_body = JSON.parse last_response.body\n data = response_body['data']\n\n verify_message Message[data['id']], data\n end",
"def get(message_id)\r\n messages.detect { |message| message.message_id.to_s == message_id.to_s }\r\n end",
"def has_message_id?\n !fields.select { |f| f.responsible_for?('Message-ID') }.empty?\n end",
"def get_messages\n @connection.uid_search(@filter).each do |message|\n puts \"PROCESSING MESSAGE #{message}\"\n body=@connection.uid_fetch(message,\"RFC822\")[0].attr[\"RFC822\"]\n @processor.process(body, @options)\n @connection.uid_copy(message, 'Processed')\n\n @connection.uid_store(message,\"+FLAGS\",[:Deleted])\n end\n @connection.expunge\n #@connection.delete_all\n end",
"def message(*ids)\n result = records(\"post\", \"/msg/get/#{ids.join(\",\")}\")\n result.length == 1 ? result.first : result\n end",
"def find_matching_recipient_by_message_id(message_id, state: :incomplete)\n restext = \"[{\\\"aws_sns_sms_message_id\\\":\\\"#{message_id}\\\"}]\"\n\n res = if state == :incomplete\n incomplete_recipients\n else\n DynamicModel::ZeusBulkMessageRecipient\n end\n res = res.where(response: restext)\n res.first\n end",
"def read_message(message_id)\n message =\n if self.is_client?\n self.messages.find(message_id)\n elsif self.is_employee?\n self.client.messages.find(message_id)\n end\n if self.is_client?\n message.update_columns(is_read: true)\n else\n u_ids = message.message_status.user_ids.push(self.id)\n logger.info u_ids\n message.message_status.update_columns(user_ids: u_ids)\n end\n end",
"def to_gcloud_messages message_ids #:nodoc:\n msgs = @messages.zip(Array(message_ids)).map do |arr, id|\n Message.from_gapi \"data\" => arr[0],\n \"attributes\" => jsonify_hash(arr[1]),\n \"messageId\" => id\n end\n # Return just one Message if a single publish,\n # otherwise return the array of Messages.\n if @mode == :single && msgs.count <= 1\n msgs.first\n else\n msgs\n end\n end",
"def get_message_from_messageinfo m\n return nil if m.fake?\n @messages[m.message_id] ||= begin\n message = @context.client.load_message m.message_id\n message.parse! @context\n message.chunks.each { |c| @chunk_layouts[c] = ChunkLayout.new c }\n\n if message.unread?\n message.state -= [\"unread\"]\n @context.client.async_set_state! message.message_id, message.state\n @context.ui.broadcast :message_state, message.message_id\n end\n\n message\n end\n end",
"def sync_messages\n Mail.connection do |imap|\n imap.select 'INBOX'\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n if Message.validity.eql? validity_id\n uids = imap.uid_search([\"NOT\", \"DELETED\"]).sort\n local_uids = Message.ids\n if uids != local_uids\n Sidekiq::Logging.logger.info \"*** Syncing Some ***\"\n new_ids = uids - local_uids\n deleted_ids = local_uids - uids\n unless new_ids.blank?\n fetchdata = imap.uid_fetch(new_ids, ['RFC822'])\n fetchdata.each do |rec|\n validity_id = imap.responses[\"UIDVALIDITY\"].last if imap.responses[\"UIDVALIDITY\"]\n msg = Message.new(uid: rec.attr['UID'], validity_id: validity_id, raw_message: rec.attr['RFC822'])\n msg.save\n end\n end\n self.sync_deleted(deleted_ids.map{|id| [validity_id,id].join ':'}) unless deleted_ids.blank?\n end\n else\n self.sync_all\n end\n Message.ids\n end\n end",
"def fetch\n capture_errors(MessageError) do\n if defined?(@message) && !@message.nil?\n @message\n else\n Mail.new(conn.fetch(@uid).ok![0])\n end\n end\n end",
"def get_messages\n @connection.select('INBOX')\n @connection.search(['ALL']).each do |message_id|\n msg = @connection.fetch(message_id,'RFC822')[0].attr['RFC822']\n begin\n process_message(msg)\n rescue\n handle_bogus_message(msg)\n end\n # Mark message as deleted \n @connection.store(message_id, \"+FLAGS\", [:Deleted])\n end\n end",
"def get_and_reset_messages!(id)\n log \"get_and_reset_messages #{id}\"\n vals = redis.multi do\n redis.lrange(id, 0, -1)\n redis.del(id)\n end\n # what a sad interface\n # vals[0] is the answer to the first statement in the block\n vals[0].map {|m| Marshal.load(m)}\n end",
"def get_safebox_messages(safebox_guid)\n handle_error { sendsecure_connection.get(\"api/v2/safeboxes/#{safebox_guid}/messages.json\") }\n end",
"def message_id; @message_impl.getMessageId; end",
"def new_message_check\n if(!current_user.nil?)\n ids = Message.where(user_received_id: current_user.id, read: false).pluck(:user_sent_id).uniq\n if ids.count > 0\n ids = Message.where(user_received_id: current_user.id, read: false).pluck(:user_sent_id).uniq\n render text: '{\"unread\":\"true\", \"ids\":[' + ids.join(',') + ']}'\n else\n render text: '{\"unread\":\"false\"}'\n end\n else \n render text: '{\"unread\":\"false\"}'\n end\n end",
"def message_id\n data[:message_id]\n end",
"def get_messages\n @connection.search(@filter).each do |message|\n body = @connection.fetch(message, \"RFC822\")[0].attr[\"RFC822\"]\n begin\n @processor.process(body)\n rescue StandardError => error\n Mailman.logger.error \"Error encountered processing message: #{message.inspect}\\n #{error.class.to_s}: #{error.message}\\n #{error.backtrace.join(\"\\n\")}\"\n next\n end\n @connection.store(message, \"+FLAGS\", @done_flags)\n end\n # Clears messages that have the Deleted flag set\n @connection.expunge\n end",
"def check_id_uniqueness\n check('object id uniqueness') do |messages|\n list = [\n check_network_id_uniqueness,\n check_node_id_uniqueness,\n check_link_id_uniqueness,\n check_tp_id_uniqueness\n ]\n messages.push(list)\n messages.flatten!\n end\n end",
"def getMail\n# gets maximum id avoiding nil case\n id = Message.maximum(:id)\n if id.nil?\n id = 0\n else\n id += 1\n end\n allMail = Mail.all #Grab all unread mail\n if !allMail.empty? #Check to see if no new mail\n allMail.each do |mail|\n#This is a method to check to see if author is from grinnell domain\n# if mail.from[0].downcase.include? (\"@grinnell.edu\")\n# if mail.subject.downcase.include? (\"csstudent\")\n message = Message.new\n message.id = id\n #Grab subject that doesn't include csstudent and other tags\n message.subject = addTag(message, mail.subject)\n message.tag_list.sort!\n message.author = mail.from[0]\n message.content = getContent(mail)\n message.created_at = mail.date.to_s\n # Makes it so both have the same time format\n message.updated_at = Time.now.strftime(\"%Y-%m-%d %H:%M\")\n message.save\n id += 1\n# end\n end\n end\n end",
"def message_id\n @message_id\n end",
"def read_message(name, uploaded_ids, strip_emailchemy=false)\n raise UnknownMbox.new(name) unless @files[name]\n raise EOFError.new if !@files[name].nil? && @files[name].closed?\n @lock.synchronize do\n @files[name] = File.open(name) if @files[name].nil?\n message = Array.new\n skip_message = false\n message_id = nil\n convert_header = !strip_emailchemy\n begin\n currentpos = 0\n while(line = @files[name].readline) do\n if(message.size == 0 && line !~ /^From - ... ... .+?[0-9]{4}$/)\n Logger.info('Line does not match message start. Skipping to next line.')\n next\n end\n if(message.size != 0 && line =~ /^From - ... ... .+?[0-9]{4}$/)\n @files[name].pos = currentpos - line.length\n break\n else\n unless(skip_message)\n if(line =~ /^message-id: (.+)$/i)\n message_id = $1.strip\n Logger.info(\"Checking message-id: #{message_id}\")\n if(uploaded_ids.include?(message_id))\n Logger.warn(\"Duplicate message identified: #{message_id}\")\n skip_message = true\n end\n end\n unless(convert_header)\n if(line =~ /^x-converted-by: emailchemy/i)\n convert_header = true\n next\n end\n end\n message.push(line)\n end\n end\n currentpos = @files[name].pos\n end\n rescue EOFError\n Logger.info(\"Reached end of file: #{name}\")\n @files[name].close\n rescue Object => boom\n Logger.warn(\"Unknown error processing #{name}: #{boom}\")\n end\n end\n if(skip_message)\n raise MessageDuplicate.new(message_id)\n else\n message.delete_at(message.size - 1)\n return message.join('')\n end\n end",
"def get_all_media_from_all_messages\n begin\n media_sql = \"SELECT * FROM mediacontent WHERE mediacontentid IN\";\n media_sql += \" (SELECT messagemediacontent.mediaid FROM messagemediacontent)\";\n media_sql += \" AND (HighQFilePath IS NOT NULL AND HighQFilePath != '' ) \";\n message_media_data = Immutable.dbh.execute(media_sql);\n return message_media_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n end\n end",
"def each_message(uids, type) # :yields: TMail::Mail\n parts = mime_parts uids, type\n\n uids = []\n\n each_part parts, true do |uid, message|\n mail = TMail::Mail.parse message\n\n begin\n success = yield uid, mail\n\n uids << uid if success\n rescue => e\n log e.message\n puts \"\\t#{e.backtrace.join \"\\n\\t\"}\" unless $DEBUG # backtrace at bottom\n log \"Subject: #{mail.subject}\"\n log \"Message-Id: #{mail.message_id}\"\n p mail.body if verbose?\n\n raise if $DEBUG\n end\n end\n\n uids\n end",
"def id\n @message[:id]\n end",
"def network_message_ids\n return @network_message_ids\n end",
"def get_messages!\n\t\t\t# clear messages\n\t\t\tmsgs = messages\n\t\t\tdb_set({}, { messages: [] })\t\t\t\n\t\t\tmessages = Set.new\n\t\t\treturn { messages: msgs }\n\t\tend",
"def messages\n user_ids = users.pluck(:id)\n rooms_user_ids = RoomsUser.where(room_id: self.id, user_id: user_ids).pluck(:id)\n RoomMessage.where(rooms_user_id: rooms_user_ids).order(created_at: :asc)\n end",
"def process_message_response\n # Is this email confirming receipt of a previous message? \n msg_id = find_message_id_tag(:subject=>@subject, :body=>@body)\n#puts \"**** body=#{@body}, msg_id=#{msg_id}\"\n if msg_id \n # Does the \"confirmed message\" id actually match a message?\n message = Message.find_by_id(msg_id)\n if message\n msg_tag = message_id_tag(:id => msg_id, :action => :confirm_tag) # e.g. !2104\n search_target = Regexp.new('[\\'\\s\\(\\[]*' + \"#{Regexp.escape(msg_tag)}\" + '[\\'\\s\\.,\\)\\]]*')\n # The main reason to strip out the tag (like !2104) from the message is that it may be the\n # first part of the response, if there is one; e.g. \"!2104 Kafanchan\" replying to a message\n # requesting location. \n user_reply = first_nonblank_line(@body)\n#puts \"**** user_reply='#{user_reply}'\"\n user_reply = user_reply.sub(search_target, ' ').strip if user_reply\n # Mark all members with this email address as having responded to this message\n @possible_senders.each do |a_member|\n message.process_response(:member => a_member, :text => user_reply, :mode => 'email')\n end\n else\n msg_tag = message_id_tag(:id => msg_id, :action => :create, :location => :body)\n Notifier.send_generic(@from_address, I18n.t('error_msg.invalid_confirmation')).deliver\n end\n end\n end",
"def find_all_messages\n if self.forsale\n return Message.where('seller_item_id == ?', self.id)\n elsif self.wanted\n return Message.where('buyer_item_id == ?', self.id)\n else\n return nil\n end\n end",
"def get_safebox_messages(safebox)\n raise SendSecureException.new(\"SafeBox GUID cannot be null\") if safebox.guid == nil\n @json_client.get_safebox_messages(safebox.guid)[\"messages\"].map {|p| Message.new(p) }\n end",
"def messages\n @messages ||= parse_messages(@raw_messages)\n end",
"def fetch_conversation_if_exists\n # all members phone numbers should be included to do a proper lookup\n numbers = parsed_phones + [inviter.phone_normalized]\n inviter.conversations.find_by_phones(numbers).first\n end",
"def find_by_message_id(message_id)\n @gmail.inbox.find(message_id: message_id)\n end",
"def un_collect_msg(msgid)\n uri = \"cgi-bin/setstarmessage?t=ajax-setstarmessage&token=#{ @token }&lang=zh_CN\"\n params = {\n ajax: 1,\n f: 'json',\n lang: 'zh_CN',\n msgid: msgid,\n random: rand,\n token: @token,\n value: 0\n }\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/message'\\\n \"?t=message/list&token=#{ @token }&count=20&day=7\"\n }\n resource = RestClient::Resource.new(@home_url, headers: headers,\n cookies: @cookies)\n res = resource[uri].post params\n JSON.parse res.to_s\n end",
"def get_media_content_for_message(message_id)\n begin\n message_sql = \"SELECT * FROM mediacontent WHERE mediacontentid IN\";\n message_sql += \" (SELECT messagemediacontent.mediaid FROM messagemediacontent WHERE messageid = #{message_id})\";\n message_sql += \" AND (( iPodVideo IS NOT NULL AND iPodVideo != '') OR (HighQFilePath IS NOT NULL AND HighQFilePath != '' ))\";\n message_media_content_data = Immutable.dbh.execute(message_sql);\n\n return message_media_content_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting message media content data from DB, Check migration log for more details');\n end\n end",
"def find_message!\n return self if message || organization.nil?\n self.message = organization.messages.find_by_message_id_header(message_id)\n return self\n end",
"def list_of_messages()\n\t\t\n\t\t#Create a new request\n\t\trequest_url = \"https://www.googleapis.com/gmail/v1/users/#{@email}/messages?labelIds=Label_1&access_token=#{@access_token}\"\n\n\t\t#GET REQUEST\n\t\tresponse = RestClient.get request_url\n\t\tresponse_body = JSON.parse(response.body)\n\n\t\t#Looping through all the Messages and grabbing id\n\t\tmessages= Array.new\n\n\t\ttemp = response_body['messages']\n\t\ttemp.each do |item|\n\t\t\tmessages.push(item['id'])\n\t\tend \n\t\n\t\treturn messages\n\tend",
"def handle_messages\n messages = *disque.fetch(from: queue_name,timeout: 100,count: batch_size)\n messages.each do |queue,id,data|\n Chore.logger.debug \"Received #{id.inspect} from #{queue.inspect} with #{data.inspect}\"\n yield(id, queue, nil, data, 0)\n Chore.run_hooks_for(:on_fetch, id, data)\n end\n messages\n end",
"def show_messages(uids)\n return if uids.nil? or (Array === uids and uids.empty?)\n\n fetch_data = 'BODY.PEEK[HEADER.FIELDS (DATE SUBJECT MESSAGE-ID)]'\n messages = imap.fetch uids, fetch_data\n fetch_data.sub! '.PEEK', '' # stripped by server\n\n messages.each do |res|\n puts res.attr[fetch_data].delete(\"\\r\")\n end\n end",
"def message_id\n @message_id ||= message.message_id\n end",
"def get_message_lookup record_id\r\n # the base uri for api requests\r\n query_builder = Configuration.BASE_URI.dup\r\n\r\n # prepare query string for API call\r\n query_builder << \"/messages/{record_id}\"\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n \"record_id\" => record_id,\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n \"user-agent\" => \"Flowroute Messaging SDK 1.0\"\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers:headers, auth:{ :user => @username, :password => @password }\r\n\r\n #Error handling using HTTP status codes\r\n if !(response.code.between?(200,206)) # [200,206] = HTTP OK\r\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"def find_all_messages\n\t\tif self.forsale\n\t\t\treturn Message.where('seller_item_id == ?', self.id) \n\t\telsif self.wanted \n\t\t\treturn Message.where('buyer_item_id == ?', self.id) \n else \n\t \t\treturn nil \t\n\t end \n\tend",
"def find_messages\n mailbox = @boxes.find { |box| @mailbox =~ /#{box}/ } # TODO: needs more work\n raise unless mailbox\n age = @cleanse[mailbox]\n before_date = (Time.now - 86400 * age).imapdate\n\n search [\n 'NOT', 'NEW',\n 'NOT', 'FLAGGED',\n 'BEFORE', before_date\n ], 'read, unflagged messages'\n end",
"def read_messages\n @useConversations = Message.where(\"user_id = (?)\", current_user.id).pluck(:conversation_id)\n if @useConversations.count > 0\n @useConversations = @useConversations.uniq # Unique\n @useConversations = @useConversations.map(&:inspect).join(', ')\n #@updatemsg = Message.where(\"user_id != (?) and conversation_id IN (?)\", current_user.id, @useConversations).update_all(:mark_as_read => true)\n @updatemsg = Message.where(\"user_id != #{current_user.id} and conversation_id in (#{@useConversations})\").update_all(:mark_as_read => true)\n session[:mark_messages] = 0 # Mark as read messages\n end\n end",
"def fetch\n messages = @connection.uid_search(['ALL'])\n RAILS_DEFAULT_LOGGER.info \"MESSAGES Found? [#{messages.size}]\"\n RAILS_DEFAULT_LOGGER.info \"MESSAGE UIDS #{messages.inspect}\"\n\n if messages.size > @index\n RAILS_DEFAULT_LOGGER.info \".. Fetching INDEX [#{@index}] ...\"\n @index += 1\n result = process_upload(messages[@index - 1])\n return result\n else\n return nil end\n end",
"def get_messages\n if Conversation.previous_talks(params[:sender_id],params[:recipient_id]).present?\n @conversation = Conversation.previous_talks(params[:sender_id],params[:recipient_id]).first\n else\n @conversation = Conversation.create!(conversation_params)\n end\n end",
"def id\n messaging['id']\n end",
"def process_complaint_messages\n @messages.map! do |message|\n m = message['Message']\n details = {\n :complaint_detail => {\n :complaint_type => m['complaint'].fetch('complaintFeedbackType', 'N/A'),\n :complaint_date => m['complaint'].fetch('arrivalDate', 'N/A')\n }\n }\n Message.new(message['MessageId'], account_id, m['mail']['timestamp'], m['mail']['destination'][0], 'complaint', details)\n end\n end",
"def build_lookup_belongs(blank = nil)\n # TODO: Remove rescue statement\n @sms_templates = SmsTemplate.find_all_for_select_option('')\n @message_signature = \"\\n--\\n#{self.current_user.display_name.truncate(24)}\"\n @sms_recipients = AddressbookContact.find(:all, :order => 'name ASC')\n \n end",
"def fetch id\n each_unread([]) do |m|\n if m.id == id\n return m\n end\n end\n\n nil\n end",
"def show\n @message = @message\n @parent = Message.find_by_id(@reply_message_id)\n\n if @message.is_system_notification != 1\n @id = []\n @id << @message.user_id.to_s && @id << @message.to_user_id.to_s\n if !@id.include?(@current_user.id.to_s)\n redirect_to \"/contact_us\"\n end\n else\n @to_user_id_array = @message.to_user_id.split(\",\")\n if !@to_user_id_array.include?(@current_user.id.to_s)\n redirect_to \"/contact_us\"\n end\n end\n\n\n end",
"def parse_h_by_id_once(\n msg, # Text to parse the ID from\n matches = [], # Array to add the _normalized_ ID if found\n type: Level, # Type of highscoreable ID\n mappack: false, # Whether to look for mappack IDs or regular ones\n dashed: true # Strict dashed IDs vs optionally-dashed IDs\n )\n # Parse selected pattern\n packing = mappack ? :mappack : :vanilla\n dashing = dashed ? :dashed : :dashless\n pattern = ID_PATTERNS[type.to_s][packing][dashing]\n\n # Try to match pattern\n match = msg.match(pattern)\n return ['', []] if match.nil?\n type = type.mappack if mappack\n str = normalize_name(match)\n matches << str\n res = type.find_by(name: str)\n res ? [\"Single match found for #{match}\", [res]] : ['', []]\nrescue\n ['', []]\nend",
"def message_id\n return @message_id\n end",
"def extract_ticket_ids\n tickets = message.split('Ref: ').last\n tickets.gsub('#', '').split(',').map(&:strip)\n end",
"def message_id\n self['message-id']\n end",
"def messages\n read_only()\n @conn.uid_search(['ALL']).map do |uid|\n Message.new(@conn, uid)\n end\n end",
"def get_messages_link_and_content()\n dputs __method__.to_s\n urls = {:public => []}\n # public messages\n message_req = setup_http_request($messages, @cookie)\n res = @http.request(message_req)\n urls[:public] = messages_parsing(res.body.force_encoding('utf-8'))\n msgs = {:public => []}\n until urls.empty?\n k, uu = urls.shift\n next if uu == nil\n uu.map{|u|\n get_conversations(u, k.to_s).map do |m|\n next if not m\n msgs[k] << m\n end\n }\n end\n # ex: {:public => [{:msg=>[\"[Aujourd'hui à 09h48] Miguel L : \\\"BONJOUR GREG vous arrive jusque a la gare pardieu\\\"\", \"...\"], :url=>\"/messages/respond/kAxP4rA...\", :token => \"XazeAFsdf...\"}], :private => [{:msg => ...}]\n return msgs\n end",
"def collect_msg(msgid)\n uri = \"cgi-bin/setstarmessage?t=ajax-setstarmessage&token=#{ @token }&lang=zh_CN\"\n params = {\n ajax: 1,\n f: 'json',\n lang: 'zh_CN',\n msgid: msgid,\n random: rand,\n token: @token,\n value: 1\n }\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/message'\\\n \"?t=message/list&token=#{ @token }&count=20&day=7\"\n }\n resource = RestClient::Resource.new(@home_url, headers: headers,\n cookies: @cookies)\n res = resource[uri].post params\n JSON.parse res.to_s\n end",
"def messages\n Message\n .where(\"messages.user_id = :user OR messages.recipient_id = :user\", user: id)\n .where.not(\"messages.recipient_id = :user AND messages.status = :status\", user: id, status: 0)\n .where.not(\"messages.recipient_id = :user AND messages.status = :status\", user: id, status: 4)\n .includes(:permissions).order(\"permissions.created_at DESC\")\n end",
"def get_response(message_id)\n responses.delete(message_id.to_s)\n end",
"def get_messages\n unless @connection.mails.empty?\n @connection.each_mail do |msg|\n begin\n process_message(msg.pop)\n rescue\n handle_bogus_message(msg.pop)\n end\n # Delete message from server\n msg.delete\n end\n end\n end",
"def retrieve_tweet_ids\n imap = Net::IMAP.new('imap.gmail.com', 993, true, nil, false)\n imap.login(@account['credentials']['email_address'], @account['credentials']['email_password'])\n imap.select('INBOX')\n imap.search([\"NOT\",\"SEEN\"]).each do |message_id|\n msg = imap.fetch(message_id, 'RFC822')[0].attr['RFC822']\n # imap.store(message_id, '+FLAGS', [:Seen])\nputs msg\n end \n imap.logout()\n imap.disconnect()\n end",
"def original_message_id \n @private_messages.first.original_message_id # All threaded messages share the same original ID, so we'll just call the first record\n end",
"def process_msgs\n end",
"def check_for_messages\n @message_unviewed = Message.all(:recipient_id => current_user.id, :viewed => false, :opportunity => Opportunity.all(:active => true))\n if @message_unviewed != []\n flash.now[:warning] = 'You have unread messages'\n end\n end",
"def run\n local_only_uids = serializer.uids - folder.uids\n return if local_only_uids.empty?\n\n serializer.filter do |message|\n !local_only_uids.include?(message.uid)\n end\n end",
"def get_messages(&block)\n get(:messages) do |msgs|\n msgs = msgs.split ', '\n msgs.map! { |id| SkypeMessage.withId @skype, id.to_i }\n block.to_proc.call msgs\n end\n end",
"def user_id; @message_impl.getUserId; end",
"def receive_messages\n begin\n resp = @sqs.receive_message(\n message_attribute_names: PIPE_ARR,\n queue_url: @settings[:consuming_sqs_queue_url],\n wait_time_seconds: @settings[:wait_time_seconds],\n max_number_of_messages: @settings[:max_number_of_messages],\n )\n resp.messages.select do |msg|\n # switching whether to transform the message based on the existance of message_attributes\n # if this is a raw SNS message, it exists in the root of the message and no conversion is needed\n # if it doesn't, it is an encapsulated messsage (meaning the SNS message is a stringified JSON in the body of the SQS message)\n begin\n if !msg.key? 'message_attributes'\n # extracting original SNS message\n tmp_body = JSON.parse msg.body\n # if there is no Message, this isn't a SNS message and something has gone terribly wrong\n next if tmp_body.key? 'Message'\n # replacing the body with the SNS message (as it would be in a raw delivered SNS-SQS message)\n msg.body = tmp_body['Message']\n msg.message_attributes = {}\n # discarding messages without attributes, since this would lead to an exception in subscribe\n next if tmp_body.key? 'MessageAttributes'\n # parsing the message_attributes\n tmp_body['MessageAttributes'].each do |name, value|\n msg.message_attributes[name] = Aws::SQS::Types::MessageAttributeValue.new\n msg.message_attributes[name].string_value = value['Value']\n msg.message_attributes[name].data_type = 'String'\n end\n end\n msg\n rescue JSON::JSONError => e\n self.logger.info(e)\n end\n end\n rescue Aws::SQS::Errors::ServiceError => e\n self.logger.info(e)\n end\n end",
"def next_message_id\n @message_id += 1\n end",
"def next_message_id\n @message_id += 1\n end",
"def check_message_id_md5\n return true if message_id.blank?\n\n self.message_id_md5 = Digest::MD5.hexdigest(message_id.to_s)\n end",
"def get_contention_ids(request_issues_updates)\n request_issues_updates.map do |riu|\n riu.error.split(\"EndProductEstablishment::ContentionNotFound: \").second[/\\d+/].to_i\n end\n end",
"def messages\n @queue.messages.select { |m| m.claim == self }\n end",
"def my_messages\n my_mesgs = Message.includes(:user).where(receiver_id: @current_user.id).order(created_at: :desc)\n if my_mesgs.any?\n render json: my_mesgs, :include => {\n :user => {\n :only => [:id, :firstname, :lastname]\n }\n },\n status: :ok\n else\n render json: {\n status: 'no-content',\n message: 'You don\\'t have any message yet',\n data: []\n },\n status: :no_content\n end\n end",
"def message_details(message_id)\n @api.get(\"#{@api.path}/List/#{@id}/Email/#{message_id}\")\n end",
"def get_messages()\n @@log.debug(\"get_messages starts\")\n subscribe\n StompHelper::pause(\"After subscribe\") if $DEBUG\n for msgnum in (0..@max_msgs-1) do\n message = @conn.receive\n @@log.debug(\"Received: #{message}\")\n if @ack == \"client\"\n @@log.debug(\"in receive, sending ACK, headers: #{message.headers.inspect}\")\n message_id = message.headers[\"message-id\"]\n @@log.debug(\"in receive, sending ACK, message-id: #{message_id}\")\n @conn.ack(message_id) # ACK this message\n end\n StompHelper::pause(\"After first receive\") if (msgnum == 0 and $DEBUG)\n #\n received = message\n end\n end",
"def new_messages\n self.messages.where(mailgun_reply_to_id: nil) \n end",
"def messages\r\n # if messages_updated > 30.min\r\n #url = \"http://twitter.com/statuses/user_timeline/#{username}.xml\" # 'statuses/status'\r\n \r\n if picture_id.nil?\r\n # has only username - retrive other user information\r\n logger.debug \"LOCAL ID NIL\"\r\n begin\r\n doc = REXML::Document.new(open(\"http://twitter.com/users/show/#{username}.xml\"))\r\n end\r\n doc.elements.each('user') do |e|\r\n #local_id = e.elements['id'].text\r\n #logger.debug \"LOCAL ID NOW: #{local_id}\"\r\n #name = e.elements['name'].text\r\n pic = Picture.from_url(e.elements[\"profile_image_url\"].text)\r\n pic_id = pic.id\r\n update_attributes(:local_id => e.elements['id'].text, :name => e.elements['name'].text, :picture_id => pic_id)\r\n end\r\n end\r\n \r\n # retrive messages:\r\n msgs = []\r\n if messages_updated.nil? or Time.now - messages_updated > 60.minutes\r\n # retrive from twitter\r\n logger.debug \"retrieving messages from twitter.\"\r\n url = \"http://twitter.com/statuses/user_timeline/#{username}.rss\"\r\n logger.debug(url)\r\n \r\n begin\r\n doc = REXML::Document.new(open(url)) # URI.encode( )\r\n rescue\r\n # unable to load from twitter, retrieve from local database\r\n logger.debug \"FAILED to retrieve from twitter\"\r\n return (msgs = Message.find_all_by_twitter_user_id(self.id)).nil? ? [] : msgs\r\n end\r\n doc.elements.each('rss/channel/item') do |s|\r\n local_id = s.elements[\"link\"].text.split('/')[-1].to_i\r\n text = s.elements[\"description\"].text[username.length+2..-1]\r\n created = Time.parse(s.elements[\"pubDate\"].text)\r\n msgs << Message.find_or_create_by_local_id( :local_id => local_id,\r\n :text => text, :twitter_user_id => self.id, :created_at => created)\r\n end\r\n update_attribute(:messages_updated, Time.now)\r\n #msgs = \"hakee\"\r\n else\r\n logger.debug \"retrieving messages from local database\"\r\n msgs = Message.find_all_by_twitter_user_id(self.id)\r\n end\r\n msgs.nil? ? [] : msgs\r\n end",
"def message_id\n\t\tmessage_id = self.headers[\"Message-ID\"]\n\t\tmessage_id.nil? || message_id.empty? ? message_id : nil\n\tend",
"def update\n @groups = Group.all\n @users = User.all\n @message = Message.find(params[:id])\n if params[:message_group_ids] \n @select_group_ids = params[:message_group_ids]\n end\n if !params[:message_group_ids].nil?\n params[:message_group_ids].each do |group_id|\n user_ids = Group.find(group_id).users.collect(&:id)\n user_ids.each do |user_id|\n if !params[:message][:user_ids].include?(user_id.to_s)\n params[:message][:user_ids] << user_id.to_s\n end\n end\n end\n end\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: t(:message_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def alma_availability_mms_ids\n fetch(\"bound_with_ids\", [id])\n end",
"def alma_availability_mms_ids\n fetch(\"bound_with_ids\", [id])\n end",
"def process_irc message\n res = message.scan(/\\00314\\[\\[\\00307(.*)\\00314\\]\\]\\0034\\s+(.*)\\00310\\s+\\00302.*(diff|oldid)=([0-9]+)&(oldid|rcid)=([0-9]+)\\s*\\003\\s*\\0035\\*\\003\\s*\\00303(.*)\\003\\s*\\0035\\*\\003\\s*\\((.*)\\)\\s*\\00310(.*)\\003/).first\n #get rid of the diff/oldid and oldid/rcid groups\n res.delete_at(4)\n res.delete_at(2)\n res\n end",
"def msg_id(key)\n key =~ /^(msgid:[^:]*:[-0-9a-f]*):.*$/ && $1\n end",
"def get_audio_content_for_message(message_id)\n begin\n\n audio_sql = \"SELECT * FROM mediacontent WHERE mediacontentid\";\n audio_sql += \" IN (SELECT messagemediacontent.mediaid FROM messagemediacontent WHERE\";\n audio_sql += \" messageid = #{message_id}) AND ( HighQFilePath IS NOT NULL)\";\n audio_sql += \" AND (ContentTypeID = 5 OR ContentTypeID = 2) AND (HighQFilePath LIKE '%mp3')\";\n audio_sql += \" AND HighQFilePath != ''\"\n\n message_audio_content_data = Immutable.dbh.execute(audio_sql);\n return message_audio_content_data;\n rescue DBI::DatabaseError => e\n Immutable.log.error \"Error code: #{e.err}\"\n Immutable.log.error \"Error message: #{e.errstr}\"\n Immutable.log.error \"Error SQLSTATE: #{e.state}\"\n abort('An error occurred while getting audio content data from DB, Check migration log for more details');\n end\n end",
"def alma_availability_mms_ids\n fetch('bound_with_ids', [id])\n end",
"def has_message_id?\n header.has_message_id?\n end",
"def read_new_messages(last_id=nil)\n newer = \"\"\n newer = \"?newer_than=#{last_id.to_s}\" if last_id\n # Get latest 20 messages\n begin\n reply = @access_token.get(\"/api/v1/messages.xml\" + newer)\n \n# File.open(\"tmp/dump.xml\", \"w\") do |f|\n# f.write reply.body \n# end\n \n # Parse xml. doc has xml, updates has the messages\n doc, @updates = Hpricot::XML(reply.body), []\n \n # First get the names of users\n @names = {}\n (doc/:reference).each do |ref|\n next unless ref.at('type').innerHTML.include? 'user'\n id = ref.at('id').innerHTML\n @names[id] = ref.at('name').innerHTML\n end\n \n # Then the messages\n last_id = 0\n (doc/:message).each do |msg|\n id = msg.at('id').innerHTML\n last_id = id.to_i if last_id < id.to_i\n from = msg.at('sender-id').innerHTML # get the id\n from = @names[from] if @names[from] # get name from id\n time = msg.at('created-at').innerHTML\n content= msg.at('body').at('plain').innerHTML\n @updates << {:id => id, :from => from, :content => content, :time => time}\n end\n \n # Show\n# render :text => make_html(updates, names)\n rescue StandardError, Timeout::Error\n last_id = 0 # Timeouts are very common\n end\n last_id == 0 ? nil : last_id\n end",
"def next_message_id\n if not @message_id\n @message_id = 1\n else\n @message_id += 1\n end\n\n @message_id < (1 << (4*8)) ? @message_id : (@message_id = 1)\n end",
"def get_new_messages\n get_messages_link_and_content\n end",
"def get_messages\r\n init_message_handler\r\n begin\r\n while (line = @s.gets(\"\\n\"))\r\n next if line.nil?\r\n line = line.chomp.gsub /\\n|\\r/, ''\r\n next if line == ''\r\n msg_map = JSON.parse(line)\r\n @message_handler_service.process msg_map\r\n end\r\n rescue Exception => e\r\n puts 'get_messages raise exception:'\r\n puts e.backtrace.inspect\r\n end\r\n end",
"def handle_messages!()\n puts (\"Handling incoming messages\")\n default_outgoing_number = \"2153466997\"\n\n ##?REVIEW: could have multiple outgoing states\n handled_state = MessageState.find_by_name('handled')\n error_state = MessageState.find_by_name(\"error_incoming\")\n\n messages_to_handle.each do |message|\n begin\n puts (\"Handling incoming messages -- individual message\")\n message.tokens = message.body.split(/ /)\n\n number_string = message.sender_number\n number_string.sub!(\"+1\", \"\")\n puts \"Message is from number: \" + number_string\n \n num = PhoneNumber.find_or_create_by_number( number_string ) \n num.save\n\n survey_state = SurveyState.find(:all, :conditions => { :status => true, :phone_number_id => 1 } ).first\n\n if ( survey_state != nil )\n puts(\"handle survey response.\")\n survey_state.handle_message(num, message.body)\n handled_state.messages.push(message)\n handled_state.save\n next\n end\n\n list = determine_list(message) \n if ( list == nil ) \n puts(\"couldn't determine list\")\n Rails.logger.warn(\"couldn't determine list\")\n error_state.messages.push(message)\n error_state.save\n next\n end \n\n ##?REVIEW: handle this more elegantly \n ##If the message comes via email, save the carrier address.\n if (message.respond_to? :carrier) \n num.provider_email = message.carrier \n end\n\n if ( message.tokens.count > 0 ) \n first_token = message.tokens[0]\n else\n Rails.logger.warn(\"empty message\")\n puts(\"empty message\")\n error_state.messages.push(message)\n error_state.save\n next\n end\n \n if ( first_token =~ /^join$/i ) ## join action\n list.handle_join_message(message, num)\n elsif ( first_token =~ /^leave$/i or first_token =~ /^quit$/i ) ## quit action\n ##?TODO: move to list model \n Rails.logger.info(\"Received list quit message\")\n list.create_outgoing_message( num, \"You have been removed from the \" + list.name + \" list, as you requested.\" )\n list.remove_phone_number(num)\n list.save\n else ## send action (send a message to a list)\n Rails.logger.info(\"List received a message: \" + list.name )\n list.handle_send_action(message, num)\n end\n\n handled_state.messages.push(message)\n handled_state.save\n rescue StandardError => e\n puts(\"exception while processing message\")\n puts(\"error was: \" + e.inspect )\n puts(\"error backtrace: \" + e.backtrace.inspect )\n puts(\"error was: \" + e.inspect )\n puts(\"e: \" + e.to_s )\n\n Rails.logger.warn(\"exception while processing message\")\n error_state.messages.push(message)\n error_state.save\n end\n end ## message loop -- handled a message\n end",
"def get_mailbox_messages mailbox_id, posted_since = \"\", include_deleted = \"false\"\n\t\t\tposted_since = Date.today if posted_since.length == 0\n\n\t\t\t@response = api_request 'LoadMessages', [mailbox_id, posted_since, include_deleted]\n\t\t\traise ZenfolioAPI::ZenfolioAPISessionError, @response['error']['message'] if @response['result'].nil? && @response['error'].length > 0\n\n\t\t\t\n\t\tend",
"def getContacts\n messages = [] \n \n if !self.received_messages.nil?\n messagesRecv = (self.received_messages.order(:updated_at)).reverse \n\t messagesRecv.each do |recv|\n\t user = User.find(recv.sender_id)\n\t unless messages.include?(user)\n\t\t messages += [user]\n\t\t end\n\t end\n end\n if !self.send_messages.nil?\n messagesSend = (self.send_messages.order(:updated_at)).reverse \n\t messagesSend.each do |send|\n\t user = User.find(send.receiver_id)\n\t unless messages.include?(user)\n\t\t messages += [user]\n\t\t end\n\t end\n end\n\t return messages\n end",
"def lookup_message(name)\n\t\tend",
"def unique_ids(all_messages)\n all_id_pairs = all_messages.map { |c| [c.sender_id, c.receiver_id] }\n unique_ids = all_id_pairs.flatten\n unique_ids = unique_ids.uniq.reject! { |i| i == id }\n end",
"def good_message(message)\n return unless message[:service] == :groupme && message[:group]\n\n text = message[:text]\n attachments = message[:attachments]\n\n (text && !text.empty?) || !convert_attachments(attachments).empty?\n end",
"def check_conversion\n @mes = []\n params.keys.each do |key|\n if key[0, 2] == 'me'\n id = key[2, key.length - 2]\n media_element_id = correct_integer?(id) ? id.to_i : 0\n media_element = MediaElement.find_by_id media_element_id\n ok = (media_element && current_user.id == media_element.user_id && !media_element.is_public)\n media_element.set_status current_user.id if ok\n @mes << {\n :ok => ok,\n :media_element_id => media_element_id,\n :media_element => media_element\n }\n end\n end\n end"
] | [
"0.63826364",
"0.6215906",
"0.6174645",
"0.6132375",
"0.60798234",
"0.6048526",
"0.5982312",
"0.59225845",
"0.588637",
"0.5834074",
"0.5827028",
"0.5820203",
"0.5777928",
"0.57758",
"0.5766871",
"0.56620264",
"0.5660341",
"0.56515366",
"0.5645467",
"0.56278944",
"0.5589139",
"0.55611044",
"0.5561047",
"0.5541266",
"0.5535687",
"0.55273944",
"0.552019",
"0.55193496",
"0.5515097",
"0.5514638",
"0.5503399",
"0.54996717",
"0.54917127",
"0.548344",
"0.54661137",
"0.5455318",
"0.54530287",
"0.5446832",
"0.5436847",
"0.5430198",
"0.54116863",
"0.5408932",
"0.5374138",
"0.5368665",
"0.53567713",
"0.53536594",
"0.5352723",
"0.53462034",
"0.53456765",
"0.53309375",
"0.53238386",
"0.53162295",
"0.5300731",
"0.5296597",
"0.5287166",
"0.5284881",
"0.52818996",
"0.5281418",
"0.5273963",
"0.52702326",
"0.52626646",
"0.52596235",
"0.52588624",
"0.5237712",
"0.5233899",
"0.5231644",
"0.52286476",
"0.52250844",
"0.52043337",
"0.5204219",
"0.52011764",
"0.52011764",
"0.5185321",
"0.51847965",
"0.5183489",
"0.51787764",
"0.5175649",
"0.51748526",
"0.5164176",
"0.51577556",
"0.5153804",
"0.5153283",
"0.5150775",
"0.5150775",
"0.51499414",
"0.5149796",
"0.5148029",
"0.51444656",
"0.514382",
"0.5139936",
"0.5134414",
"0.5131921",
"0.51301783",
"0.512584",
"0.51237667",
"0.5111514",
"0.5107853",
"0.5105511",
"0.5096049",
"0.50905186"
] | 0.6604395 | 0 |
we don't encode any nontext parts here, because json encoding of binary objects is crazytalk, and because those are likely to be big anyways. | def to_h message_id, preferred_type
parts = mime_parts(preferred_type).map do |type, fn, cid, content, size|
if type =~ /^text\//
{ :type => type, :filename => fn, :cid => cid, :content => content, :here => true }
else
{ :type => type, :filename => fn, :cid => cid, :size => content.size, :here => false }
end
end.compact
{ :from => (from ? from.to_email_address : ""),
:to => to.map(&:to_email_address),
:cc => (cc || []).map(&:to_email_address),
:bcc => (bcc || []).map(&:to_email_address),
:subject => subject,
:date => date,
:refs => refs,
:parts => parts,
:message_id => message_id,
:snippet => snippet,
:reply_to => (reply_to ? reply_to.to_email_address : ""),
:recipient_email => recipient_email,
:list_post => list_post,
:list_subscribe => list_subscribe,
:list_unsubscribe => list_unsubscribe,
:email_message_id => @msgid,
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encode(obj); end",
"def encode!; end",
"def encode_chunk(chunk); end",
"def encode_string_ex; end",
"def encode_string; end",
"def encoder; end",
"def encoder; end",
"def jsonify(hash)\n deep_reduce(hash) do |k, v, h|\n if v.is_a?(String)\n if v.encoding == ::Encoding::ASCII_8BIT\n # Only keep binary values less than a certain size. Sizes larger than this\n # are almost always file uploads and data we do not want to log.\n if v.length < BINARY_LIMIT_THRESHOLD\n # Attempt to safely encode the data to UTF-8\n encoded_value = encode_string(v)\n if !encoded_value.nil?\n h[k] = encoded_value\n end\n end\n elsif v.encoding != ::Encoding::UTF_8\n h[k] = encode_string(v)\n else\n h[k] = v\n end\n elsif is_a_primitive_type?(v)\n # Keep all other primitive types\n h[k] = v\n end\n end\n end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def encoding; end",
"def serialize(_object, data); end",
"def serialize(_object, data); end",
"def serialize(object, data); end",
"def json_value\n [Base64.strict_encode64(value)]\n end",
"def __to_json_map__\n result = {}\n key = 'byte0'\n value = (byte0.nil? ? nil : byte0.__to_json_map__)\n result.store(key, value)\n key = 'byte1'\n value = (byte1.nil? ? nil : byte1.__to_json_map__)\n result.store(key, value)\n key = 'byte2'\n value = (byte2.nil? ? nil : byte2.__to_json_map__)\n result.store(key, value)\n key = 'byte3'\n value = (byte3.nil? ? nil : byte3.__to_json_map__)\n result.store(key, value)\n key = 'byte4'\n value = (byte4.nil? ? nil : byte4.__to_json_map__)\n result.store(key, value)\n key = 'byte5'\n value = (byte5.nil? ? nil : byte5.__to_json_map__)\n result.store(key, value)\n key = 'char0'\n value = (char0.nil? ? nil : char0.__to_json_map__)\n result.store(key, value)\n key = 'char1'\n value = (char1.nil? ? nil : char1.__to_json_map__)\n result.store(key, value)\n key = 'char2'\n value = (char2.nil? ? nil : char2.__to_json_map__)\n result.store(key, value)\n key = 'char3'\n value = (char3.nil? ? nil : char3.__to_json_map__)\n result.store(key, value)\n key = 'char4'\n value = (char4.nil? ? nil : char4.__to_json_map__)\n result.store(key, value)\n key = 'char5'\n value = (char5.nil? ? nil : char5.__to_json_map__)\n result.store(key, value)\n key = 'wchar0'\n value = (wchar0.nil? ? nil : wchar0.__to_json_map__)\n result.store(key, value)\n key = 'wchar1'\n value = (wchar1.nil? ? nil : wchar1.__to_json_map__)\n result.store(key, value)\n key = 'wchar2'\n value = (wchar2.nil? ? nil : wchar2.__to_json_map__)\n result.store(key, value)\n key = 'wchar3'\n value = (wchar3.nil? ? nil : wchar3.__to_json_map__)\n result.store(key, value)\n key = 'wchar4'\n value = (wchar4.nil? ? nil : wchar4.__to_json_map__)\n result.store(key, value)\n key = 'wchar5'\n value = (wchar5.nil? ? nil : wchar5.__to_json_map__)\n result.store(key, value)\n key = 'int8b0'\n value = (int8b0.nil? ? nil : int8b0.__to_json_map__)\n result.store(key, value)\n key = 'int8b1'\n value = (int8b1.nil? ? nil : int8b1.__to_json_map__)\n result.store(key, value)\n key = 'int8b2'\n value = (int8b2.nil? ? nil : int8b2.__to_json_map__)\n result.store(key, value)\n key = 'int8b3'\n value = (int8b3.nil? ? nil : int8b3.__to_json_map__)\n result.store(key, value)\n key = 'int8b4'\n value = (int8b4.nil? ? nil : int8b4.__to_json_map__)\n result.store(key, value)\n key = 'int8b5'\n value = (int8b5.nil? ? nil : int8b5.__to_json_map__)\n result.store(key, value)\n key = 'uint8b0'\n value = (uint8b0.nil? ? nil : uint8b0.__to_json_map__)\n result.store(key, value)\n key = 'uint8b1'\n value = (uint8b1.nil? ? nil : uint8b1.__to_json_map__)\n result.store(key, value)\n key = 'uint8b2'\n value = (uint8b2.nil? ? nil : uint8b2.__to_json_map__)\n result.store(key, value)\n key = 'uint8b3'\n value = (uint8b3.nil? ? nil : uint8b3.__to_json_map__)\n result.store(key, value)\n key = 'uint8b4'\n value = (uint8b4.nil? ? nil : uint8b4.__to_json_map__)\n result.store(key, value)\n key = 'uint8b5'\n value = (uint8b5.nil? ? nil : uint8b5.__to_json_map__)\n result.store(key, value)\n key = 'int16b0'\n value = (int16b0.nil? ? nil : int16b0.__to_json_map__)\n result.store(key, value)\n key = 'int16b1'\n value = (int16b1.nil? ? nil : int16b1.__to_json_map__)\n result.store(key, value)\n key = 'int16b2'\n value = (int16b2.nil? ? nil : int16b2.__to_json_map__)\n result.store(key, value)\n key = 'int16b3'\n value = (int16b3.nil? ? nil : int16b3.__to_json_map__)\n result.store(key, value)\n key = 'int16b4'\n value = (int16b4.nil? ? nil : int16b4.__to_json_map__)\n result.store(key, value)\n key = 'int16b5'\n value = (int16b5.nil? ? nil : int16b5.__to_json_map__)\n result.store(key, value)\n key = 'uint16b0'\n value = (uint16b0.nil? ? nil : uint16b0.__to_json_map__)\n result.store(key, value)\n key = 'uint16b1'\n value = (uint16b1.nil? ? nil : uint16b1.__to_json_map__)\n result.store(key, value)\n key = 'uint16b2'\n value = (uint16b2.nil? ? nil : uint16b2.__to_json_map__)\n result.store(key, value)\n key = 'uint16b3'\n value = (uint16b3.nil? ? nil : uint16b3.__to_json_map__)\n result.store(key, value)\n key = 'uint16b4'\n value = (uint16b4.nil? ? nil : uint16b4.__to_json_map__)\n result.store(key, value)\n key = 'uint16b5'\n value = (uint16b5.nil? ? nil : uint16b5.__to_json_map__)\n result.store(key, value)\n key = 'int32b0'\n value = (int32b0.nil? ? nil : int32b0.__to_json_map__)\n result.store(key, value)\n key = 'int32b1'\n value = (int32b1.nil? ? nil : int32b1.__to_json_map__)\n result.store(key, value)\n key = 'int32b2'\n value = (int32b2.nil? ? nil : int32b2.__to_json_map__)\n result.store(key, value)\n key = 'int32b3'\n value = (int32b3.nil? ? nil : int32b3.__to_json_map__)\n result.store(key, value)\n key = 'int32b4'\n value = (int32b4.nil? ? nil : int32b4.__to_json_map__)\n result.store(key, value)\n key = 'int32b5'\n value = (int32b5.nil? ? nil : int32b5.__to_json_map__)\n result.store(key, value)\n key = 'uint32b0'\n value = (uint32b0.nil? ? nil : uint32b0.__to_json_map__)\n result.store(key, value)\n key = 'uint32b1'\n value = (uint32b1.nil? ? nil : uint32b1.__to_json_map__)\n result.store(key, value)\n key = 'uint32b2'\n value = (uint32b2.nil? ? nil : uint32b2.__to_json_map__)\n result.store(key, value)\n key = 'uint32b3'\n value = (uint32b3.nil? ? nil : uint32b3.__to_json_map__)\n result.store(key, value)\n key = 'uint32b4'\n value = (uint32b4.nil? ? nil : uint32b4.__to_json_map__)\n result.store(key, value)\n key = 'uint32b5'\n value = (uint32b5.nil? ? nil : uint32b5.__to_json_map__)\n result.store(key, value)\n key = 'int64b0'\n value = (int64b0.nil? ? nil : int64b0.__to_json_map__)\n result.store(key, value)\n key = 'int64b1'\n value = (int64b1.nil? ? nil : int64b1.__to_json_map__)\n result.store(key, value)\n key = 'int64b2'\n value = (int64b2.nil? ? nil : int64b2.__to_json_map__)\n result.store(key, value)\n key = 'int64b3'\n value = (int64b3.nil? ? nil : int64b3.__to_json_map__)\n result.store(key, value)\n key = 'int64b4'\n value = (int64b4.nil? ? nil : int64b4.__to_json_map__)\n result.store(key, value)\n key = 'int64b5'\n value = (int64b5.nil? ? nil : int64b5.__to_json_map__)\n result.store(key, value)\n key = 'uint64b0'\n value = (uint64b0.nil? ? nil : uint64b0.__to_json_map__)\n result.store(key, value)\n key = 'uint64b1'\n value = (uint64b1.nil? ? nil : uint64b1.__to_json_map__)\n result.store(key, value)\n key = 'uint64b2'\n value = (uint64b2.nil? ? nil : uint64b2.__to_json_map__)\n result.store(key, value)\n key = 'uint64b3'\n value = (uint64b3.nil? ? nil : uint64b3.__to_json_map__)\n result.store(key, value)\n key = 'uint64b4'\n value = (uint64b4.nil? ? nil : uint64b4.__to_json_map__)\n result.store(key, value)\n key = 'uint64b5'\n value = (uint64b5.nil? ? nil : uint64b5.__to_json_map__)\n result.store(key, value)\n result\n end",
"def decode; end",
"def decode; end",
"def serialize; end",
"def serialize; end",
"def to_json_raw_object()\n #This is a stub, used for indexing\n end",
"def serialize(object) end",
"def json_serialize\n end",
"def encode\n # no op\n end",
"def encoded_string(obj)\n obj.to_s.encode('utf-8', invalid: :replace, undef: :replace)\n end",
"def encode_as_utf8(obj)\n if obj.is_a? Hash\n obj.each_pair do |key, val|\n encode_as_utf8(val)\n end\n elsif obj.is_a?(Array)\n obj.each do |val|\n encode_as_utf8(val)\n end\n elsif obj.is_a?(String) && obj.encoding != Encoding::UTF_8\n if !obj.force_encoding(\"UTF-8\").valid_encoding?\n obj.force_encoding(\"ISO-8859-1\").encode!(Encoding::UTF_8, :invalid => :replace, :undef => :replace)\n end\n end\n obj\n end",
"def encode(data); ::BSON.serialize(data).to_s; end",
"def binary_string; end",
"def encodings; end",
"def as_extended_json(**options)\n subtype = @raw_type.each_byte.map { |c| c.to_s(16) }.join\n subtype = \"0#{subtype}\" if subtype.length == 1\n\n value = Base64.encode64(data).strip\n\n if options[:mode] == :legacy\n { '$binary' => value, '$type' => subtype }\n else\n { '$binary' => { 'base64' => value, 'subType' => subtype } }\n end\n end",
"def internal_encoding()\n #This is a stub, used for indexing\n end",
"def to_json(state = T.unsafe(nil)); end",
"def to_json(state = T.unsafe(nil)); end",
"def encode(object)\n ::MultiJson.encode(object)\n end",
"def tiny_json\n @small_json ||= Oj.dump(self.ensmallen)\n end",
"def encoding()\n #This is a stub, used for indexing\n end",
"def encode_with(coder_) # :nodoc:\n data_ = marshal_dump\n coder_['format'] = data_[0]\n if data_[1].kind_of?(::String)\n coder_['value'] = data_[1]\n coder_['parse_params'] = data_[2] if data_[2]\n else\n coder_['fields'] = data_[1]\n coder_['unparse_params'] = data_[2] if data_[2]\n end\n end",
"def encode\n transform :encode \n end",
"def serialize\n \n end",
"def init_jaxb_json_hash(_o)\n super _o\n if !_o['mimeType'].nil?\n _oa = _o['mimeType']\n if(_oa.is_a? Hash)\n @mimeType = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @mimeType = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @mimeType = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @mimeType.push String.from_json(_item)\n else\n @mimeType.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @mimeType = _oa\n end\n end\n if !_o['bytes'].nil?\n _oa = _o['bytes']\n if(_oa.is_a? Hash)\n @bytes = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @bytes = Fixnum.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @bytes = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @bytes.push Fixnum.from_json(_item)\n else\n @bytes.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @bytes = _oa\n end\n end\n if !_o['fileName'].nil?\n _oa = _o['fileName']\n if(_oa.is_a? Hash)\n @fileName = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @fileName = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @fileName = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @fileName.push String.from_json(_item)\n else\n @fileName.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @fileName = _oa\n end\n end\n end",
"def force_convert_to_tnetstring\n ::TNetstring.dump(self.to_hash)\n end",
"def encode_data(data)\n return data if data.is_a? String\n MultiJson.encode(data)\n end",
"def encode\n type_byte + encode_data\n end",
"def jsonify(input); end",
"def coder; end",
"def to_json_raw(*args)\n #This is a stub, used for indexing\n end",
"def encode(string); end",
"def test_serialize_non_ascii_data_to_json\n data = {\"foo\" => \"\\u3042\\u4e9c\\u03b1\"}\n driver = create_driver('')\n assert_equal(%q({\"foo\":\"\\u3042\\u4e9c\\u03b1\"}), driver.instance.to_json(data))\n end",
"def meta_encoding; end",
"def meta_encoding; end",
"def dump(obj, max_bytes: 2**12, max_depth: 3)\n bytesize = 0\n\n hash = obj.each_with_object({}) do |(k, v), acc|\n str = (k.to_json + v.to_json)\n items = acc.keys.size - 1\n\n if bytesize + str.bytesize + items + ELLIPSIS.bytesize > max_bytes\n acc[k] = ELLIPSIS\n break acc\n else\n bytesize += str.bytesize\n acc[k] = dump_val(v, max_depth)\n end\n end\n ::JSON.generate(hash)\n end",
"def serialize!\n end",
"def normalize_encode_params(params); end",
"def raw_json(*)\n # We need to pass no arguments to `Oj::StringWriter` because it expects 0 arguments\n # because its method definition `oj_dump_raw_json` defined in the C classes is defined\n # without arguments. Oj gets confused because it checks if the class is `Oj::StringWriter`\n # and if it is, then it passes 0 arguments, but when it's not (e.g. `NonBlankJsonWriter`)\n # then it passes both. So in this case, we're calling super() to `Oj::StringWriter` with\n # two arguments.\n #\n # https://github.com/ohler55/oj/commit/d0820d2ac1a72584329bc6451d430737a27f99ac#diff-854d0b67397d7006482043d1202c9647R532\n super()\n end",
"def encode_with(coder); end",
"def encode\n raise NotImplementedError\n end",
"def encode(*); self; end",
"def marshal_dump; end",
"def encode_body(buffer)\n buffer << property_id.to_msgpack\n end",
"def serialize_in(json_string, options = {})\n super(ActiveSupport::JSON.decode(json_string), options)\n end",
"def clean_string_for_json(str)\n str.to_s.force_encoding(UTF8)\n end",
"def encode\n return @_data unless @_data.nil?\n @_data = [@bin_data].pack( 'm' ).chomp if @bin_data \n @_data\n end",
"def encoding=(_arg0); end",
"def encoding=(_arg0); end",
"def encoding=(_arg0); end",
"def encoding=(_arg0); end",
"def encoding=(_arg0); end",
"def encoding=(_arg0); end",
"def encoding=(_arg0); end",
"def json\n value.sub(/^serialized-/, '')\n end",
"def initialize(*)\n super.force_encoding(Encoding::BINARY)\n end",
"def escape_json_string(str)\n begin\n \"\\\"#{\n str.gsub(/[\\010\\f\\n\\r\\t\"\\\\><&]/) { |s| ESCAPED_CHARS[s] }.\n gsub(/([\\xC0-\\xDF][\\x80-\\xBF]|\n [\\xE0-\\xEF][\\x80-\\xBF]{2}|\n [\\xF0-\\xF7][\\x80-\\xBF]{3})+/nx) do |s|\n s.unpack(\"U*\").pack(\"n*\").unpack(\"H*\")[0].gsub(/.{4}/, '\\\\\\\\u\\&')\n end\n }\\\"\"\n rescue Encoding::CompatibilityError\n rawbytes = str.dup.force_encoding 'ASCII-8BIT'\n escape_json_string(rawbytes)\n end\n end",
"def writeencoding; end",
"def to_blob; end",
"def to_blob; end",
"def to_blob; end",
"def to_blob; end",
"def to_blob; end",
"def to_blob; end",
"def to_binary; ''; end",
"def encode_end(state)\n\t\tstate.encoded += [ state.key.to_i ].pack('N')\n\tend",
"def encode(object)\n object.to_json\n end",
"def encoder=(_arg0); end",
"def print_b2json(io)\n while not io.eof? do\n bsonobj = BSON.read_bson_document(io)\n Yajl::Encoder.encode(bsonobj, STDOUT)\n STDOUT << \"\\n\"\n end\nend",
"def content_encoding_inflate(body_io); end",
"def should_encode?\n !@raw\n end",
"def encode_body(buffer)\n # Do nothing.\n end",
"def ignore_encoding_error; end",
"def result\n ActiveSupport::JSON.encode(@buffer)\n end"
] | [
"0.6813736",
"0.644952",
"0.64233136",
"0.6201372",
"0.6200101",
"0.61295784",
"0.61295784",
"0.61176884",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6099621",
"0.6028505",
"0.6028505",
"0.60213304",
"0.5998563",
"0.5993429",
"0.59563416",
"0.59563416",
"0.5936284",
"0.5936284",
"0.5911729",
"0.590153",
"0.5862745",
"0.5840706",
"0.5825656",
"0.5822905",
"0.5818769",
"0.5789973",
"0.5779963",
"0.5759571",
"0.5718593",
"0.5699935",
"0.5699935",
"0.5687721",
"0.5676818",
"0.5676683",
"0.566516",
"0.56455874",
"0.5634304",
"0.5619438",
"0.56167924",
"0.5615577",
"0.5610378",
"0.55920523",
"0.55846435",
"0.55641294",
"0.5548588",
"0.5543387",
"0.55405766",
"0.55405766",
"0.55381584",
"0.5533332",
"0.55263305",
"0.5525791",
"0.5523724",
"0.55130196",
"0.5510593",
"0.5503591",
"0.5502682",
"0.5499003",
"0.5490622",
"0.5489104",
"0.5482636",
"0.5482636",
"0.54808384",
"0.54808384",
"0.54808384",
"0.54808384",
"0.54808384",
"0.5470259",
"0.54670817",
"0.5466465",
"0.5465298",
"0.5464006",
"0.5464006",
"0.5464006",
"0.5464006",
"0.5464006",
"0.5464006",
"0.54551315",
"0.54517514",
"0.54514545",
"0.5444542",
"0.54322624",
"0.54289806",
"0.5426003",
"0.5425105",
"0.54180694",
"0.5416969"
] | 0.0 | -1 |
hash the fuck out of all message ids. trust me, you want this. | def munge_msgid msgid
Digest::MD5.hexdigest msgid
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n id.hash + 32 * bs_request.hash\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash\r\n id.hash\r\n end",
"def hash\r\n a = 0\r\n @id.each_byte {|c| a += c.to_i}\r\n (a + @paired.to_i) * HASH_PRIME\r\n end",
"def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"def hash\n @id.hash\n end",
"def hash(message)\n return Digest::SHA1.hexdigest(message)\n end",
"def hash\n guid.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n return @id.hash\n end",
"def all_chunk_hashes\n\t\t\n\t\tbegin\n\t\t\t@all_chunk_map = \"\"\n\t\t\t0.upto(num_chunks-1) { |i|\n\t\t\t\t@all_chunk_map += sha1_chunk(i)\n\t\t\t}\n\n\t\tend unless @all_chunk_map\n\t\t@all_chunk_map\n\tend",
"def hasher\n Hashids.new(@hash_id_state[:salt], @hash_id_state[:length])\n end",
"def hash\n\t\t[@id].hash\n\tend",
"def friends_ids_hash\n friends_ids_hash = Hash.new()\n store = PStore.new(FRIENDS_IDS_PATH + self.twitter_id.to_s)\n store.transaction{friends_ids_hash = store[self.twitter_id]}\n if friends_ids_hash == nil\n friends_ids_hash = Hash.new(0)\n end\n return friends_ids_hash \n end",
"def hash\n \tcustom_unique_id.hash\n end",
"def hash(*) end",
"def hash\n [id, sender, receiver, text, status, contact_id, session_id, message_time, avatar, deleted, charset, charset_label, first_name, last_name, country, phone, price, parts_count, from_email, from_number].hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n keccak256(prefixed_message)\n end",
"def hash_hash(h)\n require 'digest/md5'\n Digest::MD5.hexdigest(Marshal::dump(h.sort))\n end",
"def user_hash(message)\n return Digest::MD5.hexdigest(message.user).to_i(16) + Digest::MD5.hexdigest(message.host).to_i(16)\nend",
"def hash\n keccak256(prefixed_message)\n end",
"def hash\n return super unless has_size?\n\n res = 0\n each do |el|\n res += el.hash\n end\n return res\n end",
"def hash_id\n @hid\n end",
"def hash\n type.hash ^ (id.hash >> 1)\n end",
"def rehash() end",
"def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"def file_ids_hash\n if @file_ids_hash.blank?\n # load the file sha's from cache if possible\n cache_file = File.join(self.path,'.loopoff')\n if File.exists?(cache_file)\n @file_ids_hash = YAML.load(File.read(cache_file))\n else\n # build it\n @file_ids_hash = {}\n self.loopoff_file_names.each do |f|\n @file_ids_hash[File.basename(f)] = Grit::GitRuby::Internal::LooseStorage.calculate_sha(File.read(f),'blob')\n end\n # write the cache\n File.open(cache_file,'w') do |f|\n f.puts YAML.dump(@file_ids_hash) \n end\n end \n end\n @file_ids_hash\n end",
"def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << self.timestamp.strftime( '%s%N' )\n\t\tdigest << self.payload\n\t\tdigest << self.payload_hash\n\t\tdigest << self.proof.to_s\n\t\tdigest << self.previous_hash\n\t\t\n\t\treturn digest.hexdigest\n\tend",
"def hash() source.hash ^ (target.hash+1); end",
"def hash() source.hash ^ (target.hash+1); end",
"def hash\n [@id].hash\n end",
"def hash\n @id\n end",
"def hash\n 0\n end",
"def sha\n id.sha\n end",
"def hash()\n #This is a stub, used for indexing\n end",
"def get_id_checksum_hash(locale)\n #Gather all ids to retrieve from the db\n ids = Array.new\n Dir.glob(\"*/*\") do | file_name |\n if (file_name.end_with? \"deliverable_metadata.json\")\n ids.push(get_deliverable_metadata_id(locale, Settings[:CURRENT_VERSION], file_name.split(\"/\")[0])) \n elsif (file_name.end_with? \".toc\")\n ids.push(get_toc_id(locale, Settings[:CURRENT_VERSION], file_name.split(\"/\")[0]))\n elsif (file_name.end_with?(\".htm\", \".html\"))\n ids.push(get_topic_or_image_id(locale, Settings[:CURRENT_VERSION], file_name))\n end\n end\n \n #get the id,hash results \n rows = @db.view(\"content_views/checksum_by_id\", :keys => ids)['rows']\n id_checksum_hash = Hash.new(rows.size)\n \n #store it in a hash\n rows.each { |result|\n id_checksum_hash[result[\"key\"]] = result[\"value\"]\n }\n return id_checksum_hash\n end",
"def create_invite_hash!\n self.invite_hash = Digest::SHA2.new(256).update(\"#{self.serializable_hash}+#{Time.now}+jibffffrrrji!@#sh\").to_s[2..12]\n end",
"def hash\n @id\n end",
"def hash\n id\n end",
"def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"def friend_ids\n @_friend_ids ||= (@_raw_friend_hashes ? @_raw_friend_hashes.keys : raw_friend_ids).map(&:to_i)\n end",
"def hash\n Digest::SHA2.hexdigest(self.id.to_s + self.password_hash.to_s + self.email.to_s).slice(0,10)\n end",
"def hash # Hack for Ruby 1.8.6\n @node.id.hash ^ self.class.hash\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash_code; end",
"def hash_transactions\n tx_ids = transactions.map do |tx|\n tx.id\n end\n Digest::SHA256.hexdigest(tx_ids.join(''))\n end",
"def hash\n Zlib.crc32(to_a.map(&:to_s).sort.to_s)\n end",
"def hash\n size.hash ^ rank.hash\n end",
"def friends_ids\n self.friends_ids_hash.keys rescue []\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def chkall\n (1..@@pow2_N).to_a.each do |i|\n h = sha32b(\"#{i}\")\n @allhash[h] = 0 if !@allhash[h]\n @allhash[h] += 1\n end\n @allhash.size\n end",
"def follower_ids_hash\n follower_ids_hash = Hash.new()\n store = PStore.new(FOLLOWER_IDS_PATH + self.twitter_id.to_s)\n store.transaction{follower_ids_hash = store[self.twitter_id]}\n if follower_ids_hash == nil\n follower_ids_hash = Hash.new(0)\n end\n return follower_ids_hash\n end",
"def subscriber_hash(email)\n # Simple hash of the email address.\n Digest::MD5.hexdigest(email)\n end",
"def hash\n bytes.hash\n end",
"def hash_hash(h)\n require 'digest/md5'\n\n ordered = h.sort.map { |i| i.class==Hash ? i.sort : i }\n return ordered.to_s\n Digest::MD5.hexdigest(Marshal::dump(ordered))\n end",
"def hash\n h = @e.nil? ? 0 : @e\n h = (h << 1) ^ @r.hash\n h = (h << 1) ^ @v.hash\n end",
"def hash\n [self.class, id].hash\n end",
"def hexhash\n hash.to_s(16)\n end",
"def unique_ids(all_messages)\n all_id_pairs = all_messages.map { |c| [c.sender_id, c.receiver_id] }\n unique_ids = all_id_pairs.flatten\n unique_ids = unique_ids.uniq.reject! { |i| i == id }\n end",
"def hash_from_payload(payload)\n Digest::SHA256.digest(Digest::SHA256.digest( payload )).reverse.unpack(\"H*\")[0]\n end",
"def hashed_input\n\t\tmd5_hex = Digest::MD5.hexdigest(@term)\n\t\tmd5_hex.scan(/../).map { |s| s.to_i(16) }\n\tend",
"def hash\n value_id.hash\n end",
"def unique_hash\n\t\tif self.unique_token.blank?\n\t\t\tupdate_attribute(:unique_token, Devise.friendly_token[0,50].to_s)\n\t\tend\n\t\tDigest::SHA2.hexdigest(self.unique_token + id.to_s)\n\tend",
"def hash #:nodoc:\n uuid.hash\n end",
"def hash( *strs )\n return Digest::MD5.hexdigest( strs.join )\n end",
"def hash\n self.atoms.hash\n end",
"def hash=(_arg0); end",
"def hash\n [message_id, from, date, chat, forward_from, forward_from_chat, forward_from_message_id, forward_date, reply_to_message, edit_date, text, entities, caption_entities, audio, document, game, photo, sticker, video, voice, video_note, caption, contact, location, venue, new_chat_members, left_chat_member, new_chat_title, new_chat_photo, delete_chat_photo, group_chat_created, supergroup_chat_created, channel_chat_created, migrate_to_chat_id, migrate_from_chat_id, pinned_message, invoice, successful_payment, forward_signature, author_signature, connected_website].hash\n end",
"def hash #:nodoc:\n __getobj__.hash ^ self.class.hash\n end",
"def get_hash(machines)\n branch = get_branch_id\n hash = Digest::SHA1.hexdigest(machines.sort.join)\n \"#{branch}__#{hash}\"\n end",
"def hash\n [author_email, author_name, author_time, branch, commit_time, committer_email, committer_name, default_branch, message, repository_url, sha, tag].hash\n end"
] | [
"0.682959",
"0.6731084",
"0.6731084",
"0.6731084",
"0.6731084",
"0.6731084",
"0.6731084",
"0.6731084",
"0.67029834",
"0.67015386",
"0.66540813",
"0.66380715",
"0.6583516",
"0.65463895",
"0.65400827",
"0.6539493",
"0.6539493",
"0.6539493",
"0.6539493",
"0.6539493",
"0.6539493",
"0.6539493",
"0.6539493",
"0.6539493",
"0.6533851",
"0.64997125",
"0.6499295",
"0.6496979",
"0.64966136",
"0.64761585",
"0.64699787",
"0.64597505",
"0.64537776",
"0.64537776",
"0.63988847",
"0.6390393",
"0.63689476",
"0.6368255",
"0.6353023",
"0.6326143",
"0.63076645",
"0.6284703",
"0.6279029",
"0.6273436",
"0.62706447",
"0.6261921",
"0.62026983",
"0.62026983",
"0.6188674",
"0.61875653",
"0.614685",
"0.6136584",
"0.6126474",
"0.61165553",
"0.6100631",
"0.60796976",
"0.60784763",
"0.6060447",
"0.60496753",
"0.60374546",
"0.60236794",
"0.60138226",
"0.60138226",
"0.60138226",
"0.60138226",
"0.60138226",
"0.60138226",
"0.60138226",
"0.60138226",
"0.60138226",
"0.60138226",
"0.6007976",
"0.5999583",
"0.59956694",
"0.5974453",
"0.59586394",
"0.5958195",
"0.5958195",
"0.5958195",
"0.59546316",
"0.5954563",
"0.59446275",
"0.5930799",
"0.59121686",
"0.5908035",
"0.5905488",
"0.5888607",
"0.5885351",
"0.5880323",
"0.5864654",
"0.5863106",
"0.58570457",
"0.5844276",
"0.58395463",
"0.58348715",
"0.5831034",
"0.5829529",
"0.5827962",
"0.5825012",
"0.5819647"
] | 0.6138445 | 51 |
unnests all the mime stuff and returns a list of [type, filename, content] tuples. for multipart/alternative parts, will only return the subpart that matches preferred_type. if none of them, will only return the first subpart. | def decode_mime_parts part, preferred_type, level=0
if part.multipart?
if mime_type_for(part) =~ /multipart\/alternative/
target = part.body.parts.find { |p| mime_type_for(p).index(preferred_type) } || part.body.parts.first
if target # this can be nil
decode_mime_parts target, preferred_type, level + 1
else
[]
end
else # decode 'em all
part.body.parts.compact.map { |subpart| decode_mime_parts subpart, preferred_type, level + 1 }.flatten 1
end
else
type = mime_type_for part
filename = mime_filename_for part
id = mime_id_for part
content = mime_content_for part, preferred_type
[[type, filename, id, content]]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decode_mime_parts part, preferred_type, level=0\n if part.multipart?\n if mime_type_for(part) =~ /multipart\\/alternative/\n target = part.body.find { |p| mime_type_for(p).index(preferred_type) } || part.body.first\n if target # this can be nil\n decode_mime_parts target, preferred_type, level + 1\n else\n []\n end\n else # decode 'em all\n part.body.compact.map { |subpart| decode_mime_parts subpart, preferred_type, level + 1 }.flatten 1\n end\n else\n type = mime_type_for part\n filename = mime_filename_for part\n id = mime_id_for part\n content = mime_content_for part, preferred_type\n [[type, filename, id, content]]\n end\n end",
"def parse_multipart_alternative raw_body\n\n\t\t# Use the boundary to split up each part of the email\n\t\tboundary = get_boundary(@headers[\"Content-Type\"])\n\t\tbodies = raw_body.split(boundary + \"\\n\")[1..-1].map { |body|\n\n\t\t\t# Lather, rinse, repeat: get the content and bodies of each part, then parse\n\t\t\tbody_content_type = body.split(\"Content-Type: \", 2).last.split(\";\", 2).first\n\t\t\tbody = body.split(/\\n\\n/, 2).last.gsub(/#{boundary}--/, \"\")\n\t\t\tparse_body(body_content_type, body)\n\t\t}.flatten\n\tend",
"def parse_multipart_alternative raw_body\n\n # Use the boundary to split up each part of the email\n boundary = get_boundary(@headers[\"Content-Type\"])\n bodies = raw_body.split(boundary + \"\\n\")[1..-1].map { |body|\n\n # Lather, rinse, repeat: get the content and bodies of each part, then parse\n body_content_type = body.split(\"Content-Type: \", 2).last.split(\";\", 2).first\n body = body.split(/\\n\\n/, 2).last.gsub(/#{boundary}--/, \"\")\n parse_body(body_content_type, body)\n }.flatten\n end",
"def mime_content_for mime_part, preferred_type\n return \"\" unless mime_part.body # sometimes this happens. not sure why.\n\n mt = mime_type_for(mime_part) || \"text/plain\" # i guess\n content_type = if mt =~ /^(.+);/ then $1.downcase else mt end\n source_charset = if mt =~ /charset=\"?(.*?)\"?(;|$)/i then $1 else \"US-ASCII\" end\n\n content = mime_part.decode\n converted_content, converted_charset = if(converter = CONVERSIONS[[content_type, preferred_type]])\n send converter, content, source_charset\n else\n [content, source_charset]\n end\n\n if content_type =~ /^text\\//\n Decoder.transcode \"utf-8\", converted_charset, converted_content\n else\n converted_content\n end\n end",
"def mime_types\n [].tap do |result|\n @parts.each do |part|\n result << part.content_type\n end\n end\n end",
"def mime_content_for mime_part, preferred_type\n return \"\" unless mime_part.body # sometimes this happens. not sure why.\n\n content_type = mime_part.fetch_header(:content_type) || \"text/plain\"\n source_charset = mime_part.charset || \"US-ASCII\"\n\n content = mime_part.decoded\n converted_content, converted_charset = if(converter = CONVERSIONS[[content_type, preferred_type]])\n send converter, content, source_charset\n else\n [content, source_charset]\n end\n\n if content_type =~ /^text\\//\n Decoder.transcode \"utf-8\", converted_charset, converted_content\n else\n converted_content\n end\n end",
"def mime_parts(uids, mime_type)\n media_type, subtype = mime_type.upcase.split('/', 2)\n\n structures = imap.fetch uids, 'BODYSTRUCTURE'\n\n structures.zip(uids).map do |body, uid|\n section = nil\n structure = body.attr['BODYSTRUCTURE']\n\n case structure\n when Net::IMAP::BodyTypeMultipart then\n parts = structure.parts\n\n section = parts.each_with_index do |part, index|\n break index if part.media_type == media_type and\n part.subtype == subtype\n end\n\n next unless Integer === section\n when Net::IMAP::BodyTypeText, Net::IMAP::BodyTypeBasic then\n section = 'TEXT' if structure.media_type == media_type and\n structure.subtype == subtype\n end\n\n [uid, section]\n end.compact\n end",
"def parse_body content_type, body\n\t\tbody.lstrip! rescue nil\n\t\tcase content_type\n\t\twhen \"multipart/alternative\" then parse_multipart_alternative(body)\n\t\twhen \"multipart/mixed\" then [\"I'm getting to this, I swear...\"]\n\t\twhen \"text/plain\" then parse_text_plain(body)\n\t\twhen \"text/html\" then parse_text_html(body)\n\t\twhen nil then [\"[No Content]\"]\n\t\telse [content_type + \" not yet supported\"]\n\t\tend\n\tend",
"def email_parts_of_type(email, content_type = \"text/plain\")\n email.body.parts.select {|part|\n if part.respond_to?(:content_type)\n part.content_type.downcase.include? content_type\n end\n }\n end",
"def parse_body content_type, body\n body.lstrip! rescue nil\n case content_type\n when \"multipart/alternative\" then parse_multipart_alternative(body)\n when \"text/plain\" then parse_text_plain(body)\n when \"text/html\" then parse_text_html(body)\n when nil then [\"[No Content]\"]\n else [content_type + \" not yet supported\"]\n end\n end",
"def negotiate_mime(order); end",
"def additional_mime_types\n [\n MIME::Type.new( 'text/plain' ) { |t| t.extensions = %w[ rb rdoc rhtml md markdown ] },\n ]\n end",
"def part(mime_type)\n part = mail.parts.find{|p| p.mime_type == mime_type}\n part.body.to_s if part\n end",
"def get_main_body_text_part\n leaves = get_attachment_leaves\n \n # Find first part which is text/plain\n leaves.each do |p|\n if p.content_type == 'text/plain'\n return p\n end\n end\n\n # Otherwise first part which is any sort of text\n leaves.each do |p|\n if p.main_type == 'text'\n return p\n end\n end\n \n # ... or if none, consider first part \n p = leaves[0]\n # if it is a known type then don't use it, return no body (nil)\n if mimetype_to_extension(p.content_type)\n # this is guess of case where there are only attachments, no body text\n # e.g. http://www.whatdotheyknow.com/request/cost_benefit_analysis_for_real_n\n return nil\n end\n # otherwise return it assuming it is text (sometimes you get things\n # like binary/octet-stream, or the like, which are really text - XXX if\n # you find an example, put URL here - perhaps we should be always returning\n # nil in this case)\n return p\n end",
"def assign_body_parts(body)\n body.parts.each do |part|\n if part.multipart?\n assign_body_parts(part)\n else\n @body[part.header[\"content-type\"].sub_type] = part.body if \n part.header[\"content-type\"].main_type == \"text\"\n end #if\n end #do\n end",
"def negotiate_mime(order)\n formats.each do |priority|\n if priority == Mime::ALL\n return order.first\n elsif order.include?(priority)\n return priority\n end\n end\n\n order.include?(Mime::ALL) ? formats.first : nil\n end",
"def mime\n mimes = []\n self.class.ancestors.each do |parent|\n if parent.const_defined? 'MIMES'\n parent.const_get('MIMES').each do |mime|\n unless mimes.include? mime\n mimes << mime\n end\n end\n end\n end\n mimes\n end",
"def _extract_mime_type_with_mime_types(io)\n if filename = extract_filename(io)\n mime_type = MIME::Types.of(filename).first\n mime_type.to_s if mime_type\n end\n end",
"def negotiate_mime(order)\n formats.each do |priority|\n if priority == Mime::ALL\n return order.first\n elsif order.include?(priority)\n return priority\n end\n end\n\n order.include?(Mime::ALL) ? format : nil\n end",
"def get_attachments_for_display\n ensure_parts_counted\n\n main_part = get_main_body_text_part\n leaves = get_attachment_leaves\n attachments = []\n for leaf in leaves\n if leaf != main_part\n attachment = FOIAttachment.new\n\n attachment.body = leaf.body\n # As leaf.body causes MIME decoding which uses lots of RAM, do garbage collection here\n # to prevent excess memory use. XXX not really sure if this helps reduce\n # peak RAM use overall. Anyway, maybe there is something better to do than this.\n GC.start \n\n attachment.filename = _get_censored_part_file_name(leaf)\n if leaf.within_rfc822_attachment\n attachment.within_rfc822_subject = leaf.within_rfc822_attachment.subject\n\n # Test to see if we are in the first part of the attached\n # RFC822 message and it is text, if so add headers.\n # XXX should probably use hunting algorithm to find main text part, rather than\n # just expect it to be first. This will do for now though.\n # Example request that needs this:\n # http://www.whatdotheyknow.com/request/2923/response/7013/attach/2/Cycle%20Path%20Bank.txt\n if leaf.within_rfc822_attachment == leaf && leaf.content_type == 'text/plain'\n headers = \"\"\n for header in [ 'Date', 'Subject', 'From', 'To', 'Cc' ]\n if leaf.within_rfc822_attachment.header.include?(header.downcase)\n headers = headers + header + \": \" + leaf.within_rfc822_attachment.header[header.downcase].to_s + \"\\n\"\n end\n end\n # XXX call _convert_part_body_to_text here, but need to get charset somehow\n # e.g. http://www.whatdotheyknow.com/request/1593/response/3088/attach/4/Freedom%20of%20Information%20request%20-%20car%20oval%20sticker:%20Article%2020,%20Convention%20on%20Road%20Traffic%201949.txt\n attachment.body = headers + \"\\n\" + attachment.body\n\n # This is quick way of getting all headers, but instead we only add some a) to\n # make it more usable, b) as at least one authority accidentally leaked security\n # information into a header.\n #attachment.body = leaf.within_rfc822_attachment.port.to_s\n end\n end\n attachment.content_type = leaf.content_type\n attachment.url_part_number = leaf.url_part_number\n attachments += [attachment]\n end\n end\n\n uudecode_attachments = get_main_body_text_uudecode_attachments\n c = @count_first_uudecode_count\n for uudecode_attachment in uudecode_attachments\n c += 1\n uudecode_attachment.url_part_number = c\n attachments += [uudecode_attachment]\n end\n\n return attachments\n end",
"def to_h message_id, preferred_type\n parts = mime_parts(preferred_type).map do |type, fn, cid, content, size|\n if type =~ /^text\\//\n { :type => type, :filename => fn, :cid => cid, :content => content, :here => true }\n else\n { :type => type, :filename => fn, :cid => cid, :size => content.size, :here => false }\n end\n end.compact\n\n { :from => (from ? from.to_email_address : \"\"),\n :to => to.map(&:to_email_address),\n :cc => (cc || []).map(&:to_email_address),\n :bcc => (bcc || []).map(&:to_email_address),\n :subject => subject,\n :date => date,\n :refs => refs,\n :parts => parts,\n :message_id => message_id,\n :snippet => snippet,\n :reply_to => (reply_to ? reply_to.to_email_address : \"\"),\n\n :recipient_email => recipient_email,\n :list_post => list_post,\n :list_subscribe => list_subscribe,\n :list_unsubscribe => list_unsubscribe,\n\n :email_message_id => @msgid,\n }\n end",
"def mime_types\n {image: ['image/png', 'image/jpeg', 'image/jpg', 'image/jp2', 'image/bmp', 'image/gif', 'image/tiff'],\n pdf: ['application/pdf', 'application/x-pdf'],\n audio: ['audio/mpeg', 'audio/mp4', 'audio/x-aiff', 'audio/ogg', 'audio/vorbis', 'audio/vnd.wav'],\n video: ['video/mp4', 'video/quicktime', 'video/x-msvideo', 'video/x-ms-wmv']}\n end",
"def get_mime_type_from_ext(extension)\n extension[0]=''\n types = [\n { :ext => \"txt\", :mime_type => \"text/plain\" },\n { :ext => \"ini\", :mime_type => \"text/plain\" },\n { :ext => \"sln\", :mime_type => \"text/plain\" },\n { :ext => \"cs\", :mime_type => \"text/plain\" },\n { :ext => \"js\", :mime_type => \"text/plain\" },\n { :ext => \"config\", :mime_type => \"text/plain\" },\n { :ext => \"vb\", :mime_type => \"text/plain\" },\n { :ext => :\"jpg\", :mime_type => \"image/jpeg\" },\n { :ext => \"jpeg\", :mime_type => \"image/jpeg\" },\n { :ext => \"bmp\", :mime_type => \"image/bmp\" },\n { :ext => \"csv\", :mime_type => \"text/csv\" },\n { :ext => \"doc\", :mime_type => \"application/msword\" },\n { :ext => \"docx\", :mime_type => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" },\n { :ext => \"gif\", :mime_type => \"image/gif\" },\n { :ext => \"html\", :mime_type => \"text/html\" },\n { :ext => \"pdf\", :mime_type => \"application/pdf\" },\n { :ext => \"png\", :mime_type => \"image/png\" },\n { :ext => \"ppt\", :mime_type => \"application/vnd.ms-powerpoint\" },\n { :ext => \"pptx\", :mime_type => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" },\n { :ext => \"xls\", :mime_type => \"application/vnd.ms-excel\" },\n { :ext => \"xlsx\", :mime_type => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" },\n { :ext => \"xml\", :mime_type => \"application/xml\" },\n { :ext => \"zip\", :mime_type => \"application/x-zip-compressed\" },\n { :ext => \"wav\", :mime_type => \"audio/wav\" },\n { :ext => \"eml\", :mime_type => \"message/rfc822\" },\n { :ext => \"mp3\", :mime_type => \"audio/mpeg\" },\n { :ext => \"mp4\", :mime_type => \"video/mp4\" },\n { :ext => \"mov\", :mime_type => \"video/quicktime\" }\n ]\n mime = types.find {|x| x[:ext] == extension}\n\n unless mime.nil? || mime.empty?\n \"application/octet-stream\"\n end\n mime[:mime_type]\n end",
"def selected_mime_types\n return [] if mime_types.blank?\n\n mime_types.split(',')\n end",
"def content_type\n return @content_type unless @content_type.blank?\n if has_attachments?\n return \"multipart/mixed\"\n elsif !body(:plain).blank? && !body(:html).blank?\n return \"multipart/alternative\"\n elsif body(:html)\n return \"text/html\"\n else\n return \"text/plain\"\n end\n end",
"def mime_types(type)\n mime_types = {\n yaml: \"application/x-yaml\",\n json: \"application/json\"\n }\n mime_types[type.to_sym]\n end",
"def find_mail_part(mail, types)\n types.each do |type|\n part = mail.parts.find { |p| p.content_type.start_with? type }\n return part unless part.nil?\n end\n # No part found.\n nil\n end",
"def mime_types\n safe_const_get(:MIME_TYPES) || []\n end",
"def mime_subtype\n mime_type.split(/\\//)[1]\n end",
"def content_types_provided\n [ [ FILE_EXTENSION_CONTENT_TYPES[file_extension], :file_contents ] ]\n end",
"def pretty_content_type(work)\n if work.source_from == 'google_drive'\n return image_tag('Google-Drive-Icon.png', height: '10')\n else\n # this will now almost surely get bypassed in favor of picture above\n if !work.document.file # there is not associated file, thus no file_name to split\n # most likely (for now) a google drive doc\n a = work.content_type.split('/').last # ie 'text/html'\n return a.split('.').last if a.include? '.'\n a\n # or it will be a normal local upload, in which case we'll handle with splitting original file name\n else\n\n if !work.file_name.nil? \n if work.file_name.include? '.' and work.file_name.split('.').size > 1 # ie essay.docx\n return work.file_name.split('.').last \n end\n end\n\n if !work.content_type.nil?\n if work.content_type.include? '/'\n a = work.content_type.split('/').last\n end \n if !a.nil? && a.present? && a.length > 1\n return a.split('.').last if a.include? '.'\n end\n end\n \n return 'unknown'\n end\n end\n end",
"def content_type\n @content_type ||= begin\n if attachment?\n \"multipart/mixed; boundary = #{boundary}\"\n else\n \"text/html\"\n end\n end\nend",
"def mime_types(*types)\n types.flatten.each do |t|\n @mime_types << t\n end\n @mime_types\n end",
"def _mime_type\n if defined? @_mime_type\n @_mime_type\n else\n guesses = ::MIME::Types.type_for(extname.to_s)\n\n # Prefer text mime types over binary\n @_mime_type = guesses.detect { |type| type.ascii? } || guesses.first\n end\n end",
"def mime_part\n message.mime_part\n end",
"def scan_parts(message)\n message.parts.each do |part|\n if part.multipart?\n scan_parts(part)\n else\n case part.content_type\n when /text\\/plain/\n @body << part.body.to_s\n when /text\\/html/\n @html << part.body.to_s\n else\n att = Attachment.new(part)\n @attachments << att if att.attached?\n end\n end\n end\n end",
"def condense(message)\n if message.multipart? && message.parts.any?(&:multipart?)\n # Get the message parts as a flat array.\n result = flatten(Mail.new, message.parts.dup)\n\n # Rebuild the message's parts.\n message.parts.clear\n\n # Merge non-attachments with the same content type.\n (result.parts - result.attachments).group_by(&:content_type).each do |content_type,group|\n body = group.map{|part| part.body.decoded}.join\n\n # Make content types match across all APIs.\n if content_type == 'text/plain; charset=us-ascii'\n # `text/plain; charset=us-ascii` is the default content type.\n content_type = 'text/plain'\n elsif content_type == 'text/html; charset=us-ascii'\n content_type = 'text/html; charset=UTF-8'\n body = body.encode('UTF-8') if body.respond_to?(:encode)\n end\n\n message.parts << Mail::Part.new({\n :content_type => content_type,\n :body => body,\n })\n end\n\n # Add attachments last.\n result.attachments.each do |part|\n message.parts << part\n end\n end\n\n message\n end",
"def app_accept_alternate_multipart_related\n sword_accepts.find{|a| a.alternate == \"multipart-related\" }\n end",
"def determine_file_extension_with_mime_type(mimetype, given_extension)\n # return if either argument is nil\n return '' if mimetype.nil?\n\n # strip off the leading . in the given extension\n if given_extension && given_extension.match(/^\\./)\n given_extension = given_extension[1..-1]\n end\n\n # look through the known mimetypes to see if we handle this mimetype\n # note: have to check 1 dir higher because of a Dir.chdir that happens\n # before this is called\n File.open(\"../mime.types\", \"r\") do |f|\n while (line = f.gets)\n line.chomp!\n # ignore any commented lines and check for the mimetype in the line\n if line[0] != \"#\" && line.include?(mimetype) then\n # use to_s since that will always give us a sensible String and not nil\n # nil.to_s == ''\n if given_extension && !given_extension.empty? && line.include?(given_extension) then\n return \".#{given_extension}\"\n else\n return \".#{line.split(' ')[1]}\"\n end\n end\n end\n end\n ''\nend",
"def inferred_mime_type\n format_extension = path.format&.to_s\n MIME::Types.type_for(format_extension).first if format_extension\n end",
"def mime_types\n @mime_types ||=\n request_files.transform_values do |file|\n file.hasMimeType || 'application/octet-stream'\n end\n end",
"def parse(type = nil)\n MimeType[type || mime_type].decode to_s\n end",
"def wp_get_mime_types\n # Filters the list of mime types and file extensions.\n apply_filters(\n 'mime_types',\n {\n # Image formats.\n 'jpg|jpeg|jpe': 'image/jpeg',\n 'gif': 'image/gif',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'tiff|tif': 'image/tiff',\n 'ico': 'image/x-icon',\n # Video formats.\n 'asf|asx': 'video/x-ms-asf',\n 'wmv': 'video/x-ms-wmv',\n 'wmx': 'video/x-ms-wmx',\n 'wm': 'video/x-ms-wm',\n 'avi': 'video/avi',\n 'divx': 'video/divx',\n 'flv': 'video/x-flv',\n 'mov|qt': 'video/quicktime',\n 'mpeg|mpg|mpe': 'video/mpeg',\n 'mp4|m4v': 'video/mp4',\n 'ogv': 'video/ogg',\n 'webm': 'video/webm',\n 'mkv': 'video/x-matroska',\n '3gp|3gpp': 'video/3gpp', # Can also be audio\n '3g2|3gp2': 'video/3gpp2', # Can also be audio\n # Text formats.\n 'txt|asc|c|cc|h|srt': 'text/plain',\n 'csv': 'text/csv',\n 'tsv': 'text/tab-separated-values',\n 'ics': 'text/calendar',\n 'rtx': 'text/richtext',\n 'css': 'text/css',\n 'htm|html': 'text/html',\n 'vtt': 'text/vtt',\n 'dfxp': 'application/ttaf+xml',\n # Audio formats.\n 'mp3|m4a|m4b': 'audio/mpeg',\n 'aac': 'audio/aac',\n 'ra|ram': 'audio/x-realaudio',\n 'wav': 'audio/wav',\n 'ogg|oga': 'audio/ogg',\n 'flac': 'audio/flac',\n 'mid|midi': 'audio/midi',\n 'wma': 'audio/x-ms-wma',\n 'wax': 'audio/x-ms-wax',\n 'mka': 'audio/x-matroska',\n # Misc application formats.\n 'rtf': 'application/rtf',\n 'js': 'application/javascript',\n 'pdf': 'application/pdf',\n 'swf': 'application/x-shockwave-flash',\n 'class': 'application/java',\n 'tar': 'application/x-tar',\n 'zip': 'application/zip',\n 'gz|gzip': 'application/x-gzip',\n 'rar': 'application/rar',\n '7z': 'application/x-7z-compressed',\n 'exe': 'application/x-msdownload',\n 'psd': 'application/octet-stream',\n 'xcf': 'application/octet-stream',\n # MS Office formats.\n 'doc': 'application/msword',\n 'pot|pps|ppt': 'application/vnd.ms-powerpoint',\n 'wri': 'application/vnd.ms-write',\n 'xla|xls|xlt|xlw': 'application/vnd.ms-excel',\n 'mdb': 'application/vnd.ms-access',\n 'mpp': 'application/vnd.ms-project',\n 'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'docm': 'application/vnd.ms-word.document.macroEnabled.12',\n 'dotx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'dotm': 'application/vnd.ms-word.template.macroEnabled.12',\n 'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xlsm': 'application/vnd.ms-excel.sheet.macroEnabled.12',\n 'xlsb': 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n 'xltx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'xltm': 'application/vnd.ms-excel.template.macroEnabled.12',\n 'xlam': 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'pptm': 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',\n 'ppsx': 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'ppsm': 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',\n 'potx': 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'potm': 'application/vnd.ms-powerpoint.template.macroEnabled.12',\n 'ppam': 'application/vnd.ms-powerpoint.addin.macroEnabled.12',\n 'sldx': 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'sldm': 'application/vnd.ms-powerpoint.slide.macroEnabled.12',\n 'onetoc|onetoc2|onetmp|onepkg': 'application/onenote',\n 'oxps': 'application/oxps',\n 'xps': 'application/vnd.ms-xpsdocument',\n # OpenOffice formats.\n 'odt': 'application/vnd.oasis.opendocument.text',\n 'odp': 'application/vnd.oasis.opendocument.presentation',\n 'ods': 'application/vnd.oasis.opendocument.spreadsheet',\n 'odg': 'application/vnd.oasis.opendocument.graphics',\n 'odc': 'application/vnd.oasis.opendocument.chart',\n 'odb': 'application/vnd.oasis.opendocument.database',\n 'odf': 'application/vnd.oasis.opendocument.formula',\n # WordPerfect formats.\n 'wp|wpd': 'application/wordperfect',\n # iWork formats.\n 'key': 'application/vnd.apple.keynote',\n 'numbers': 'application/vnd.apple.numbers',\n 'pages': 'application/vnd.apple.pages',\n }\n )\n end",
"def process_message_body\n @attachments = []\n if @mail.multipart?\n @body, @html = [], []\n scan_parts(@mail)\n @body = @body.join(\"\\n\")\n @html = @html.join(\"\\n\")\n else\n if @mail.content_type =~ /text\\/html/\n @html = @mail.body.to_s\n @body = ''\n else\n @body = @mail.body.to_s\n @html = ''\n end\n end\n\n @body = convert_to_utf8(@body)\n @html = convert_to_utf8(@html)\n end",
"def mime_type_of(f)\n MIME::Types.of(f).last || default_mime_type\n end",
"def filename_and_content_to_mimetype(filename, content)\n # Try filename\n ret = filename_to_mimetype(filename)\n if !ret.nil?\n return ret\n end\n\n # Otherwise look inside the file to work out the type.\n # Mahoro is a Ruby binding for libmagic.\n m = Mahoro.new(Mahoro::MIME)\n mahoro_type = m.buffer(content)\n mahoro_type.strip!\n #STDERR.puts(\"mahoro\", mahoro_type, \"xxxok\")\n # XXX we shouldn't have to check empty? here, but Mahoro sometimes returns a blank line :(\n # e.g. for InfoRequestEvent 17930\n if mahoro_type.nil? || mahoro_type.empty?\n return nil\n end\n # text/plain types sometimes come with a charset\n mahoro_type.match(/^(.*);/)\n if $1\n mahoro_type = $1\n end\n # see if looks like a content type, or has something in it that does\n # and return that\n # mahoro returns junk \"\\012- application/msword\" as mime type.\n mahoro_type.match(/([a-z0-9.-]+\\/[a-z0-9.-]+)/)\n if $1\n return $1\n end\n # otherwise we got junk back from mahoro\n return nil\nend",
"def qualify_mime_type(thing, types)\n weigh_mime_type(thing, types).first\n end",
"def mime_type(media_type = nil)\n types = MIME::Types.type_for(path)\n return if types.empty?\n if media_type\n media_type = media_type.to_s\n media_types = types.select { |m| m.media_type == media_type }\n if media_types.length > 1\n sub_types = media_types.select { |m| m.sub_type == format }\n media_types = sub_types if sub_types.any?\n end\n types = media_types if media_types.any?\n end\n types.first.content_type if types.any?\n end",
"def attachment_content_type_for(joint)\n case File.extname(joint).downcase\n when '.txt' then 'text/plain'\n when '.html' then 'plain/html'\n when '.pdf' then 'application/octet-stream' #'application/x-pdf'\n when '.jpg', '.jpeg' then 'image/jpeg'\n when '.png' then 'image/png'\n when '.gif' then 'image/gif'\n when '.doc', '.docx' then 'application/msword'\n else \n 'plain/text' # par défaut\n end\nend",
"def wp_check_filetype(filename, mimes = nil)\n mimes = get_allowed_mime_types if mimes.blank?\n result = {\n ext: false,\n type: false\n }\n mimes.each_pair do |ext_preg, mime_match|\n ext_preg = '!\\.(' + ext_preg + ')$!i'\n ext_matches = ext_preg.match filename # (preg_match(ext_preg, filename, ext_matches))\n if ext_matches\n result[:type] = mime_match\n result[:ext] = ext_matches[1]\n break\n end\n end\n result\n end",
"def text_html_part(part = tmail)\n case part.content_type\n when 'text/html'\n part\n when 'multipart/alternative'\n part.parts.detect {|part| text_html_part(part)}\n end\n end",
"def extract_content_type\n if image_content_type == \"application/octet-stream\" && !image_file_name.blank?\n content_types = MIME::Types.type_for(image_file_name)\n self.image_content_type = content_types.first.to_s unless content_types.empty?\n end\n end",
"def content_type\n ::MIME::Types.type_for(name).first.try(:content_type) || 'text/html'\n end",
"def accepted_mimes\n case self.type\n when'Recording'\n '.wav,.mp3'\n when 'Document'\n '.pdf'\n when 'Image'\n '.jpeg,.jpg,.gif,.bmp,.png'\n else\n ''\n end\n end",
"def accepted_content_types\n return @content_types if @content_types\n @content_types = []\n if val = @ext_params[\"content_return_types\"]\n @content_types = val.split(',').map {|i| i.to_sym}\n end\n\n @content_types\n end",
"def mimetype\n MIME::Types.type_for(parent_image.path).first.content_type\n end",
"def extract_content_type\n if data_content_type == \"application/octet-stream\" && !data_file_name.blank?\n content_types = MIME::Types.type_for(data_file_name)\n self.data_content_type = content_types.first.to_s unless content_types.empty?\n end\n end",
"def mime_type(*args, **_arg1, &block); end",
"def render_multipart(method_name, body)\n if Setting.plain_text_mail?\n content_type \"text/plain\"\n body render(:file => \"#{method_name}.text.plain.rhtml\", :body => body, :layout => 'mailer.text.erb')\n else\n content_type \"multipart/alternative\"\n part :content_type => \"text/plain\", :body => render(:file => \"#{method_name}.text.plain.rhtml\", :body => body, :layout => 'mailer.text.erb')\n part :content_type => \"text/html\", :body => render_message(\"#{method_name}.text.html.rhtml\", body)\n end\n end",
"def attachments\n @attachments ||= begin\n return message.attachments unless message.attachments.empty?\n if full_text_part.nil? && full_html_part.nil?\n [ message ]\n else\n []\n end\n end\n end",
"def parts(type)\n xml.xpath(\"//xmlns:Override[@ContentType='#{type}']\").map{ |n| n['PartName'] }\n end",
"def extract_email(content, use_first_attachment = false)\n mail = TMail::Mail.parse content\n \n # dig deeper into this email if asked to\n if use_first_attachment \n attachment = mail.parts.select{ |p| p.content_disposition == \"attachment\" || p.content_type == \"message/rfc822\" }.first\n \n # complain if the email has no attachment to extract\n unless attachment\n log.warn \"Parameter 'use_first_attachment' is true but there are no attachments on this mail: \\n#{content}\"\n return nil\n end\n mail = extract_email(attachment.body, false)\n end\n \n mail\n rescue TMail::SyntaxError\n log.warn \"TMail couldn't parse an email, so it will be ignored. Mail content: \\n#{content}\"\n return nil\n end",
"def mime_type\n type = MIME::Types.type_for(self.filename)\n type.empty? ? nil : type.first\n end",
"def mime_types_with_document_examples\n links = \"\"\n accepted_mime_types = Decidim::Opinions::DocToMarkdown::ACCEPTED_MIME_TYPES.keys\n accepted_mime_types.each_with_index do |mime_type, index|\n links += link_to t(\".accepted_mime_types.#{mime_type}\"),\n asset_path(\"decidim/opinions/participatory_texts/participatory_text.#{mime_type}\"),\n download: \"participatory_text.#{mime_type}\"\n links += \", \" unless accepted_mime_types.length == index + 1\n end\n links\n end",
"def files_content(record, identifier, path, frag_content)\n # preparing attachments\n files = frag_content.split(\"\\n\").collect do |filename|\n file_handler = File.open(File.join(path, filename))\n {\n io: file_handler,\n filename: filename,\n content_type: MimeMagic.by_magic(file_handler)\n }\n end\n\n # ensuring that old attachments get removed\n ids_destroy = []\n if (frag = record.fragments.find_by(identifier: identifier))\n ids_destroy = frag.attachments.pluck(:id)\n end\n\n [files, ids_destroy]\n end",
"def mimetype\n return @mimetype if defined? @mimetype\n\n type = metadata['Content-Type'].is_a?(Array) ? metadata['Content-Type'].first : metadata['Content-Type']\n\n @mimetype = MIME::Types[type].first\n end",
"def mime(path)\n MIME::Types.type_for(expand path).first\n end",
"def mime_filename_for part\n cd = part.header[\"Content-Disposition\"]\n ct = part.header[\"Content-Type\"]\n\n ## RFC 2183 (Content-Disposition) specifies that disposition-parms are\n ## separated by \";\". So, we match everything up to \" and ; (if present).\n filename = if ct && ct =~ /name=\"?(.*?[^\\\\])(\"|;|\\z)/im # find in content-type\n $1\n elsif cd && cd =~ /filename=\"?(.*?[^\\\\])(\"|;|\\z)/m # find in content-disposition\n $1\n end\n\n ## filename could be RFC2047 encoded\n decode_header(filename).chomp if filename\n end",
"def mime_exts\n config[:mime_exts]\n end",
"def each\n\t parts = body_parts.map { |p| \n\t\tp.multipart? ? p.body_parts : p }\n\t parts.flatten.compact.each { |p| yield(p) }\n\tend",
"def extract_mime_type(io)\n if io.respond_to?(:mime_type)\n io.mime_type\n elsif io.respond_to?(:content_type)\n io.content_type\n end\n end",
"def available_content_types\n if self.api_file.download_url\n return [self.api_file.mime_type]\n else\n return []\n end\n end",
"def content_type\n if format == :auto\n MIME_TYPES.values.join(',')\n elsif MIME_TYPES.has_key? format\n MIME_TYPES[format]\n else\n raise ArgumentError, \"Unknown format '#{format}'\"\n end\n end",
"def content_type\n if format == :auto\n MIME_TYPES.values.join(',')\n elsif MIME_TYPES.has_key? format\n MIME_TYPES[format]\n else\n raise ArgumentError, \"Unknown format '#{format}'\"\n end\n end",
"def parse_multipart(boundary, body)\n reader = MultipartParser::Reader.new(boundary)\n result = { errors: [], parts: [] }\n def result.part(name)\n hash = self[:parts].detect { |h| h[:part].name == name }\n [hash[:part], hash[:body].join]\n end\n\n reader.on_part do |part|\n result[:parts] << thispart = {\n part: part,\n body: []\n }\n part.on_data do |chunk|\n thispart[:body] << chunk\n end\n end\n reader.on_error do |msg|\n result[:errors] << msg\n end\n reader.write(body)\n result\n end",
"def mime_type\n term = format_controlled_vocabulary.all.find { |x| x.definition == info_service.driver }\n term ? term.value : primary_file.mime_type\n end",
"def mime_find(mime)\n MIME_MAP[mime] || {:name => \"Unknown file type\", :icon_key => \"misc_file\"}\n end",
"def mime_filename_for part\n cd = part.fetch_header(:content_disposition)\n ct = part.fetch_header(:content_type)\n\n ## RFC 2183 (Content-Disposition) specifies that disposition-parms are\n ## separated by \";\". So, we match everything up to \" and ; (if present).\n filename = if ct && ct =~ /name=\"?(.*?[^\\\\])(\"|;|\\z)/im # find in content-type\n $1\n elsif cd && cd =~ /filename=\"?(.*?[^\\\\])(\"|;|\\z)/m # find in content-disposition\n $1\n end\n\n ## filename could be RFC2047 encoded\n filename.chomp if filename\n end",
"def mime_type\n MIME_TYPES[@file_type]\n end",
"def mimetype\n return attributes['mimetype'] if attributes['mimetype']\n return \"image/png\" if content =~ /^.PNG/\n return \"application/octet-stream\"\n end",
"def read_multipart(boundary, content_length)\n ## read first boundary\n stdin = stdinput\n first_line = \"--#{boundary}#{EOL}\"\n content_length -= first_line.bytesize\n status = stdin.read(first_line.bytesize)\n raise EOFError.new(\"no content body\") unless status\n raise EOFError.new(\"bad content body\") unless first_line == status\n\n ## parse and set params\n params = {}\n @files = {}\n boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/\n boundary_size = \"#{EOL}--#{boundary}#{EOL}\".bytesize\n boundary_end = nil\n buf = ''\n bufsize = 10 * 1024\n max_count = MAX_MULTIPART_COUNT\n n = 0\n tempfiles = []\n\n while true\n #(n += 1) < max_count or raise StandardError.new(\"too many parameters.\")\n\n ## create body (StringIO or Tempfile)\n body = create_body()\n #tempfiles << body if defined?(Tempfile) && body.kind_of?(Tempfile)\n tempfiles << body\n class << body\n if method_defined?(:path)\n alias local_path path\n else\n def local_path\n nil\n end\n end\n attr_reader :original_filename, :content_type\n end\n ## find head and boundary\n head = nil\n separator = EOL * 2\n until head && matched = boundary_rexp.match(buf)\n if !head && pos = buf.index(separator)\n len = pos + EOL.bytesize\n head = buf[0, len]\n buf = buf[(pos+separator.bytesize)..-1]\n else\n if head && buf.size > boundary_size\n len = buf.size - boundary_size\n body.print(buf[0, len])\n buf[0, len] = ''\n end\n c = stdin.read(bufsize < content_length ? bufsize : content_length)\n raise EOFError.new(\"bad content body\") if c.nil? || c.empty?\n buf << c\n content_length -= c.bytesize\n end\n end\n ## read to end of boundary\n m = matched\n len = m.begin(0)\n s = buf[0, len]\n if s =~ /(\\r?\\n)\\z/\n s = buf[0, len - $1.bytesize]\n end\n body.print(s)\n buf = buf[m.end(0)..-1]\n boundary_end = m[1]\n content_length = -1 if boundary_end == '--'\n ## reset file cursor position\n #body.rewind\n body.seek(0, IO::SEEK_SET)\n \n ## original filename\n /Content-Disposition:.* filename=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n filename = $1 || $2 || ''\n filename = SimpleCGI.unescape(filename)# if unescape_filename?()\n body.instance_variable_set('@original_filename', filename)\n ## content type\n /Content-Type: (.*)/i.match(head)\n (content_type = $1 || '').chomp!\n body.instance_variable_set('@content_type', content_type)\n ## query parameter name\n /Content-Disposition:.* name=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n name = $1 || $2 || ''\n if body.original_filename == \"\"\n #value=body.read.dup.force_encoding(@accept_charset)\n value=body.read.dup\n (params[name] ||= []) << value\n unless value.valid_encoding?\n if @accept_charset_error_block\n @accept_charset_error_block.call(name,value)\n else\n raise InvalidEncoding,\"Accept-Charset encoding error\"\n end\n end\n class << params[name].last;self;end.class_eval do\n define_method(:read){self}\n define_method(:original_filename){\"\"}\n define_method(:content_type){\"\"}\n end\n else\n (params[name] ||= []) << body\n @files[name]=body\n end\n ## break loop\n break if content_length == -1\n end\n\n #... raise EOFError, \"bad boundary end of body part\" unless boundary_end =~ /--/\n params.default = []\n params\n rescue => e\n p e.class\n p e.message\n p e.backtrace\n #if tempfiles\n # tempfiles.each {|t|\n # if t.path\n # t.unlink\n # end\n # }\n #end\n #raise\n end",
"def _extract_mime_type_with_mimemagic(io)\n MimeMagic.by_magic(io).type\n end",
"def getParts (boundary, body)\n parts = [ ]\n valid = false\n\n while 1\n position = body.index(\"--\" + boundary)\n\n break if position != 0 or position == nil\n\n follow = body.slice(position + boundary.length + 2, 2)\n\n break if follow != \"\\r\\n\" and follow != \"--\"\n\n if follow == \"--\"\n valid = true\n break\n end if\n\n # strip boundary start from body\n body = body.slice(position + boundary.length + 4, body.length)\n \n # look for boundary end\n final = body.index(\"--\" + boundary)\n\n break if final == nil\n\n # extract the part\n partTotal = body.slice(0, final)\n\n # look for envelope bounds\n position = partTotal.index(\"\\r\\n\\r\\n\");\n break if position == nil\n\n\n r = Regexp.new('content-id: ([^\\s]+)', Regexp::IGNORECASE)\n \n if r.match(partTotal.slice(0, position))\n contentId = Regexp.last_match(1)\n else\n contentId = \"\"\n end\n\n\n # strip envelope\n partTotal = partTotal.slice(position + 4, partTotal.length)\n\n # look for actual header & body\n partHeader, partBody = \"\", \"\"\n position = partTotal.index(\"\\r\\n\\r\\n\");\n\n break if position == nil\n \n partHeader = partTotal.slice(0, position)\n partBody = partTotal.slice(position + 4, partTotal.length)\n\n partHeaders = { }\n status = 500\n lineNumber = 0\n\n # parse headers and status code\n\n partHeader.each_line(\"\\r\\n\") do |line|\n if lineNumber == 0\n position = line.index(\"HTTP/1.1 \")\n break if position == nil\n status = line.slice(9, 3).to_i\n else\n key, void, value = line.partition(\":\")\n partHeaders[key.strip] = value.strip\n end\n lineNumber = lineNumber + 1\n end\n\n part = { :headers => partHeaders, :body => partBody, :status => status, :contentId => contentId }\n parts.push(part)\n\n body = body.slice(final, body.length)\n end\n\n if not valid\n raise \"invalid multipart response received\"\n end\n\n parts\n end",
"def parents\r\n file = ''\r\n MIME.mime_dirs.each { |dir|\r\n file = \"#{dir}/#{content_type}.xml\"\r\n break if File.file? file\r\n }\r\n\r\n open(file) { |f|\r\n doc = REXML::Document.new f\r\n REXML::XPath.match(doc, '*/sub-class-of').collect { |c|\r\n MIME[c.attributes['type']]\r\n }\r\n }\r\n end",
"def multipart_content_type(env)\n requested_content_type = env['CONTENT_TYPE']\n if requested_content_type.start_with?('multipart/')\n requested_content_type\n else\n 'multipart/form-data'\n end\n end",
"def mime_type(file)\n type = nil\n\n if (file =~ /\\.(.+?)$/)\n type = ExtensionMimeTypes[$1.downcase]\n end\n\n type || \"text/plain\"\n end",
"def mime_type\n @mime_type ||= message.mime_type\n end",
"def read(data:, options: nil, callback: nil)\n parsed_data = parse(eml: data, options: options, callback: callback)\n\n begin\n result = {}\n result[:date] = new Date(parsed_data.dig(:headers)) if parsed_data.dig(:headers, 'Date')\n # byebug\n result[:subject] = unquote_string(parsed_data.dig(:headers, \"Subject\")) if parsed_data.dig(:headers, \"Subject\")\n\n %w[From To CC cc].each do |item|\n result[item] = get_email_address(parsed_data.dig(:headers, item))\n end\n\n result[:headers] = parsed_data.dig(:headers)\n\n boundary = nil\n ct = parsed_data.dig(:headers, 'Content-Type')\n # byebug\n if ct && ct.match(/^multipart\\//)\n b = get_boundary(ct)\n if b && b.length\n boundary = b\n end\n end\n\n if boundary\n for body_data in data.dig(:body)\n if body_data.dig(:part).instance_of? (String)\n result[:data] = body_data[:part]\n else\n if body_data.dig(:part, :body).instance_of? (String)\n headers = body_data.dig(:part, :headers)\n content = body_data.dig(:part, :body)\n append_boundary(headers, content)\n else\n for item in body_data.dig(:part, :body) do\n if item.instance_of?(String)\n result[:data] = body_data.dig(:part, :body)[item]\n next\n end\n\n headers = body_data.dig(:part, :body, item, :part, :headers)\n content = body_data.dig(:part, :body, item, :part, :body)\n\n append_boundary(headers, content)\n end\n end\n end\n end\n elsif data.dig(:body).instance_of?(String)\n append_boundary(data.dig(:headers), data.dig(body))\n end\n callback.call(result)\n rescue StandardError => e\n puts e\n end\n end",
"def get_main_body_text_uudecode_attachments\n text = get_main_body_text_internal\n\n # Find any uudecoded things buried in it, yeuchly\n uus = text.scan(/^begin.+^`\\n^end\\n/sm)\n attachments = []\n for uu in uus\n # Decode the string\n content = nil\n tempfile = Tempfile.new('foiuu')\n tempfile.print uu\n tempfile.flush\n IO.popen(\"/usr/bin/uudecode \" + tempfile.path + \" -o -\", \"r\") do |child|\n content = child.read()\n end\n tempfile.close\n # Make attachment type from it, working out filename and mime type\n attachment = FOIAttachment.new()\n attachment.body = content\n attachment.filename = uu.match(/^begin\\s+[0-9]+\\s+(.*)$/)[1]\n self.info_request.apply_censor_rules_to_text!(attachment.filename)\n calc_mime = filename_and_content_to_mimetype(attachment.filename, attachment.body)\n if calc_mime\n calc_mime = normalise_content_type(calc_mime)\n attachment.content_type = calc_mime\n else\n attachment.content_type = 'application/octet-stream'\n end\n attachments += [attachment]\n end\n \n return attachments\n end",
"def parse_extented_reply_packet(packet)\n packet.read_string do |extension|\n data = packet.remainder_as_buffer\n parsed_packet = case extension\n when \"md5-hash\" then parse_md5_packet(data)\n when \"check-file\" then parse_hash_packet(data)\n when \"home-directory\" then parse_home_packet(data)\n else raise NotImplementedError, \"unknown packet type: #{extension}\"\n end\n end\n\n { :extension => extension }.merge(parsed_packet)\n end",
"def subtype\n return unless media_type\n\n media_type.split('/').last\n end",
"def text_plain_part(part = tmail)\n case part.content_type\n when 'text/plain'\n part\n when 'multipart/alternative'\n part.parts.detect {|part| text_plain_part(part)}\n end\n end",
"def body_parts\n\t @part.getCount.times.map do |index|\n\t\tpart = @part.getBodyPart(index)\n\t\tnext(BodyPart.new(part, self)) \\\n\t\t unless @message.is_a?(javax.mail.Multipart)\n\t\tMultipart.new(part, self)\n\t end\n\tend",
"def sniff_mime(content)\n m = MimeMagic.by_magic(content)\n return if m.nil?\n\n # Overwrite incorrect mime types\n case m.type.to_s\n when 'application/xhtml+xml'\n return 'text/html'\n when 'text/x-csrc'\n return 'text/css'\n end\n\n m.type\n rescue\n nil\n end",
"def mime_type_for(format, temp_object=nil)\n registered_mime_types[file_ext_string(format)] || (temp_object.mime_type if temp_object.respond_to?(:mime_type)) || fallback_mime_type\n end",
"def file_content_type\n types = MIME::Types.type_for(original_filename)\n types.first\n end",
"def read_multipart(boundary, content_length)\n ## read first boundary\n stdin = stdinput\n first_line = \"--#{boundary}#{EOL}\"\n content_length -= first_line.bytesize\n status = stdin.read(first_line.bytesize)\n raise EOFError.new(\"no content body\") unless status\n raise EOFError.new(\"bad content body\") unless first_line == status\n ## parse and set params\n params = {}\n @files = {}\n boundary_rexp = /--#{Regexp.quote(boundary)}(#{EOL}|--)/\n boundary_size = \"#{EOL}--#{boundary}#{EOL}\".bytesize\n buf = ''.dup\n bufsize = 10 * 1024\n max_count = MAX_MULTIPART_COUNT\n n = 0\n tempfiles = []\n while true\n (n += 1) < max_count or raise StandardError.new(\"too many parameters.\")\n ## create body (StringIO or Tempfile)\n body = create_body(bufsize < content_length)\n tempfiles << body if defined?(Tempfile) && body.kind_of?(Tempfile)\n class << body\n if method_defined?(:path)\n alias local_path path\n else\n def local_path\n nil\n end\n end\n attr_reader :original_filename, :content_type\n end\n ## find head and boundary\n head = nil\n separator = EOL * 2\n until head && matched = boundary_rexp.match(buf)\n if !head && pos = buf.index(separator)\n len = pos + EOL.bytesize\n head = buf[0, len]\n buf = buf[(pos+separator.bytesize)..-1]\n else\n if head && buf.size > boundary_size\n len = buf.size - boundary_size\n body.print(buf[0, len])\n buf[0, len] = ''\n end\n c = stdin.read(bufsize < content_length ? bufsize : content_length)\n raise EOFError.new(\"bad content body\") if c.nil? || c.empty?\n buf << c\n content_length -= c.bytesize\n end\n end\n ## read to end of boundary\n m = matched\n len = m.begin(0)\n s = buf[0, len]\n if s =~ /(\\r?\\n)\\z/\n s = buf[0, len - $1.bytesize]\n end\n body.print(s)\n buf = buf[m.end(0)..-1]\n boundary_end = m[1]\n content_length = -1 if boundary_end == '--'\n ## reset file cursor position\n body.rewind\n ## original filename\n /Content-Disposition:.* filename=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n filename = $1 || $2 || ''.dup\n filename = CGI.unescape(filename) if unescape_filename?()\n body.instance_variable_set(:@original_filename, filename)\n ## content type\n /Content-Type: (.*)/i.match(head)\n (content_type = $1 || ''.dup).chomp!\n body.instance_variable_set(:@content_type, content_type)\n ## query parameter name\n /Content-Disposition:.* name=(?:\"(.*?)\"|([^;\\r\\n]*))/i.match(head)\n name = $1 || $2 || ''\n if body.original_filename.empty?\n value=body.read.dup.force_encoding(@accept_charset)\n body.close! if defined?(Tempfile) && body.kind_of?(Tempfile)\n (params[name] ||= []) << value\n unless value.valid_encoding?\n if @accept_charset_error_block\n @accept_charset_error_block.call(name,value)\n else\n raise InvalidEncoding,\"Accept-Charset encoding error\"\n end\n end\n class << params[name].last;self;end.class_eval do\n define_method(:read){self}\n define_method(:original_filename){\"\"}\n define_method(:content_type){\"\"}\n end\n else\n (params[name] ||= []) << body\n @files[name]=body\n end\n ## break loop\n break if content_length == -1\n end\n raise EOFError, \"bad boundary end of body part\" unless boundary_end =~ /--/\n params.default = []\n params\n rescue Exception\n if tempfiles\n tempfiles.each {|t|\n if t.path\n t.close!\n end\n }\n end\n raise\n end",
"def subtype(default = nil)\n if value = content_type\n value.split('/')[1]\n else\n if block_given? then\n yield\n else\n default\n end\n end\n end",
"def guess_mime(ext)\n content_types = WEBrick::HTTPUtils::DefaultMimeTypes\n common_content_types = { 'ico' => 'image/x-icon' }\n content_types.merge!(common_content_types)\n content_types.each do |k, v|\n return v.to_s if ext.eql?(\".#{k}\")\n end\n nil\n end",
"def multipart?\n has_content_type? ? !!(main_type =~ /^multipart$/i) : false\n end"
] | [
"0.81594896",
"0.68456435",
"0.6838694",
"0.68105495",
"0.6785661",
"0.66915774",
"0.6241558",
"0.61803854",
"0.6168737",
"0.6095913",
"0.60192",
"0.5857295",
"0.5844454",
"0.5838469",
"0.57698023",
"0.57279783",
"0.5694555",
"0.5678422",
"0.56566614",
"0.56438607",
"0.56017125",
"0.557732",
"0.5572319",
"0.55532163",
"0.55510205",
"0.55308473",
"0.55224985",
"0.5494393",
"0.5476684",
"0.5455677",
"0.5330576",
"0.52942306",
"0.52921504",
"0.5286388",
"0.5284345",
"0.5272182",
"0.5271871",
"0.525919",
"0.52591336",
"0.5226982",
"0.5189792",
"0.5185433",
"0.5174201",
"0.5172782",
"0.515719",
"0.5134493",
"0.51326245",
"0.51285136",
"0.51252425",
"0.5116022",
"0.510077",
"0.50964946",
"0.50838464",
"0.5050902",
"0.5047751",
"0.50470567",
"0.50440896",
"0.50406265",
"0.5032887",
"0.5031018",
"0.5024027",
"0.50159925",
"0.50124604",
"0.50008833",
"0.49974838",
"0.49931583",
"0.49867058",
"0.49861506",
"0.49842793",
"0.49769628",
"0.49693608",
"0.496891",
"0.49680766",
"0.49680766",
"0.49639565",
"0.49566755",
"0.49376443",
"0.49347582",
"0.4930465",
"0.49302188",
"0.49012724",
"0.4893638",
"0.48891506",
"0.48828012",
"0.48815045",
"0.48770174",
"0.4873476",
"0.48725307",
"0.48690358",
"0.4867504",
"0.48622647",
"0.4856886",
"0.4848767",
"0.48441657",
"0.48397106",
"0.4839621",
"0.4836572",
"0.48302558",
"0.4829785",
"0.48275587"
] | 0.81477994 | 1 |
a filename, or nil | def mime_filename_for part
cd = part.fetch_header(:content_disposition)
ct = part.fetch_header(:content_type)
## RFC 2183 (Content-Disposition) specifies that disposition-parms are
## separated by ";". So, we match everything up to " and ; (if present).
filename = if ct && ct =~ /name="?(.*?[^\\])("|;|\z)/im # find in content-type
$1
elsif cd && cd =~ /filename="?(.*?[^\\])("|;|\z)/m # find in content-disposition
$1
end
## filename could be RFC2047 encoded
filename.chomp if filename
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filename(filename = nil)\n @filename = filename if filename\n @filename\n end",
"def filename\n @filename || (@options && @options[:filename])\n end",
"def filename\n @filename || (@options && @options[:filename])\n end",
"def filename\n @filename || @options[:filename]\n end",
"def filename\n unless @filename\n load_file_params\n end\n @filename\n end",
"def filename=(_arg0); end",
"def filename=(_arg0); end",
"def filename=(_arg0); end",
"def file() nil; end",
"def filename\n raise\n end",
"def try_file(filename)\n return file(filename)\n rescue FileMissing\n return nil\n end",
"def try_file(filename)\n return file(filename)\n rescue FileMissing\n return nil\n end",
"def filename\n if url\n url.match(%r{([^\\/]+\\z)})[0]\n else\n nil\n end\n end",
"def filename\n path && File.basename(path)\n end",
"def filename\n return @filename if @filename\n is_directory = url.match /\\/\\z/\n if is_directory\n @filename = filename_for_directory\n else\n @filename = filename_for_file\n end\n @filename\n end",
"def filename\n return @args[:fname]\n end",
"def path\n @path ||= @filename ? pathname.to_s : nil\n end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename; end",
"def filename\n @filename\n end",
"def name_or_filename\n name.blank? ? image_name : name\n end",
"def filename=(_); end",
"def filename\n @metadata[:filename] || uri.path.split('/')[-1]\n end",
"def filename\n @file\n end",
"def extract_filename(full_path = T.unsafe(nil)); end",
"def filename\n @filename\n end",
"def filename\n @filename\n end",
"def filename\n unless @filename\n @filename = @path.basename.to_s\n end\n\n @filename\n end",
"def filename\n return @args[\"fname\"]\n end",
"def FileName\n if(!FilePath)\n return nil\n end\n return FilePath.FileName\n end",
"def filename\n return @filename if @filename\n name.downcase.gsub(/\\W/, '_').squeeze('_')\n end",
"def filename\n return @filename unless @filename.nil?\n generate_file_name()\n @filename\n end",
"def name() @filename end",
"def filename\n return Pathname.new(@file_object.io.path) if @file_object.io.respond_to?(:path) && File.exist?(@file_object.io.path)\n end",
"def filename\n return Pathname.new(@file_object.io.path) if @file_object.io.respond_to?(:path) && File.exist?(@file_object.io.path)\n end",
"def filename\n return Pathname.new(file_object.io.path) if file_object.io.respond_to?(:path) && File.exist?(file_object.io.path)\n end",
"def filename\n return Pathname.new(file_object.io.path) if file_object.io.respond_to?(:path) && File.exist?(file_object.io.path)\n end",
"def filename\n return Pathname.new(file_object.io.path) if file_object.io.respond_to?(:path) && File.exist?(file_object.io.path)\n end",
"def file_nil\n if @file.nil?\n puts \"Please enter a file with a \\\".txt\\\" suffx: \"\n @file = gets.chomp\n end\n end",
"def file_path=(_arg0); end",
"def filename\n get \"filename\"\n end",
"def get_filename (file)\n\t\tif file.is_a? File\n\t\t\tfile = file.path\n\t\tend\n\t\treturn file\n\tend",
"def file_name\n return unless @file\n\n @file.absolute_name\n end",
"def title\n filename.nil? ? nil : File.basename(filename)\n end",
"def filename\n return @file_object.io.path if @file_object.io.respond_to?(:path) && File.exist?(@file_object.io.path)\n end",
"def filename\n return @filename if @filename\n\n if self.uri\n @filename = File.basename(self.uri.path)\n else\n regexps = PRECOMPILED_FILE_TYPES.map { |ext| \"\\.#{ext}\" }.join('|')\n\n @filename = File.basename(self.filepath).gsub(/#{regexps}/, '')\n end\n end",
"def filename\n local?? swf_url : tmp_file.path\n end",
"def filename\n \"something.jpg\" if original_filename\n end",
"def filename\n \"something.jpg\" if original_filename\n end",
"def original_filename=(_arg0); end",
"def random_filename_if_nil filename=nil, length=6\n # stub method to enable documentation in yard\n end",
"def file_name(url=nil)\n return @filename if(@filename)\n\n url ||= self.url\n url = url.split('?').shift\n \n parts = url.split('/')\n if(parts.last == '/')\n parts.pop\n end\n \n file = parts.pop\n \n if(!archive_type.nil? && file.match(/\\.#{archive_type.to_s}$/).nil?)\n file << \".#{archive_type.to_s}\"\n end\n \n return file\n end",
"def path\n @new_filename || @filename\n end",
"def filename \n end",
"def filename\n original_filename\n end",
"def filename\n return @filename if @filename\n\n # Pre-conditions\n raise ArgumentError.new(\"No document root set\") if @path_is_absolute && @document_root.nil?\n raise ArgumentError.new(\"No hosts served from document root\") if @path_has_host && @hosts.empty?\n\n path = strip_host(@path)\n raise ArgumentError.new(\"No matching host found for #{@path}\") if path =~ @@scheme_pattern\n\n dir = @path_is_absolute ? document_root : base\n @filename = File.expand_path(File.join(dir, path))\n end",
"def file\n @files.first ? @files.first[0] : nil\n end",
"def file\n @files.first ? @files.first[0] : nil\n end",
"def default_file_name\n ''\n end",
"def file=(_arg0); end",
"def file=(_arg0); end",
"def file=(_arg0); end",
"def raw_filename\n return filename unless filename.blank?\n name + '.csv'\n end",
"def file_name\n @file_name\n end",
"def get_filename\n filename = gets.chomp\n end",
"def file\n @file ||= File.basename(link)\n end",
"def filename\n @metadata[:filename] || \"attachment\"\n end",
"def getFilename\r\n\t\t\t\t\treturn @filename\r\n\t\t\t\tend",
"def path\n @filename\n end",
"def name\n filename\n end",
"def name\n filename\n end",
"def log_filename\n log_file.nil? || log_file.empty? || log_file == '-' ? nil : log_file\n end",
"def full_filename (for_file = model.document.file)\n for_file\n end",
"def file_name\n return @file_name\n end",
"def file_name\n return @file_name\n end",
"def filename(type = nil)\n if (type.nil?)\n self.slug\n else\n \"#{self.slug}.#{type}\"\n end\n end",
"def file_path; end",
"def filename\n \"wallpaper.#{file.extension}\" if file\n end",
"def filename\n original_filename.try(:gsub, '+', '-')\n end",
"def filename\n @file.basename.to_s\n end",
"def file name\n \n end",
"def full_filename\n filename ? File.join( AppConfig.FlashRecordingPath, filename) : \"\"\n end",
"def filename\n @original_filename\n end",
"def file\n @file ||= find_file\n end",
"def file_or_folder_name\n return @file_or_folder_name\n end",
"def filename\n self._filename\n end",
"def get_filename(body)\n\t\tfilename = 'default_file_name'\n\t\tif body =~ /filename=\"(.*)\"/\n\t\t\tfilename = $1\n\t\tend\n\t\treturn filename\n\tend",
"def filename\n @parts[-1]\n end",
"def try_file(opt=\"\")\n File.read(File.expand_path(opt)) rescue opt\n end"
] | [
"0.76679724",
"0.74676156",
"0.74676156",
"0.7410706",
"0.7313507",
"0.7203521",
"0.7203521",
"0.7203521",
"0.7178585",
"0.71773666",
"0.7166418",
"0.7166418",
"0.7160895",
"0.7093239",
"0.70773673",
"0.7050033",
"0.7039934",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.7005236",
"0.69558764",
"0.6950943",
"0.6940264",
"0.69388986",
"0.69242936",
"0.69219",
"0.68886435",
"0.68886435",
"0.6875533",
"0.68732506",
"0.6827014",
"0.6818485",
"0.6808077",
"0.67926335",
"0.67828465",
"0.67828465",
"0.6777849",
"0.6777849",
"0.6777849",
"0.6728706",
"0.672569",
"0.67219377",
"0.6700542",
"0.6688195",
"0.66792667",
"0.66786516",
"0.66480845",
"0.66470915",
"0.6636566",
"0.6636566",
"0.66045064",
"0.66009784",
"0.65968806",
"0.65619993",
"0.655327",
"0.6522534",
"0.651913",
"0.6513656",
"0.6513656",
"0.65086114",
"0.65024936",
"0.65024936",
"0.65024936",
"0.6496941",
"0.6493579",
"0.64908105",
"0.6482653",
"0.648211",
"0.6471852",
"0.6465872",
"0.6465533",
"0.6465533",
"0.64548635",
"0.64466333",
"0.64464074",
"0.64464074",
"0.64459604",
"0.6441093",
"0.64309824",
"0.6426832",
"0.6426476",
"0.6418767",
"0.6409097",
"0.6407369",
"0.64064944",
"0.6402106",
"0.63879615",
"0.6380952",
"0.6368672",
"0.6366958"
] | 0.0 | -1 |
the content of a mime part itself. if the contenttype is text/, it will be converted to utf8. otherwise, it will be left in the original encoding | def mime_content_for mime_part, preferred_type
return "" unless mime_part.body # sometimes this happens. not sure why.
content_type = mime_part.fetch_header(:content_type) || "text/plain"
source_charset = mime_part.charset || "US-ASCII"
content = mime_part.decoded
converted_content, converted_charset = if(converter = CONVERSIONS[[content_type, preferred_type]])
send converter, content, source_charset
else
[content, source_charset]
end
if content_type =~ /^text\//
Decoder.transcode "utf-8", converted_charset, converted_content
else
converted_content
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mime_content_for mime_part, preferred_type\n return \"\" unless mime_part.body # sometimes this happens. not sure why.\n\n mt = mime_type_for(mime_part) || \"text/plain\" # i guess\n content_type = if mt =~ /^(.+);/ then $1.downcase else mt end\n source_charset = if mt =~ /charset=\"?(.*?)\"?(;|$)/i then $1 else \"US-ASCII\" end\n\n content = mime_part.decode\n converted_content, converted_charset = if(converter = CONVERSIONS[[content_type, preferred_type]])\n send converter, content, source_charset\n else\n [content, source_charset]\n end\n\n if content_type =~ /^text\\//\n Decoder.transcode \"utf-8\", converted_charset, converted_content\n else\n converted_content\n end\n end",
"def convert_encoding(content); end",
"def content\n try(content_type)\n end",
"def contents_convert_utf8\n @publication.title = @publication.title ? @publication.title.force_encoding('UTF-8') : \"\"\n @publication.abstract = @publication.abstract ? @publication.abstract.force_encoding('UTF-8') : \"\"\n @publication.contents = @publication.contents ? @publication.contents.force_encoding('UTF-8') : \"\"\n end",
"def getContent(mail)\n#Converts some characters back to what they should be\n text = mail.text_part.body.decoded\n text.encode!(\"UTF-8\", \"Windows-1250\")\n text.gsub!(\"’\", \"\\'\") #fixes apostrophe bug for parsing\n text.gsub!(/(\\n){3,}/, \"\\n\\n\") #remove excess newlines\n return text\n end",
"def _convert_part_body_to_text(part)\n if part.nil?\n text = \"[ Email has no body, please see attachments ]\"\n text_charset = \"utf-8\"\n else\n text = part.body\n text_charset = part.charset\n if part.content_type == 'text/html'\n # e.g. http://www.whatdotheyknow.com/request/35/response/177\n # XXX This is a bit of a hack as it is calling a convert to text routine.\n # Could instead call a sanitize HTML one.\n text = IncomingMessage._get_attachment_text_internal_one_file(part.content_type, text)\n end\n end\n\n # Charset conversion, turn everything into UTF-8\n if not text_charset.nil?\n begin\n # XXX specially convert unicode pound signs, was needed here\n # http://www.whatdotheyknow.com/request/88/response/352\n text = text.gsub(\"£\", Iconv.conv(text_charset, 'utf-8', '£')) \n # Try proper conversion\n text = Iconv.conv('utf-8', text_charset, text)\n rescue Iconv::IllegalSequence, Iconv::InvalidEncoding\n # Clearly specified charset was nonsense\n text_charset = nil\n end\n end\n if text_charset.nil?\n # No specified charset, so guess\n \n # Could use rchardet here, but it had trouble with \n # http://www.whatdotheyknow.com/request/107/response/144\n # So I gave up - most likely in UK we'll only get windows-1252 anyway.\n\n begin\n # See if it is good UTF-8 anyway\n text = Iconv.conv('utf-8', 'utf-8', text)\n rescue Iconv::IllegalSequence\n begin\n # Or is it good windows-1252, most likely\n text = Iconv.conv('utf-8', 'windows-1252', text)\n rescue Iconv::IllegalSequence\n # Text looks like unlabelled nonsense, strip out anything that isn't UTF-8\n text = Iconv.conv('utf-8//IGNORE', 'utf-8', text) + \"\\n\\n[ WhatDoTheyKnow note: The above text was badly encoded, and has had strange characters removed. ]\"\n end\n end\n end\n \n # An assertion that we have ended up with UTF-8 XXX can remove as this should\n # always be fine if code above is\n Iconv.conv('utf-8', 'utf-8', text)\n\n # Fix DOS style linefeeds to Unix style ones (or other later regexps won't work)\n # Needed for e.g. http://www.whatdotheyknow.com/request/60/response/98\n text = text.gsub(/\\r\\n/, \"\\n\")\n\n # Compress extra spaces down to save space, and to stop regular expressions\n # breaking in strange extreme cases. e.g. for\n # http://www.whatdotheyknow.com/request/spending_on_consultants\n text = text.gsub(/ +/, \" \")\n\n return text\n end",
"def part(mime_type)\n part = mail.parts.find{|p| p.mime_type == mime_type}\n part.body.to_s if part\n end",
"def extract_content_type\n if data_content_type == \"application/octet-stream\" && !data_file_name.blank?\n content_types = MIME::Types.type_for(data_file_name)\n self.data_content_type = content_types.first.to_s unless content_types.empty?\n end\n end",
"def content_type\n ::MIME::Types.type_for(name).first.try(:content_type) || 'text/html'\n end",
"def convert_encoding(content)\n return content if RUBY18\n if content =~ /\\A\\s*#.*coding:\\s*(\\S+)\\s*$/\n content.force_encoding($1)\n else\n content\n end\n end",
"def content\n @content ||= case\n when @file\n @file.read\n when @text\n @text\n when @url\n raise URI::InvalidURIError, @url unless @url =~ URI::regexp\n response = open(@url)\n html = response.read\n html.encode(\"UTF-16\", \"UTF-8\", :invalid => :replace, :replace => \"\").encode(\"UTF-8\", \"UTF-16\")\n end\n end",
"def text\n\t find { |b| b.content_type == 'text/plain' }\n\tend",
"def filename_and_content_to_mimetype(filename, content)\n # Try filename\n ret = filename_to_mimetype(filename)\n if !ret.nil?\n return ret\n end\n\n # Otherwise look inside the file to work out the type.\n # Mahoro is a Ruby binding for libmagic.\n m = Mahoro.new(Mahoro::MIME)\n mahoro_type = m.buffer(content)\n mahoro_type.strip!\n #STDERR.puts(\"mahoro\", mahoro_type, \"xxxok\")\n # XXX we shouldn't have to check empty? here, but Mahoro sometimes returns a blank line :(\n # e.g. for InfoRequestEvent 17930\n if mahoro_type.nil? || mahoro_type.empty?\n return nil\n end\n # text/plain types sometimes come with a charset\n mahoro_type.match(/^(.*);/)\n if $1\n mahoro_type = $1\n end\n # see if looks like a content type, or has something in it that does\n # and return that\n # mahoro returns junk \"\\012- application/msword\" as mime type.\n mahoro_type.match(/([a-z0-9.-]+\\/[a-z0-9.-]+)/)\n if $1\n return $1\n end\n # otherwise we got junk back from mahoro\n return nil\nend",
"def mime_part\n message.mime_part\n end",
"def detect_content_type(text)\n #; [!onjro] returns 'text/html; charset=utf-8' when text starts with '<'.\n #; [!qiugc] returns 'application/json' when text starts with '{'.\n #; [!zamnv] returns nil when text starts with neight '<' nor '{'.\n case text\n when /\\A\\s*</ ; return \"text/html; charset=utf-8\" # probably HTML\n when /\\A\\s*\\{/; return \"application/json\" # probably JSON\n else ; return nil\n end\n end",
"def guessed_safe_content_type\n return unless path\n\n type = Marcel::Magic.by_path(original_filename).to_s\n type if type.start_with?('text/') || type.start_with?('application/json')\n end",
"def content_encoded\n binary_content? ? content : force_crlf(content)\n end",
"def mime_type_text\n mt = MIME::Types[content_type]&.first if content_type.present?\n\n mt.present? && (mt.friendly || mt.sub_type || mt.media_type) || UnknownMimeTypeText\n end",
"def convert(content); end",
"def convert(content); end",
"def convert(content)\n content\n end",
"def to_content(type, value)\n Content.new(type: \"text/#{type}\", value: value)\n end",
"def content_type\n @mime_type || @heads['content-type']\n end",
"def content_type; @message_impl.getContentType; end",
"def content_mime_type; end",
"def mime_type\n return content_type\nend",
"def text\n text = \"\"\n\n if html_part\n text = html_part.decode_body.to_s\n @is_text_html = true\n end\n\n if !text.present? && text_part\n text = text_part.decode_body.to_s \n @is_text_html = false\n end\n\n if !text.present?\n text = body.decoded.to_s \n @is_text_html = false\n end\n\n text\n end",
"def get_main_body_text_part\n leaves = get_attachment_leaves\n \n # Find first part which is text/plain\n leaves.each do |p|\n if p.content_type == 'text/plain'\n return p\n end\n end\n\n # Otherwise first part which is any sort of text\n leaves.each do |p|\n if p.main_type == 'text'\n return p\n end\n end\n \n # ... or if none, consider first part \n p = leaves[0]\n # if it is a known type then don't use it, return no body (nil)\n if mimetype_to_extension(p.content_type)\n # this is guess of case where there are only attachments, no body text\n # e.g. http://www.whatdotheyknow.com/request/cost_benefit_analysis_for_real_n\n return nil\n end\n # otherwise return it assuming it is text (sometimes you get things\n # like binary/octet-stream, or the like, which are really text - XXX if\n # you find an example, put URL here - perhaps we should be always returning\n # nil in this case)\n return p\n end",
"def mime_decode(str, charset = \"UTF-8\")\n decstr = \"\"\n items = str.split(/\\s/).collect{|c| c.strip}\n items.each_with_index do |item, i|\n if item.empty?\n decstr += \" \"\n next\n end\n decstr += \" \" unless decstr.empty?\n mis = item.scan(/^=\\?(UTF-8|utf-8)\\?(B|b)\\?(.+)\\?=$/).flatten\n if mis.empty?\n decstr += item\n else\n decstr += Base64.decode64(mis[-1])\n end\n end\n return msg_decode(decstr, charset)\n end",
"def text_html_part(part = tmail)\n case part.content_type\n when 'text/html'\n part\n when 'multipart/alternative'\n part.parts.detect {|part| text_html_part(part)}\n end\n end",
"def sniff_content_type str\n if (str.nil? or\n (not str.respond_to? :encoding ) or\n (str.encoding.to_s == \"ASCII-8BIT\"))\n \"application/octet-stream\"\n else\n \"text/plain; charset=#{str.encoding}\"\n end\n end",
"def content_type\n @content_type ||=\n identified_content_type ||\n declared_content_type ||\n guessed_safe_content_type ||\n Marcel::MimeType::BINARY\n end",
"def best_mime_encoding\n if self.is_ascii?\n :none\n elsif self.length > (self.mb_chars.length * 1.1)\n :base64\n else\n :quoted_printable\n end\n end",
"def charset\n type, *parameters = content_type_parse\n if pair = parameters.assoc('charset')\n pair.last.downcase\n elsif block_given?\n yield\n elsif type && %r{\\Atext/} =~ type &&\n @base_uri && @base_uri.scheme == 'http'\n \"iso-8859-1\" # RFC2616 3.7.1\n else\n nil\n end\n end",
"def content_type\n @content_type ||= begin\n if attachment?\n \"multipart/mixed; boundary = #{boundary}\"\n else\n \"text/html\"\n end\n end\nend",
"def mime_type\n _mime_type ? _mime_type.to_s : 'text/plain'\n end",
"def content_type\n @mime_type\n end",
"def negotiate_mime(order); end",
"def content_type_options\n {charset: 'utf-8'}\n end",
"def guess_mime_encoding\n # Grab the first line and have a guess?\n # A multiple of 4 and no characters that aren't in base64 ?\n # Need to allow for = at end of base64 string\n squashed = self.tr(\"\\r\\n\\s\", '').strip.sub(/=*\\Z/, '')\n if squashed.length.remainder(4) == 0 && squashed.count(\"^A-Za-z0-9+/\") == 0\n :base64\n else\n :quoted_printable\n end\n # or should we just try both and see what works?\n end",
"def media_type\r\ncontent_mime_type.to_s\r\nend",
"def encoding\n @content[pn(:Encoding)]\n end",
"def content_type\n return @content_type unless @content_type.blank?\n if has_attachments?\n return \"multipart/mixed\"\n elsif !body(:plain).blank? && !body(:html).blank?\n return \"multipart/alternative\"\n elsif body(:html)\n return \"text/html\"\n else\n return \"text/plain\"\n end\n end",
"def process_text(content)\n content\n end",
"def content_type_with_charset(content_type, charset)\n \"#{content_type}; charset=#{charset}\"\n end",
"def text?; mediatype == 'text' || child_of?('text/plain'); end",
"def content_type\n type, *parameters = content_type_parse\n type || 'application/octet-stream'\n end",
"def extract_content_type\n if image_content_type == \"application/octet-stream\" && !image_file_name.blank?\n content_types = MIME::Types.type_for(image_file_name)\n self.image_content_type = content_types.first.to_s unless content_types.empty?\n end\n end",
"def to_html\n case content_type\n when 'text/html'\n content\n when 'text/rtf'\n MessageProcessor.make_html_from_rtf(content)\n when 'text/plain'\n if content.starts_with?(\"{\\\\rtf\")\n MessageProcessor.make_html_from_rtf(content)\n else\n #MessageProcessor.make_html_from_text(content)\n content\n end\n when 'application/x-pit'\n c = content.scan(/^301 (.*)$/).join(\"\\n\")\n if c.starts_with? \"{\\\\rtf\"\n # it's rtf inside PIT\n MessageProcessor.make_html_from_rtf(c)\n else\n MessageProcessor.make_html_from_text(c)\n end\n when 'text/x-clinical'\n c = MessageProcessor.make_html_from_text(content).gsub(/\\*(\\w+)\\*/,\"<b>\\\\1</b>\")\n c.gsub(/\\{([^\\{]+)\\}/) do |str|\n obj = Code.get_clinical_object($1,self)\n if obj\n obj.to_html\n else\n str\n end\n end\n else\n MessageProcessor.make_html_from_text(content)\n end\n \n end",
"def content_encoding\n\t\treturn self.headers.content_encoding\n\tend",
"def content_encoding\n\t\treturn self.headers.content_encoding\n\tend",
"def extract_mime_type(io)\n if io.respond_to?(:mime_type)\n io.mime_type\n elsif io.respond_to?(:content_type)\n io.content_type\n end\n end",
"def content\n return @content if @content\n\n @content = @ftp.gettextfile(@filename, nil)\n\n @content\n end",
"def sniff_mime(content)\n m = MimeMagic.by_magic(content)\n return if m.nil?\n\n # Overwrite incorrect mime types\n case m.type.to_s\n when 'application/xhtml+xml'\n return 'text/html'\n when 'text/x-csrc'\n return 'text/css'\n end\n\n m.type\n rescue\n nil\n end",
"def mime_type\n \"text/plain\"\n end",
"def add_charset\n if !body.empty?\n # Only give a warning if this isn't an attachment, has non US-ASCII and the user\n # has not specified an encoding explicitly.\n if @defaulted_charset && body.raw_source.not_ascii_only? && !self.attachment?\n warning = \"Non US-ASCII detected and no charset defined.\\nDefaulting to UTF-8, set your own if this is incorrect.\\n\"\n STDERR.puts(warning)\n end\n header[:content_type].parameters['charset'] = @charset\n end\n end",
"def body_as_text\n return '' if !body\n return body if content_type.blank? || content_type =~ %r{text/plain}i\n\n body.html2text\n end",
"def default_encoding\n (@media_type == \"text\") ? \"quoted-printable\" : \"base64\"\n end",
"def mime_type\n has_content_type? ? header[:content_type].string : nil rescue nil\n end",
"def to_str\n content_type\n end",
"def _mime_type\n if defined? @_mime_type\n @_mime_type\n else\n guesses = ::MIME::Types.type_for(extname.to_s)\n\n # Prefer text mime types over binary\n @_mime_type = guesses.detect { |type| type.ascii? } || guesses.first\n end\n end",
"def content\n return @content if @content\n if self.commit\n @content = find_content ? find_content.data.force_encoding('UTF-8') : \"\"\n else\n @content = File.exist?(self.file_path) ? open(self.file_path).read.force_encoding('UTF-8') : \"\"\n end\n @content\n end",
"def content_type\n file.try(:content_type)\n end",
"def content_type\n @response['content-type'].nil? ? 'text/plain' : @response['content-type']\n end",
"def append_boundary(headers, content)\n content_type = headers.dig(:content_type)\n charset = get_charset_name(get_char_set(content_type || @default_charset))\n encoding = headers.dig(\"Content-Transfer-Encoding\")\n\n if encoding.instance_of? (String)\n encoding = encoding.downcase\n end\n\n if encoding.instance_of?(Base64)\n if content_type.index \"gbk\"\n content = Base64.decode64(content)\n else\n content = Base64.decode64(content.gsub(/\\r?\\n/, ''))\n end\n elsif encoding == 'quoted-printable'\n content = unquote_printable(content, charset)\n elsif charset != \"utf8\" && ((encoding.start_with? (\"binary\")) || (encoding.start_with? (\"8bit\")))\n content = Base64.decode64(content, charset)\n end\n\n if !result.dig(:html) && content_type && (content_type.index \"text/html\")\n if content.instance_of? (String)\n content = Base64.decode64(content, charset)\n end\n result[:html] = content\n elsif !result.dig(:text) && content_type && (content_type.index \"text/plain\")\n if content.instance_of? (String)\n content = Base64.decode64(content, charset)\n end\n result[:text] = content\n else\n if !result.attachment\n result[:attachments] = []\n end\n\n attachment = {}\n\n id = headers.dig(\"Content-ID\")\n if id\n attachment[:id] = id\n end\n\n name = headers[\"Content-Disposition\"] || headers[\"Content-Type\"]\n\n if name\n match = name.match(/name=\"?(.+?)\"?$/)\n if match\n name = match[1]\n else\n name = nil\n end\n end\n\n if name\n attachment[:name] = name\n end\n\n ct = headers[\"Content-Type\"]\n\n if ct\n attachment[:content_type] = ct\n end\n\n cd = headers[\"Content-Disposition\"]\n\n if cd\n attachment[:inline] = cd.match(/^\\s*inline/)\n end\n\n attachment[:data] = content\n result[:attachments].push(attachment)\n end\n result\n end",
"def content_type\n 'text/plain'\n end",
"def mime\n @mime ||= MimeMagic.by_extension(extension) ||\n (Config.mime.magic && MimeMagic.by_magic(content)) ||\n MimeMagic.new(Config.mime.default)\n end",
"def mime_type; end",
"def mime_type; end",
"def mime_type; end",
"def mime_type; end",
"def content_type! type = nil, charset = nil\n __e__.explicit_charset = charset if charset\n charset ||= (content_type = response['Content-Type']) &&\n content_type.scan(%r[.*;\\s?charset=(.*)]i).flatten.first\n type && (Symbol === type) && (type = '.' << type.to_s)\n content_type = type ?\n (type =~ /\\A\\./ ? '' << mime_type(type) : type.split(';').first) : 'text/html'\n content_type << '; charset=' << charset if charset\n response['Content-Type'] = content_type\n end",
"def set_content_type raw_type\n response_object.mime_raw raw_type\n end",
"def mime\n self.class.mime(self)\n end",
"def conditionally_inject_charset(res)\n typ = res.header[\"content-type\"]\n return unless @mime_types_charset.key?(typ)\n return if %r!;\\s*charset=!.match?(typ)\n\n res.header[\"content-type\"] = \"#{typ}; charset=#{@jekyll_opts[\"encoding\"]}\"\n end",
"def text_plain_part(part = tmail)\n case part.content_type\n when 'text/plain'\n part\n when 'multipart/alternative'\n part.parts.detect {|part| text_plain_part(part)}\n end\n end",
"def convert_encoding(content)\n return content unless content.respond_to?(:force_encoding)\n if content =~ ENCODING_LINE\n content.force_encoding($1)\n else\n content.force_encoding('binary')\n ENCODING_BYTE_ORDER_MARKS.each do |encoding, bom|\n bom.force_encoding('binary')\n if content[0, bom.size] == bom\n content.force_encoding(encoding)\n return content\n end\n end\n content.force_encoding('utf-8') # UTF-8 is default encoding\n content\n end\n end",
"def mime_type\n @mime_type ||= message.mime_type\n end",
"def content_transfer_encoding\n @j_del.contentTransferEncoding()\n end",
"def content_type=(mime_type)\n self.headers[\"Content-Type\"] =\n if mime_type =~ /charset/ || (c = charset).nil?\n mime_type.to_s\n else\n \"#{mime_type}; charset=#{c}\"\n end\n end",
"def attachment_content_type_for(joint)\n case File.extname(joint).downcase\n when '.txt' then 'text/plain'\n when '.html' then 'plain/html'\n when '.pdf' then 'application/octet-stream' #'application/x-pdf'\n when '.jpg', '.jpeg' then 'image/jpeg'\n when '.png' then 'image/png'\n when '.gif' then 'image/gif'\n when '.doc', '.docx' then 'application/msword'\n else \n 'plain/text' # par défaut\n end\nend",
"def stringy_media_type\n request.content_mime_type.to_s\n end",
"def mime_type_charset_detecter(mime_type)\n if type = config[:mime_types][mime_type]\n if detect = type[:charset]\n return detect\n end\n end\n end",
"def email_parts_of_type(email, content_type = \"text/plain\")\n email.body.parts.select {|part|\n if part.respond_to?(:content_type)\n part.content_type.downcase.include? content_type\n end\n }\n end",
"def content_type=(type)\n\t\t\tif type.index(C_slash)\n\t\t\t\t@content_type = type\n\t\t\telse\n\t\t\t\t@content_type = MIME::Types.type_for(type).first || BINARY_TYPE\n\t\t\tend\n\t\tend",
"def meta_content_type(body); end",
"def to_s\n content_type\n end",
"def parse_body content_type, body\n body.lstrip! rescue nil\n case content_type\n when \"multipart/alternative\" then parse_multipart_alternative(body)\n when \"text/plain\" then parse_text_plain(body)\n when \"text/html\" then parse_text_html(body)\n when nil then [\"[No Content]\"]\n else [content_type + \" not yet supported\"]\n end\n end",
"def parse(type = nil)\n MimeType[type || mime_type].decode to_s\n end",
"def content_encoding=( type )\n\t\treturn self.headers.content_encoding = type\n\tend",
"def content_encoding=( type )\n\t\treturn self.headers.content_encoding = type\n\tend",
"def mime_type=(_); end",
"def to_str\n @content_type\n end",
"def magic_mime_type\n return if new_record?\n return unless File.exists? io_stream.path\n FileMagic.mime.file(io_stream.path).split(/;\\s*/).first\n end",
"def content_type\n @io.content_type\n end",
"def mime_type=(_arg0); end",
"def mime_type=(_arg0); end",
"def mime_type=(_arg0); end",
"def content_type\n @content_type || file.content_type\n end",
"def parsed_content_type_header; end"
] | [
"0.8224312",
"0.70821804",
"0.7076037",
"0.6950319",
"0.69197065",
"0.6854977",
"0.68008924",
"0.67520815",
"0.65030843",
"0.65019614",
"0.649895",
"0.64961064",
"0.64805937",
"0.6471726",
"0.64519835",
"0.6377766",
"0.6355258",
"0.63552046",
"0.63443625",
"0.63443625",
"0.6343363",
"0.63382655",
"0.63020855",
"0.62352484",
"0.62327605",
"0.6222588",
"0.62079436",
"0.6204563",
"0.61856437",
"0.6180062",
"0.61738783",
"0.6162062",
"0.6161619",
"0.61615413",
"0.6159479",
"0.6152016",
"0.61290526",
"0.6121974",
"0.6121585",
"0.6119374",
"0.61145157",
"0.60972255",
"0.6095716",
"0.6095498",
"0.6091002",
"0.608187",
"0.60780996",
"0.60777336",
"0.60760665",
"0.607229",
"0.607229",
"0.6058386",
"0.60541725",
"0.605262",
"0.60501695",
"0.6043086",
"0.60397315",
"0.6034919",
"0.60304165",
"0.60299647",
"0.6017581",
"0.5990498",
"0.59900093",
"0.59898275",
"0.59861064",
"0.59856355",
"0.59846514",
"0.597633",
"0.597633",
"0.597633",
"0.597633",
"0.59715086",
"0.5961873",
"0.5949719",
"0.59435004",
"0.59413356",
"0.5938622",
"0.5935159",
"0.5924421",
"0.5923121",
"0.5922432",
"0.59061307",
"0.5891536",
"0.58847547",
"0.58773625",
"0.5873811",
"0.587232",
"0.58715516",
"0.5863831",
"0.5860882",
"0.5860882",
"0.584654",
"0.58443123",
"0.58310443",
"0.58302593",
"0.58252245",
"0.58252245",
"0.58252245",
"0.5820866",
"0.58113325"
] | 0.82974017 | 0 |
seconds... this thing can be slow | def html_to_text html, charset
## ignore charset. html2text produces output in the system charset.
#puts "; forced to decode html. running #{HTML_CONVERSION_CMD} on #{html.size}b mime part..."
content = begin
Timeout.timeout(HTML_CONVERSION_TIMEOUT) do
Heliotrope.popen3(HTML_CONVERSION_CMD) do |inn, out, err|
inn.print html
inn.close
out.read
end
end
rescue Timeout::Error
$stderr.puts "; warning: timeout when converting message from html to text"
"[html conversion failed on this command (htmlconversionfailure)]"
end
[content, SYSTEM_CHARSET]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def seconds\n _nudge[2]\n end",
"def seconds() self end",
"def tv_sec() end",
"def cstime=(*) end",
"def time_sec; Time.now.sec; end",
"def tv_usec() end",
"def sec() time[2] end",
"def seconds\n\t\t@seconds\n\tend",
"def cstime(*) end",
"def seconds\n (duration + 0.4999).to_i\n end",
"def seconds\n @time\n end",
"def seconds ; return aseconds % SPM ; end",
"def seconds\n ((@died_at - @time) / 1000).to_i\n end",
"def secs\n @msecs / SEC_TO_MS_F\n end",
"def sec_fraction() time[3] end",
"def seconds\n (Time.now - @start_time).to_i\n end",
"def seconds\n value_parts[2]\n end",
"def seconds\n value_parts[2]\n end",
"def total_time=(_arg0); end",
"def in_seconds\n @seconds\n end",
"def nowSeconds; Time.now.utc.to_i end",
"def milliseconds() Float(self * (10 ** -3)) end",
"def quantity_of_seconds(time)\n time.hour * 60 + time.minute * 60 + time.second + time.second_fraction\nend",
"def nsec\n 0\n end",
"def seconds\n @seconds.abs % 60 * (@seconds < 0 ? -1 : 1)\n end",
"def fast_duration\n 0.5\n end",
"def nanoseconds; end",
"def seconds\n self * 60\n end",
"def microseconds() Float(self * (10 ** -6)) end",
"def durations; end",
"def usec() end",
"def time; end",
"def time; end",
"def time; end",
"def time; end",
"def time; end",
"def time; end",
"def time; end",
"def time; end",
"def time; end",
"def sec\n return @t_sec\n end",
"def duration; end",
"def duration; end",
"def duration; end",
"def duration; end",
"def duration; end",
"def timechunk(sec)\n fail \"sec = #{sec}\" if sec < 1\n 1.send(find_unit(sec)).round\n end",
"def server_timing; end",
"def total_time; end",
"def length\n seconds.to_runtime\n end",
"def ctime() end",
"def ctime() end",
"def ctime() end",
"def ms\n ((duration * 1000.0) + 0.4999).to_i\n end",
"def timer; end",
"def timer; end",
"def timer; end",
"def timer; end",
"def to_seconds; @val end",
"def aseconds ; return @frames / FPS ; end",
"def time=(_arg0); end",
"def time=(_arg0); end",
"def time=(_arg0); end",
"def time=(_arg0); end",
"def time=(_arg0); end",
"def time=(_arg0); end",
"def initialize\n @seconds = 0\n end",
"def elapsed_seconds(start_time, end_time)\r\n end_time - start_time\r\nend",
"def stime(*) end",
"def initialize\n @seconds = 0 #Sets starting time at 0\n end",
"def start_time=(_arg0); end",
"def initialize()\n @seconds = 0 #define fonction seconds\n end",
"def first_data_timeout(seconds); end",
"def duration=(_arg0); end",
"def calc_play_seconds\n @time_days.to_i * 86400 + @time_hours.to_i * 3600 + @time_minutes.to_i * 60\n end",
"def seconds_in_minutes(num_min)\n\tnum_min * 60\nend",
"def script=(seconds); end",
"def time_remaining\n\n end",
"def time_remaining\n end",
"def seconds\n (hour * 60 * 60) + (min * 60)\n end",
"def sec() end",
"def seconds_to(some_ebay_time)\n some_ebay_time - time\n end",
"def sec\n return self.to_a[IDX_SECOND]\n end",
"def server_timing=(_arg0); end",
"def time\n (1 + Time.now.to_i/10).ceil * 10\n end",
"def read_time\n (number_of_words.to_f / WORDS_PER_MINUTE).ceil\n end",
"def microseconds(time)\n ((time[:sec_fraction].to_f % 1) * 1_000_000).to_i\n end",
"def time_diff_milli( start, finish )\n\n\t( finish - start )\n\nend",
"def delay_time\n end",
"def hitimes_duration_i2\n Hitimes::Interval.now.stop\nend",
"def tv_sec\n return @tv_sec\n end",
"def utime(*) end",
"def page_load=(seconds); end",
"def to_seconds\n atom * factor\n end",
"def in_ms(seconds)\n \"#{'%.2f' % (seconds * 1000).round(2)}ms\"\nend",
"def load_time\n \"#{(Time.now-@start_time).round(4)}s\"\n end",
"def d_secs( v )\n TimeDelta.new( SEC_TO_MS * v )\n end",
"def initialize\n @seconds = 0\n end",
"def initialize\n @seconds = 0\n end",
"def seconds_until\n (start_time - Time.now).to_i\n end",
"def seconds_until\n (start_time - Time.now).to_i\n end"
] | [
"0.7695408",
"0.76448673",
"0.7451672",
"0.7334487",
"0.72072446",
"0.719797",
"0.7145516",
"0.7134375",
"0.7133664",
"0.7126344",
"0.7117892",
"0.7078474",
"0.69565105",
"0.6950917",
"0.6950435",
"0.69353133",
"0.6913067",
"0.6913067",
"0.68939644",
"0.6886317",
"0.6875122",
"0.6828897",
"0.67662406",
"0.67645675",
"0.676148",
"0.674498",
"0.67390984",
"0.67367214",
"0.6728873",
"0.67176396",
"0.668576",
"0.6649593",
"0.6649593",
"0.6649593",
"0.6649593",
"0.6649593",
"0.6649593",
"0.6649593",
"0.6649593",
"0.6649593",
"0.66439635",
"0.66329503",
"0.66329503",
"0.66329503",
"0.66329503",
"0.66329503",
"0.66261464",
"0.66126823",
"0.658881",
"0.6552716",
"0.6540089",
"0.6539252",
"0.6539252",
"0.653521",
"0.652608",
"0.652608",
"0.652608",
"0.652608",
"0.6517158",
"0.6501133",
"0.6498253",
"0.6498253",
"0.6498253",
"0.6498253",
"0.6498253",
"0.6498253",
"0.6464575",
"0.64613223",
"0.64590174",
"0.6449132",
"0.64369917",
"0.6435072",
"0.6413989",
"0.6401641",
"0.63994604",
"0.638992",
"0.6382824",
"0.63752186",
"0.6373105",
"0.63725334",
"0.63646907",
"0.63560796",
"0.63539124",
"0.63515466",
"0.6336994",
"0.6316597",
"0.6300112",
"0.629284",
"0.62922096",
"0.6275725",
"0.62730926",
"0.627295",
"0.6272708",
"0.6263253",
"0.62615824",
"0.6261578",
"0.62383956",
"0.62256473",
"0.62256473",
"0.6216795",
"0.6216795"
] | 0.0 | -1 |
Given a number from 0 to 999,999,999,999, spell out that number in English. Step 1 Handle the basic case of 0 through 99. If the input to the program is 22, then the output should be 'twentytwo'. Your program should complain loudly if given a number outside the blessed range. Some good test cases for this program are: 0 14 50 98 1 100 Extension If you're on a Mac, shell out to Mac OS X's say program to talk out loud. Step 2 Implement breaking a number up into chunks of thousands. So 1234567890 should yield a list like 1, 234, 567, and 890, while the far simpler 1000 should yield just 1 and 0. The program must also report any values that are out of range. Step 3 Now handle inserting the appropriate scale word between those chunks. So 1234567890 should yield '1 billion 234 million 567 thousand 890' The program must also report any values that are out of range. It's fine to stop at "trillion". Step 4 Put it all together to get nothing but plain English. 12345 should give twelve thousand three hundred fortyfive. The program must also report any values that are out of range. Extensions Use and (correctly) when spelling out the number in English: 14 becomes "fourteen". 100 becomes "one hundred". 120 becomes "one hundred and twenty". 1002 becomes "one thousand and two". 1323 becomes "one thousand three hundred and twentythree". | def spell_one_nine(num)
case num
when 1
"one"
when 2
"two"
when 3
"three"
when 4
"four"
when 5
"five"
when 6
"six"
when 7
"seven"
when 8
"eight"
when 9
"nine"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_words(number)\n negative = false\n written_out = \"\"\n dictionary = {\n 0 => \"zero\",\n 1 => \"one\",\n 2 => \"two\",\n 3 => \"three\",\n 4 => \"four\",\n 5 => \"five\",\n 6 => \"six\",\n 7 => \"seven\",\n 8 => \"eight\",\n 9 => \"nine\",\n 10 => \"ten\",\n 11 => \"eleven\",\n 12 => \"twelve\",\n 13 => \"thirteen\",\n 14 => \"fourteen\",\n 15 => \"fifteen\",\n 16 => \"sixteen\",\n 17 => \"seventeen\",\n 18 => \"eighteen\",\n 19 => \"nineteen\",\n 20 => \"twenty\",\n 30 => \"thirty\",\n 40 => \"forty\",\n 50 => \"fifty\",\n 60 => \"sixty\",\n 70 => \"seventy\",\n 80 => \"eighty\",\n 90 => \"ninety\",\n 100 => \"hundred\",\n 1_000 => \"thousand\",\n 1_000_000 => \"million\",\n 1_000_000_000 => \"billion\",\n 1_000_000_000_000 => \"trillion\"\n }\n\n if number < 0\n negative = true\n number *= -1\n end\n if number <= 20\n written_out = dictionary[number]\n elsif number < 100\n digits = number.divmod(10)\n written_out = dictionary[digits[0] * 10]\n written_out.concat(digits[1] == 0 ? \"\" : \"-#{to_words(digits[1])}\")\n elsif number < 1_000\n digits = number.divmod(100)\n written_out = \"#{dictionary[digits[0]]} #{dictionary[100]}\"\n written_out.concat(digits[1] == 0 ? \"\" : \" and #{to_words(digits[1])}\")\n elsif number < 1_000_000\n digits = number.divmod(1_000)\n written_out = \"#{to_words(digits[0])} #{dictionary[1_000]}\"\n written_out.concat(digits[1] == 0 ? \"\" : \", #{to_words(digits[1])}\")\n elsif number < 1_000_000_000\n digits = number.divmod(1_000_000)\n written_out = \"#{to_words(digits[0])} #{dictionary[1_000_000]}\"\n written_out.concat(digits[1] == 0 ? \"\" : \", #{to_words(digits[1])}\")\n elsif number < 1_000_000_000_000\n digits = number.divmod(1_000_000_000)\n written_out = \"#{to_words(digits[0])} #{dictionary[1_000_000_000]}\"\n written_out.concat(digits[1] == 0 ? \"\" : \", #{to_words(digits[1])}\")\n else 1_000_000_000_000\n digits = number.divmod(1_000_000_000_000)\n written_out = \"#{to_words(digits[0])} #{dictionary[1_000_000_000_000]}\"\n written_out.concat(digits[1] == 0 ? \"\" : \", #{to_words(digits[1])}\")\n end\n\n if negative\n written_out = \"negative \".concat(written_out)\n end\n\n written_out\nend",
"def in_words(number) \n numbers_to_words = {\n 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight',\n 9 => 'nine', 10 => 'ten', 11 => 'eleven', 12 => 'twelve', 13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen',\n 16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen', 19 => 'nineteen', 20 => 'twenty', 30 => 'thirty', 40 => 'forty',\n 50 => 'fifty', 60 => 'sixty', 70 => 'seventy', 80 => 'eighty', 90 => 'ninety', 100 => 'one hundred'\n}\n\nnumberString = []\n\nif number < 21\n numberString << numbers_to_words[number]\nelsif number < 100\n numStr = number.to_s\n numberString << numbers_to_words[(numStr[0].to_i * 10)]\n\n unless numStr[1].to_i == 0\n numberString << numbers_to_words[numStr[1].to_i]\n end\nelse\n numberString << numbers_to_words[100]\nend\n \nreturn numberString.join(' ')\n\nend",
"def number_to_words(number)\n string_number = number.to_s\n p string_number\n\n return 'zero' if number.zero?\n\n single_digit_numbers = {'1'=>\"one\",'2'=>\"two\",'3'=>\"three\",'4'=>\"four\",\n '5'=>\"five\",'6'=>\"six\",'7'=>\"seven\",'8'=>\"eight\",'9'=>\"nine\"}\n double_digit_numbers = {'10'=>\"ten\",'11'=>\"eleven\",'12'=>\"twelve\",'13'=>\"thirteen\",'14'=>\"fourteen\",\n '15'=>\"fifteen\",'16'=>\"sixteen\",'17'=>\"seventeen\", '18'=>\"eighteen\",'19'=>\"nineteen\"}\n\n ten_digits = {'2' => 'twenty', '3' => 'thirty', '4' => 'forty', '5' => 'fifty',\n '6' => 'sixty', '7' => 'seventy', '8' => 'eighty', '9' => 'ninety'}\n\n hundred = 'hundred'\n\n case number\n when 10..19\n return double_digit_numbers[string_number]\n when 20..99\n return ten_digits[string_number[0]] + \"-\" + single_digit_numbers[string_number[1]]\n when 99..999\n if double_digit_numbers.include?(string_number[-2,2])\n return single_digit_numbers[string_number[0]] + \" \" + hundred + \" and \" + double_digit_numbers[string_number[-2,2]]\n # for 3 digit numbers, checking if the last two digits are in the double_digit_numbers hash\n elsif string_number[1] == '0' && string_number[2] == '0'\n return single_digit_numbers[string_number[0]] + \" \" + hundred\n end\n else\n return single_digit_number[string_number]\n end\nend",
"def hundreds_english(n)\n\t# 0 < n < 1000\n\treturn \"invalid\" if n < 1 || n > 999\n\tn_english = \"\"\n\tdigit_words = [\"zero\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\",\n\t\t\t\t\t\"eight\", \"nine\"]\n\ttens_words = [nil, nil, \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\",\n\t\t\t\t\t\"seventy\", \"eighty\", \"ninety\"]\n\tteens_words = [\"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\",\n\t\t\t\t\t\"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"]\n\thundreds_place = n / 100\n\ttens_place = (n % 100) / 10\n\tones_place = n % 10\n\tif hundreds_place > 0\n\t\tn_english << \"#{digit_words[hundreds_place]} hundred\" \n\t\tn_english << \" and \" if n % 100 > 0\n\tend\n\tif tens_place == 1\n\t\tn_english << \"#{teens_words[ones_place]}\" \n\telse\n\t\tif tens_place > 1\n\t\t\tn_english << \"#{tens_words[tens_place]}\"\n\t\t\tn_english << \"-\" if ones_place > 0\n\t\tend\n\t\tn_english << \"#{digit_words[ones_place]}\" if ones_place > 0\n\tend\n\tn_english\nend",
"def english_number number\n if number < 0 # No negative numbers.\n return 'Please enter a number that isn\\'t negative.'\n end\n if number == 0\n return 'zero'\n end\n\n # No more special cases! No more returns!\n\n numString = '' # This is the string we will return.\n\n onesPlace = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n tensPlace = ['ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\n teenagers = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n\n quindecillion = 1_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000\n quattuordecillion = 1_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000\n tredecillion = 1_000_000_000_000_000_000_000_000_000_000_000_000_000_000\n duodecillion = 1_000_000_000_000_000_000_000_000_000_000_000_000_000\n undecillion = 1_000_000_000_000_000_000_000_000_000_000_000_000\n decillion = 1_000_000_000_000_000_000_000_000_000_000_000\n nonillion = 1_000_000_000_000_000_000_000_000_000_000\n octillion = 1_000_000_000_000_000_000_000_000_000\n septillion = 1_000_000_000_000_000_000_000_000\n sextillion = 1_000_000_000_000_000_000_000\n quintillion = 1_000_000_000_000_000_000\n quadrillion = 1_000_000_000_000_000\n trillion = 1_000_000_000_000\n billion = 1_000_000_000\n million = 1_000_000\n\n # \"left\" is how much of the number we still have left to write out.\n # \"write\" is the part we are writing out right now.\n # write and left... get it? :)\n\n #Quindecillion\n left = number\n write = left/quindecillion # How many Quindecillion left to write out?\n left = left - write*quindecillion # Subtract off those Quindecillion.\n\n if write > 0\n # Now here's a really sly trick:\n quindecillions = english_number write\n numString = numString + quindecillions + ' quindecillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Quattuordecillion\n #left = number\n write = left/quattuordecillion # How many Quattuordecillion left to write out?\n left = left - write*quattuordecillion # Subtract off those Quattuordecillion.\n\n if write > 0\n # Now here's a really sly trick:\n quattuordecillions = english_number write\n numString = numString + quattuordecillions + ' quattuordecillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Tredecillion\n #left = number\n write = left/tredecillion # How many Tredecillion left to write out?\n left = left - write*tredecillion # Subtract off those Tredecillion.\n\n if write > 0\n # Now here's a really sly trick:\n tredecillions = english_number write\n numString = numString + tredecillions + ' tredecillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Duodecillion\n #left = number\n write = left/duodecillion # How many Duodecillion left to write out?\n left = left - write*duodecillion # Subtract off those Duodecillion.\n\n if write > 0\n # Now here's a really sly trick:\n duodecillions = english_number write\n numString = numString + duodecillions + ' duodecillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Undecillion\n #left = number\n write = left/undecillion # How many Undecillion left to write out?\n left = left - write*undecillion # Subtract off those Undecillion.\n\n if write > 0\n # Now here's a really sly trick:\n undecillions = english_number write\n numString = numString + undecillions + ' undecillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Decillion\n #left = number\n write = left/decillion # How many Decillion left to write out?\n left = left - write*decillion # Subtract off those Decillion.\n\n if write > 0\n # Now here's a really sly trick:\n decillions = english_number write\n numString = numString + decillions + ' decillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Nonillion\n #left = number\n write = left/nonillion # How many Nonillion left to write out?\n left = left - write*nonillion # Subtract off those Nonillion.\n\n if write > 0\n # Now here's a really sly trick:\n nonillions = english_number write\n numString = numString + nonillions + ' nonillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Octillion\n #left = number\n write = left/octillion # How many Octillion left to write out?\n left = left - write*octillion # Subtract off those Octillion.\n\n if write > 0\n # Now here's a really sly trick:\n octillions = english_number write\n numString = numString + octillions + ' octillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Septillion\n #left = number\n write = left/septillion # How many Septillion left to write out?\n left = left - write*septillion # Subtract off those Septillion.\n\n if write > 0\n # Now here's a really sly trick:\n septillions = english_number write\n numString = numString + septillions + ' septillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Sextillion\n #left = number\n write = left/sextillion # How many Sextillion left to write out?\n left = left - write*sextillion # Subtract off those Sextillion.\n\n if write > 0\n # Now here's a really sly trick:\n sextillions = english_number write\n numString = numString + sextillions + ' sextillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Quintillion\n #left = number\n write = left/quintillion # How many Quintillion left to write out?\n left = left - write*quintillion # Subtract off those Quintillion.\n\n if write > 0\n # Now here's a really sly trick:\n quintillions = english_number write\n numString = numString + quintillions + ' quintillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Quadrillion\n #left = number\n write = left/quadrillion # How many Quadrillion left to write out?\n left = left - write*quadrillion # Subtract off those Quadrillion.\n\n if write > 0\n # Now here's a really sly trick:\n quadrillions = english_number write\n numString = numString + quadrillions + ' quadrillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Trillion\n #left = number\n write = left/trillion # How many Trillion left to write out?\n left = left - write*trillion # Subtract off those Trillion.\n\n if write > 0\n # Now here's a really sly trick:\n trillions = english_number write\n numString = numString + trillions + ' trillion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Billion\n #left = number\n write = left/billion # How many Billion left to write out?\n left = left - write*billion # Subtract off those Billion.\n\n if write > 0\n # Now here's a really sly trick:\n billions = english_number write\n numString = numString + billions + ' billion'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n #Million\n #left = number\n write = left/million # How many millions left to write out?\n left = left - write*million # Subtract off those millions.\n\n if write > 0\n # Now here's a really sly trick:\n millions = english_number write\n numString = numString + millions + ' million'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n write = left/1000 # How many thousands left to write out?\n left = left - write*1000 # Subtract off those thousands.\n\n if write > 0\n # Now here's a really sly trick:\n thousands = english_number write\n numString = numString + thousands + ' thousand'\n\n if left > 0\n # So we don't write 'two thousandfifty-one'...\n numString = numString + ' '\n end\n end\n\n write = left/100 # How many hundreds left to write out?\n left = left - write*100 # Subtract off those hundreds.\n\n if write > 0\n # Now here's a really sly trick:\n hundreds = english_number write\n numString = numString + hundreds + ' hundred'\n # That's called \"recursion\". So what did I just do?\n # I told this method to call itself, but with \"write\" instead of\n # \"number\". Remember that \"write\" is (at the moment) the number of\n # hundreds we have to write out. After we add \"hundreds\" to\n # \"numString\", we add the string ' hundred' after it.\n # So, for example, if we originally called english_number with\n # 1999 (so \"number\" = 1999), then at this point \"write\" would\n # be 19, and \"left\" would be 99. The laziest thing to do at this\n # point is to have english_number write out the 'nineteen' for us,\n # then we write out ' hundred', and then the rest of\n # english_number writes out 'ninety-nine'.\n\n if left > 0\n # So we don't write 'two hundredfifty-one'...\n numString = numString + ' '\n end\n end\n\n write = left/10 # How many tens left to write out?\n left = left - write*10 # Subtract off those tens.\n\n if write > 0\n if ((write == 1) and (left > 0))\n # Since we can't write \"tenty-two\" instead of \"twelve\",\n # we have to make a special exception for these.\n numString = numString + teenagers[left-1]\n # The \"-1\" is because teenagers[3] is 'fourteen', not 'thirteen'.\n\n # Since we took care of the digit in the ones place already,\n # we have nothing left to write.\n left = 0\n else\n numString = numString + tensPlace[write-1]\n # The \"-1\" is because tensPlace[3] is 'forty', not 'thirty'.\n end\n\n if left > 0\n # So we don't write 'sixtyfour'...\n numString = numString + '-'\n end\n end\n\n write = left # How many ones left to write out?\n left = 0 # Subtract off those ones.\n\n if write > 0\n numString = numString + onesPlace[write-1]\n # The \"-1\" is because onesPlace[3] is 'four', not 'three'.\n end\n\n # Now we just return \"numString\"...\n numString\nend",
"def to_hundreds(num)\n\tin_words = \"\"\n\tnum_to_words = Hash.new(0)\n\tnum_to_words = { 1=>\"One\",2=>\"Two\",3=>\"Three\",4=>\"Four\",5=>\"Five\",6=>\"Six\",7=>\"Seven\",8=>\"Eight\",9=>\"Nine\",10=>\"Ten\",11=>\"Eleven\",12=>\"Twelve\",13=>\"Thirteen\",14=>\"Fourteen\",15=>\"Fifteen\",16=>\"Sixteen\",17=>\"Seventeen\",18=>\"Eighteen\",19=>\"Nineteen\",20=>\"Twenty\",30=>\"Thirty\",40=>\"Fourty\",50=>\"Fifty\",60=>\"Sixty\",70=>\"Seventy\",80=>\"Eighty\",90=>\"Ninety\" }\n\n\tif num / 100 > 0\n\t\tin_words = num_to_words[num / 100] + \" Hundred \"\n\n\t\tif num % 10 != 0\n\t\t\tin_words = in_words + \"and \"\n\t\tend\n\t\tnum = num % 100\n\tend\n\n\tif num / 10 > 0\n\t\tif num / 10 == 1\n\t\t\tin_words = in_words + num_to_words[num] + \" \"\n\t\telsif num % 10 == 0\n\t\t\tin_words = in_words + num_to_words[num]\n\t\telse\n\t\t\tin_words = in_words + num_to_words[num / 10*10] + \" \" + num_to_words[num % 10]\n\t\tend\n\telsif num == 0\n\t\tin_words\n\telse \n\t\tin_words = in_words + num_to_words[num]\n\tend\n\n\tin_words\nend",
"def return_word number\n small = %w(zero one two three four five six seven eight nine ten eleven twelve\n thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty)\n large = %w(zero ten twenty thirty forty fifty sixty seventy eighty ninety)\n\n if number <= 20\n return small[number]\n elsif number > 20 and number < 100\n q, r = number.divmod(10)\n string = large[q] + (r == 0 ? '' : small[r])\n return string\n elsif number >= 100 and number < 1000\n q, r = number.divmod(100)\n string = small[q] + ' hundred'\n string += ' and ' + return_word(r) if r > 0\n return string\n else\n return 'one thousand'\n end\nend",
"def wordify_upto_99(number)\n\t# deal with the numbers 20 and under, straight from array\n\tif number < 21\n\t\tword = @words[number]\n\n\t# numbers 21 to 99, need to split and take from \"@tens\" array first digit\n\telsif number < 100\n\t\tfirst = @tens[number.to_s.slice(0).to_i]\n\t\tif number.to_s.slice(1) == \"0\"\n\t\t\tsecond = \"\"\n\t\telse\n\t\t\tsecond = @words[number.to_s.slice(1).to_i]\n\t\tend\n\t\tword = first + \" \" + second\n\telse\n\t\treturn \"Number greater than 100! Not allowed with this method\"\n\tend\n\treturn word\nend",
"def wordify(number)\n\t# for numbers less than 100\n\tif number < 100\n\t\tword = wordify_upto_99(number)\n\n\t# numbers 100 to 999\n\telsif number < 1000\n\t\t# get first digit and turn into \"hundreds\" e.g. \"two hundred...\"\n\t\tfirst = @words[number.to_s.slice(0).to_i]\n\n\t\t# get the hundreds part\n\t\tif number.to_s.slice(1,2) == \"00\"\n\t\t\tsecond_part = \"\"\n\t\telse\n\t\t\tsecond_part = \" and \" + wordify_upto_99(number.to_s.slice(1,2).to_i)\n\t\tend\n\n\t\t# put it all together\n\t\tword = first + \" hundred\" + second_part\n\t\n\t# final number could be one thousand\n\telse\n\t\tword = \"one thousand\"\n\tend\n\n\treturn word\nend",
"def english_number number\n\tputs 'Number must be positive' if number < 0\n\tprint 'zero' if number == 0\n\n\tunits_in_english = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n\ttens_in_english = ['', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', '']\n\tmultiples = {10 ** 12 => 'trillion', 10 ** 9 => 'billion', 10 ** 6 => 'million', 10 ** 3 => 'thousand', 10 ** 2 => 'hundred'}\n\n\tnum_string = \"\"\n\t# number in English for all positive non-zero numbers\n\n\tleft = number\n\t# amount left to be translated\n\n\tmultiples.each do |key, value|\n\t\t# find out how many multiples:\n\t\twrite = left / key\n\t\t# finds out how much is left after substractiong multiples:\n\t\tleft = left - (write * key)\n\t\tif write >= 10\n\t\t\tnum_string = num_string + (num_string.empty? ? \"\" : \" \") + english_number(write) + ' ' + value\n\t\tend\n\t\tif write > 0 && write < 10\n\t\t\tnum_string = num_string + (num_string.empty? ? \"\" : \" \") + units_in_english[write] + ' ' + value\n\t\tend\n\tend\n\n\tif left >= 20\n\t\twrite = left / 10\n\t\t# finds out how many tens\n\t\tnum_string = num_string + (num_string.empty? ? \"\" : \" \") + tens_in_english[write]\n\t\tleft = left - write * 10\n\t\t# finds out how much is left after taking out the tens\n\t\tnum_string = num_string + '-' if left > 0 \n\t\t# appends '-' in case of 'trirty-four', for example\n\tend\n\n\tif left > 0\n\t\twrite = left\n\t\tnum_string = num_string + ((num_string.empty? or num_string.end_with?(\"-\")) ? \"\" : \" \") + units_in_english[write]\n\tend\n\n\tnum_string\nend",
"def number_letters(number)\n\nsingles = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n\nteens = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n\ntens = ['ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\nnumber_word = nil\n if number == 1000\n return 'one thousand'\n elsif number >= 100 && number < 1000\n hundreds_digit = number / 100\n remainder = number % 100\n if remainder == 0\n number_word = singles[hundreds_digit - 1] + ' hundred'\n else\n number_word = singles[hundreds_digit - 1] + ' hundred and ' + \"#{number_letters(remainder)}\"\n end\n elsif number >= 20 && number <= 99\n tens_digit = number / 10\n remainder = number % 10\n if remainder == 0\n number_word = tens[tens_digit - 1]\n else\n number_word = tens[tens_digit - 1] + '-' + singles[remainder - 1]\n end\n elsif number >= 11 && number <= 19\n remainder = number % 10\n number_word = teens[remainder - 1]\n elsif number == 10\n return 'ten'\n else\n number_word = singles[number - 1]\n end\nnumber_word\nend",
"def number_2_words(n)\n w2n = {\n 90 => \"ninety\",\n 80 => \"eighty\",\n 70 => \"seventy\",\n 60 => \"sixty\",\n 50 => \"fifty\",\n 40 => \"forty\",\n 30 => \"thirty\",\n 20 => \"twenty\",\n 19=>\"nineteen\",\n 18=>\"eighteen\",\n 17=>\"seventeen\", \n 16=>\"sixteen\",\n 15=>\"fifteen\",\n 14=>\"fourteen\",\n 13=>\"thirteen\", \n 12=>\"twelve\",\n 11 => \"eleven\",\n 10 => \"ten\",\n 9 => \"nine\",\n 8 => \"eight\",\n 7 => \"seven\",\n 6 => \"six\",\n 5 => \"five\",\n 4 => \"four\",\n 3 => \"three\",\n 2 => \"two\",\n 1 => \"one\",\n 0 =>''\n }\n return w2n[n.to_i] if n.to_i < 20\n return w2n[(n[0]+'0').to_i] + w2n[n[-1].to_i] if n.to_i<100\n return w2n[n[0].to_i] + 'hundred' + (n[1..-1].to_i > 0 ? \"and\" : \"\") + number_2_words(n[1..-1]) if n.to_i<1000\n return 'onethousand'\nend",
"def number_to_word(number)\n return \"one thousand\" if number == 1000\n\n word = \"\"\n number_string = number.to_s\n\n if number_string.size == 1\n return Words[number]\n end\n\n if number_string.size == 2\n if Words.keys.include?(number)\n return Words[number]\n else\n word += TensDigitWord[number_string[0].to_i]\n word += '-'\n word += Words[number_string[1].to_i]\n end\n end\n\n if number_string.size == 3\n word += Words[ number_string[0].to_i ]\n word += ' hundred'\n\n last_two_digits = number_string[1..2].to_i\n\n if last_two_digits > 0\n word += ' and '\n\n # similar logic as size 2 number\n if Words.keys.include?(last_two_digits)\n word += Words[last_two_digits]\n else\n word += TensDigitWord[number_string[1].to_i]\n word += '-'\n word += Words[number_string[2].to_i]\n end\n end\n end\n\n word\nend",
"def into_words(num)\n ones = [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\"]\n teens = [\"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"]\n tens = [\"ten\", \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"]\n\n if num == 0\n return \"zero\"\n elsif num % 10 == 0 && num < 100\n return tens[(num / 10) - 1]\n elsif num < 20\n return teens[(num - 10) - 1] if num > 10\n return ones[(num - 1)]\n end\n\n tens_place = num.to_s[0].to_i - 1\n ones_place = num.to_s[1].to_i - 1\n return \"#{tens[tens_place]}-#{ones[ones_place]}\"\nend",
"def conversion(number)\n words_hash = {0=>\"zero\",1=>\"one\",2=>\"two\",3=>\"three\",4=>\"four\",5=>\"five\",6=>\"six\",7=>\"seven\",8=>\"eight\",9=>\"nine\",\n 10=>\"ten\",11=>\"eleven\",12=>\"twelve\",13=>\"thirteen\",14=>\"fourteen\",15=>\"fifteen\",16=>\"sixteen\",\n 17=>\"seventeen\", 18=>\"eighteen\",19=>\"nineteen\",\n 20=>\"twenty\",30=>\"thirty\",40=>\"forty\",50=>\"fifty\",60=>\"sixty\",70=>\"seventy\",80=>\"eighty\",90=>\"ninety\"}\n if words_hash.has_key?number\n return words_hash[number] \n else\n num_string = number.to_s.split(//)\n while num_string.size > 0 \n if num_string.size == 2\n return(\"and\")\n return words_hash[(num_string.join.to_i) - (num_string.join.to_i)%10] \n num_string.shift\n end\n if num_string.size > 4\n return(words_hash[(num_string[0,2].join.to_i) - (num_string[0,2].join.to_i) % 10])\n else\n return(words_hash[num_string[0].to_i]) \n end\n return(scale[num_string.size])\n num_string.shift\n end\n end\n\nend",
"def english_number number\n\n # no negative numbers\n\n if number < 0\n return 'Pleases enter a number zero or greater.'\n end\n\n num_string = '' # This is the string we will return\n\n ones_place = ['one', 'two', 'three',\n 'four', 'five', 'six',\n 'seven', 'eight', 'nine']\n tens_place = ['ten', 'twenty', 'thirty',\n 'forty', 'fifty', 'sixty',\n 'seventy', 'eighty', 'ninety']\n teenagers = ['eleven', 'twelve', 'thirteen',\n 'fourteen', 'fifteen', 'sixteen',\n 'seventeen', 'eighteen', 'nineteen']\n suffixes = [['googol', 100],\n ['vigintillion', 63],\n ['novemdecillion', 60],\n ['octodecillion', 57],\n ['septendecillion', 54],\n ['sexdecillion', 51],\n ['quindecillion', 48],\n ['quattuordecillion', 45],\n ['tredecillion', 42],\n ['duodecillion', 39],\n ['undecillion', 36],\n ['decillion', 33],\n ['nonillion', 30],\n ['octillion', 27],\n ['septillion', 24],\n ['sextillion', 21],\n ['quintillion', 18],\n ['quadrillion', 15],\n ['trillion', 12],\n ['billion', 9],\n ['million', 6],\n ['thousand', 3],\n ['hundred', 2]]\n\n # \"left\" is how much of the number\n # we still have left to write out.\n # \"write\" is the part we are\n # writing out right now.\n\n left = number\n\n\n suffixes.each do |item|\n suffix, size = item\n size = 10 ** size\n\n write = left / size # How many zillions left?\n left = left - write * size # Subtract off those zillions.\n\n if write > 0 # we have at least one zillion\n # find the hundeds, tens, and ones of zillions\n number_of = english_number write\n num_string = num_string + number_of + ' ' + suffix\n if left > 0\n num_string = num_string + ' '\n end\n end\n end\n\n write = left / 10 # How many tens left?\n left = left - write * 10 # Subtract off those tens\n\n if write > 0\n if write == 1 and left > 0\n num_string = num_string + teenagers[left - 1]\n left = 0\n else\n num_string = num_string + tens_place[write - 1]\n end\n\n if left > 0\n num_string = num_string + '-'\n end\n end\n\n write = left # How many one left to write out?\n left = 0 # Subtract off those ones.\n if write > 0\n num_string = num_string + ones_place[write - 1]\n end\n\n if num_string == ''\n # The only way num_string could be empty\n # is if \"number\" is 0.\n return 'zero'\n end\n\n num_string\nend",
"def dewordify_upto_99(word_number)\n\tarray = word_number.split(' ')\n\n\tif @words.include?(word_number) # scenario for numbers up to 20\n\t\treturn @words.index(word_number)\n\telsif @tens.include?(array[0]) # scenario for numbers between 21 and 99\n\t\tif array.length == 1\n\t\t\treturn @tens.index(word_number) * 10\n\t\telse\n\t\t\treturn (@tens.index(array[0]) * 10) + @words.index(array[1])\n\t\tend\n\telse\n\t\treturn \"Too big\"\n\tend\nend",
"def numbersToWords(a,b)\n\nnumbers = {0 => \"\", 1 => \"one\", 2 => \"two\", 3 => \"three\", 4 => \"four\", 5 => \"five\"} \nnumbers.merge! 6 => \"six\", 7 => \"seven\", 8 => \"eight\", 9 => \"nine\", 10 => \"ten\"\nnumbers.merge! 11 => \"eleven\", 12 => \"twelve\", 13 => \"thirteen\", 14 => \"fourteen\" \nnumbers.merge! 15 => \"fifteen\", 16 => \"sixteen\", 17 => \"seventeen\", 18 => \"eighteen\" \nnumbers.merge! 19 => \"nineteen\", 20 => \"twenty\", 30 => \"thirty\", 40 => \"forty\" \nnumbers.merge! 50 => \"fifty\", 60 => \"sixty\", 70 => \"seventy\", 80 => \"eighty\", 90 => \"ninety\" \nnumbers.merge! 100 => \"hundred\", 1000 => \"thousand\"\nwords = 0\n\nfor n in (a..b)\n\nthousands = n/1000\nhundredsAndTensAndOnes = n % 1000\nhundreds = (hundredsAndTensAndOnes / 100) * 100\ntensAndOnes = hundredsAndTensAndOnes - hundreds\ntens = (tensAndOnes / 10) * 10\nones = tensAndOnes - tens\n\nif thousands != 0 \nprint \"#{numbers[thousands]} thousand \"\nwords += numbers[thousands].length\nwords += numbers[1000].length\nend\n\nif thousands != 0 && hundreds == 0 && tensAndOnes != 0\nprint \"and \"\nwords += 3\nend\n\nif hundreds != 0\nprint \"#{numbers[hundreds/100]} hundred \"\nwords += numbers[hundreds/100].length\nwords += numbers[100].length\nend\n\nif hundreds != 0 && tensAndOnes != 0\nprint \"and \"\nwords += 3\nend\n\nif tensAndOnes > 19\nprint \"#{numbers[tens]} #{numbers[ones]}\"\nwords += numbers[tens].length\nwords += numbers[ones].length\nend\n\nif tensAndOnes < 20\nprint \"#{numbers[tensAndOnes]}\"\nwords += numbers[tensAndOnes].length\nend\n\nputs \"\"\n\nend\n\nprint \"There are #{words} letters in the written-out numbers between #{a} and #{b} (inclusive).\"\n\nend",
"def englishNumber number\n # We only want numbers from 0-100.\n if number < 0\n return 'Please enter a number zero or greater.'\n end\n if number > 100\n return 'Please enter a number 100 or lesser.'\n end\n\n numString = '' # This is the string we will return.\n\n # \"left\" is how much of the number we still have left to write out.\n # \"write\" is the part we are writing out right now.\n # write and left... get it? :)\n left = number\n write = left/100 # How many hundreds left to write out?\n left = left - write*100 # Subtract off those hundreds.\n\n if write > 0\n return 'one hundred'\n end\n\n write = left/10 # How many tens left to write out?\n left = left - write*10 # Subtract off those tens.\n\n if write > 0\n if write == 1 # Uh-oh...\n # Since we can't write \"tenty-two\" instead of \"twelve\",\n # we have to make a special exception for these.\n if left == 0\n numString = numString + 'ten'\n elsif left == 1\n numString = numString + 'eleven'\n elsif left == 2\n numString = numString + 'twelve'\n elsif left == 3\n numString = numString + 'thirteen'\n elsif left == 4\n numString = numString + 'fourteen'\n elsif left == 5\n numString = numString + 'fifteen'\n elsif left == 6\n numString = numString + 'sixteen'\n elsif left == 7\n numString = numString + 'seventeen'\n elsif left == 8\n numString = numString + 'eighteen'\n elsif left == 9\n numString = numString + 'nineteen'\n end\n # Since we took care of the digit in the ones place already,\n # we have nothing left to write.\n left = 0\n elsif write == 2\n numString = numString + 'twenty'\n elsif write == 3\n numString = numString + 'thirty'\n elsif write == 4\n numString = numString + 'forty'\n elsif write == 5\n numString = numString + 'fifty'\n elsif write == 6\n numString = numString + 'sixty'\n elsif write == 7\n numString = numString + 'seventy'\n elsif write == 8\n numString = numString + 'eighty'\n elsif write == 9\n numString = numString + 'ninety'\n end\n\n if left > 0\n numString = numString + '-'\n end\n end\n\n write = left # How many ones left to write out?\n left = 0 # Subtract off those ones.\n\n if write > 0\n if write == 1\n numString = numString + 'one'\n elsif write == 2\n numString = numString + 'two'\n elsif write == 3\n numString = numString + 'three'\n elsif write == 4\n numString = numString + 'four'\n elsif write == 5\n numString = numString + 'five'\n elsif write == 6\n numString = numString + 'six'\n elsif write == 7\n numString = numString + 'seven'\n elsif write == 8\n numString = numString + 'eight'\n elsif write == 9\n numString = numString + 'nine'\n end\n end\n\n if numString == ''\n # The only way \"numString\" could be empty is if\n # \"number\" is 0.\n return 'zero'\n end\n\n # If we got this far, then we had a number somewhere\n # in between 0 and 100, so we need to return \"numString\".\n numString\nend",
"def englishNumber number\n if number < 0 # No negative numbers.\n return 'Please enter a number that isn\\'t negative.'\n end\n if number == 0\n return 'zero'\n end\n\n numString = ''\n\n #OK, this has to recurse for billions, millions, thousands and hundreds\n #Separators have to be added at point of next element being added\n\n\n #check for billions\n if number / 1000000000 >= 1\n \tnumString = (englishNumber (number / 1000000000)) + ' billion'\n \tnumber = number % 1000000000\n end\n\n #check for millions\n if number / 1000000 >= 1\n \tif numString != ''\n \t\tnumString = numString + ', '\n \tend\n \tnumString = numString + (englishNumber (number / 1000000)) + ' million'\n \tnumber = number % 1000000\n end\n\n #check for thousands\n if number / 1000 >= 1\n \tif numString != ''\n \t\tnumString = numString + ', '\n \tend\n \tnumString = numString + (englishNumber (number / 1000)) + ' thousand'\n \tnumber = number % 1000\n end\n\n #check for hundreds\n if number / 100 >= 1\n \tif numString != ''\n \t\tnumString = numString + ', '\n \tend\n \t#puts 'numString: ' + numString\n \t#puts 'englishNumber: ' + englishNumber(number / 100)\n \tnumString = numString + (englishNumber (number / 100)) + ' hundred'\n \tnumber = number % 100\n end\n\n #check for tens and units\n if (numString != '') and (number > 0)\n \tnumString = numString + ' and '\n end\n\n tensUnits = [[90, 'ninety'],[80,'eighty'],[70,'seventy'],[60,'sixty'],[50,'fifty'],[40,'forty'],\n\t\t\t\t[30,'thirty'],[20,'twenty'],[19,'nineteen'],[18,'eighteen'],[17,'seventeen'],\n\t\t\t\t[16,'sixteen'],[15,'fifteen'],[14,'fourteen'],[13,'thirteen'],[12,'twelve'],\n\t\t\t\t[11,'eleven'],[10,'ten'],[9,'nine'],[8,'eight'],[7,'seven'],[6,'six'],\n\t\t\t\t[5,'five'],[4,'four'],[3,'three'],[2,'two'],[1,'one']]\n\n\ttensUnits.each do |tuNumber,tuWord|\n\t\t#puts 'tensunit loop. number = ' + number.to_s + ' tuNumber = ' + tuNumber.to_s + ' tuWord = ' + tuWord\n\t\tif number - tuNumber >= 0\n\t\t\tnumString = numString + tuWord\n\t\t\tnumber = number - tuNumber\n\t\t\tif number > 0\n\t\t\t\tnumString = numString + '-'\n\t\t\tend\n\t\tend\n\tend\n\n\n\nnumString\nend",
"def english_number(number)\n\n # handle edge cases\n return \"Please enter a number that isn't negative.\" if number < 0 \n return 'zero' if number == 0\n\n num_string = ''\n\n ones_place = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n tens_place = ['ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\n teens = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n\n\n left = number\n write = left/1000\n left = left - write*1000\n\n if write > 0 \n thousands = english_number write\n num_string = num_string + thousands + ' thousand'\n if left > 0 \n num_string = num_string + ' and '\n else\n return num_string\n end\n end\n\n #left = number\n write = left/100 # reminder: integer division\n left = left - write*100\n\n if write > 0\n hundreds = english_number write\n num_string = num_string + hundreds + ' hundred'\n if left > 0 \n num_string = num_string + ' and '\n end\n end\n\n write = left/10\n left = left - write*10\n\n if write > 0 \n if ((write == 1) and (left > 0))\n num_string = num_string + teens[left-1]\n left = 0\n else\n num_string = num_string + tens_place[write-1]\n end\n\n if left > 0\n num_string = num_string + '-'\n end\n\n end\n\n write = left\n left = 0\n\n if write > 0 \n num_string = num_string + ones_place[write-1]\n end\n\n num_string\nend",
"def number_to_english(n)\n return \"\" unless n.integer? && n >= 0\n\n numbers_to_name = {\n 1000000 => \"million\",\n 1000 => \"thousand\",\n 100 => \"hundred\",\n 90 => \"ninety\",\n 80 => \"eighty\",\n 70 => \"seventy\",\n 60 => \"sixty\",\n 50 => \"fifty\",\n 40 => \"forty\",\n 30 => \"thirty\",\n 20 => \"twenty\",\n 19=>\"nineteen\",\n 18=>\"eighteen\",\n 17=>\"seventeen\",\n 16=>\"sixteen\",\n 15=>\"fifteen\",\n 14=>\"fourteen\",\n 13=>\"thirteen\",\n 12=>\"twelve\",\n 11 => \"eleven\",\n 10 => \"ten\",\n 9 => \"nine\",\n 8 => \"eight\",\n 7 => \"seven\",\n 6 => \"six\",\n 5 => \"five\",\n 4 => \"four\",\n 3 => \"three\",\n 2 => \"two\",\n 1 => \"one\",\n 0 => \"zero\"\n }\n\n if n < 10\n numbers_to_name[n]\n elsif n < 100\n if n % 10 == 0 || n < 20\n numbers_to_name[n]\n else\n numbers_to_name[(n / 10) * 10] + ' ' + numbers_to_name[(n % 10)]\n end\n elsif n < 1000\n if n % 100 == 0\n numbers_to_name[(n / 100)] + ' ' + numbers_to_name[100]\n else\n numbers_to_name[(n / 100)] + ' ' + numbers_to_name[100] + ' ' + number_to_english(n % 100)\n end\n elsif n <= 99999\n number_to_english(n / 1000) + ' ' + numbers_to_name[1000] + ' ' + number_to_english(n % 1000)\n else\n \"\"\n end\n\nend",
"def english_number number\n\tputs 'Number must be positive' if number < 0\n\tputs 'zero' if number == 0 \n\n\t\n\tunits_in_english = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n\ttens_in_english = ['', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', '']\n\tthousands_exponentials_in_engligh = {1 => 'thousand', 2 => 'million', 3 => 'billion', 4 => 'trillion' }\n\n\n\tnum_string = ''\n\t# number in English for all positive non-zero numbers\n\n\tleft = number\n\t# amount left to be translated\n\n\tif left > 0\n\n\t\texp = Math.log(number,1000).to_i\n\t\t# finds out order of magnitude of 'left' variable, as exponential of thousands\n\n\t\twhile left > 0 && exp >= 1\n\t\t\twrite = left / (1000 ** exp)\n\t\t\tleft = left - ( write * (1000 ** exp) )\n\t\t\tif write > 0\n\t\t\t\tnum_string = num_string + units_in_english[write] + ' ' + thousands_exponentials_in_engligh[exp]\n\t\t\tend\n\t\t\texp = Math.log(left,1000).to_i unless left == 0\n\t\tend\n\n\tend\n\n=begin old version of if for thousands\n\t# matar esse if:\n\twrite = left/1000\n\t# finds out how many thousands\n\tleft = left - write*1000\n\t# finds out how much is left after taking out the thousands\n\n\tif write > 0\n\t\tnum_string = num_string + units_in_english[write] + ' thousand '\n\tend\n\n=end\n\n\twrite = left/100\n\t# finds out how many hundreds\n\tleft = left - write*100\n\t# finds out how much is left after taking out the hundreds\n\n\tif write > 0\n\t\tnum_string = num_string + units_in_english[write] + ' hundred'\n\tend\n\n\tif left >= 20\n\t\twrite = left / 10\n\t\t# finds out how many tens\n\t\tnum_string = num_string + ' ' + tens_in_english[write]\n\t\tleft = left - write * 10\n\t\t# finds out how much is left after taking out the tens\n\t\tnum_string = num_string + '-' if left > 0 \n\t\t# appends '-' in case of 'trirty-four', for example\n\tend\n\tif left > 0\n\t\twrite = left\n\t\tnum_string = num_string + units_in_english[write]\n\tend\n\n\tnum_string\nend",
"def english_number number\n if number < 0 # No negative numbers.\n return 'Please enter a number that isn\\'t negative'\n end\n if number == 0\n return 'zero'\n end\n\n num_string = ''\n\n ones_place = ['one', 'two', 'three',\n 'four', 'five', 'six',\n 'seven', 'eight', 'nine']\n tens_place = ['ten', 'twenty', 'thirty',\n 'fourty', 'fifty', 'sixty',\n 'seventy', 'eighty', 'ninety']\n teenagers = ['eleven', 'twelve', 'thirteen',\n 'fourteen', 'fifteen', 'sixteen',\n 'seventeen', 'eighteen', 'nineteen']\n\n left = number\n write = left/100\n left = left - write*100\n\n if write > 0\n hundreds = english_number write\n num_string = num_string + hundreds + ' hundred'\n if left > 0\n num_string = num_string + ''\n end\n end\n \n write = left/10\n left = left - write*10\n\n if write > 0\n if ((write == 1) and (left > 0))\n num_string = num_string + teenagers[left-1]\n left = 0\n else\n num_string = num_string + tens_place[write-1]\n end\n\n if left > 0\n num_string = num_string + '-'\n end\n end\n\n write = left\n left = 0\n\n if write > 0\n num_string = num_string + ones_place[write-1]\n end\n\n num_string\nend",
"def to_w # to_w is for 'to words'\n # Numbers up to 20 are quite irregular. We need a specific block of code for tens\n tens = lambda do |x|\n if x < 20\n @@english_numbers[x.to_s.to_sym]\n else\n decs = x.to_s[0] + '0'\n units = x.to_s[-1]\n \"#{@@english_numbers[decs.to_sym]} #{@@english_numbers[units.to_sym]}\"\n end\n end\n # Use a recursive lambda to call itself as many times as needed until the whole number is written\n sentence = lambda do |num|\n num_length = num.to_s.length\n if num_length < 3 # If number is lower than 99 use tens block\n tens.call(num)\n else\n # Create a temporary hash to keep track of the magnitude of the piece of number we are working with\n new_structure = @@structure.select{|k,v| [k,v] if k<num_length}\n digits = new_structure[0][0]\n following_digits = (new_structure.length == 1) ? 2 : new_structure[1][0]\n word = new_structure[0][1]\n if num <= (10**digits - 1) # Get feeper into recursion if the number is smaller than the current order of magnitude\n sentence.call(num)\n else\n # Split the word into a part belonging to the current order of magnitude and a rest\n left = num.to_s[0..-(digits+1)].to_i\n rest = num.to_s[-digits..-1].to_i\n # Apply English grammar rules and exectute the same code recursively onto each side\n if rest == 0\n \"#{sentence.call(left)} #{word}\"\n elsif rest < 10**following_digits\n \"#{sentence.call(left)} #{word} and #{sentence.call(rest)}\" \n else\n \"#{sentence.call(left)} #{word} #{sentence.call(rest)}\"\n end\n end\n end\n end\n # Execute the recursive lambda\n sentence.call(self)\n end",
"def letter_counts(limit)\r\n\t# Define word for cooresponding number\r\n\tnumbers_to_words = {one: 1, two: 2, three: 3, four: 4, five: 5, six: 6, seven: 7, eight: 8, nine: 9, ten: 10,\r\n\t\t\t\t\t\t\t\t\t\t eleven: 11, twelve: 12, thirteen: 13, fourteen: 14, fifteen: 15, sixteen: 16, seventeen: 17, eighteen: 18,\r\n\t\t\t\t\t\t\t\t\t\t nineteen: 19, twenty: 20, thirty: 30, forty: 40, fifty: 50, sixty: 60, seventy: 70, eighty: 80, ninety: 90}\r\n\r\n\t#Variable to count total length\r\n\tcount = 0\r\n\t# Iterate through every number up to limit\r\n\t(1..limit).each do |num|\r\n\t\t# word variable will store word string for current number\r\n\t\tword = \"\"\r\n\t\t# Convert number to array so it is easier to manipulate\r\n\t\tnum_array = num.to_s.split(\"\")\r\n\r\n\t\t# If only one digit long, simply assign key to word\r\n\t\tif num_array.length == 1\r\n\t\t\tx = num_array.join.to_i\r\n\t\t\tword << numbers_to_words.key(x).to_s\r\n\t\tend\r\n\r\n\t\t# If four digits long, add \"one thousand\" to number\r\n\t\tif num_array.length == 4\r\n\t\t\tnum_array.shift\r\n\t\t\tword << \"onethousand\"\r\n\r\n\t\t# If at least three digits, add relevant 1 through 9 key with \"hundred\"\r\n\t\telsif num_array.length >= 3\r\n\t\t\tx = num_array.shift.to_i\r\n\t\t\tword << numbers_to_words.key(x).to_s\r\n\t\t\tword << \"hundred\"\r\n\t\t\t# If number continues after third digit, include \"and\"\r\n\t\t\tword << \"and\" unless num_array == [\"0\",\"0\"]\r\n\t\tend\r\n\r\n\t\t# If at least a two digit number,\r\n\t\tif num_array.length >= 2\r\n\t\t\t# If higher than 20, add relevant 'multiple of ten' key before single key\r\n\t\t\tif num_array.join.to_i > 20\r\n\t\t\t\tx = num_array.shift.to_i * 10\r\n\t\t\t\tword << numbers_to_words.key(x).to_s\r\n\t\t\t\tx = num_array.join.to_i\r\n\t\t\t\tword << numbers_to_words.key(x).to_s\r\n\t\t\t# If less than 20, simply assign key to word\r\n\t\t\telse\r\n\t\t\t\tx = num_array.join.to_i\r\n\t\t\t\tword << numbers_to_words.key(x).to_s\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\t# Output entire word and increase count by word length\r\n\t\tputs word\r\n\t\tcount += word.length\r\n\tend\r\n\tputs count\r\nend",
"def english_number original_number\r\n current_number = original_number\r\n exploded_number = []\r\n # Convert number into an array of multiples of base units\r\n CONVERSIONS.each do |base_pair|\r\n if current_number >= base_pair[:number] * 2\r\n # Enter the multiple and the base unit as elements if necessary\r\n exploded_number << current_number / base_pair[:number]\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n elsif current_number >= base_pair[:number]\r\n # Enter just the base unit if there's no integer multiple\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n end\r\n # Otherwise enter nothing\r\n end\r\n # Eg array [{1000000}, 507, {1000}, 5, 100, 30, 7]\r\n # Reduce array to an English translation\r\n english_result = exploded_number.reduce([\"\",:start]) { |text_string, base_pair|\r\n # Add a space unless it's the start of the string\r\n text_string[0] += ' ' unless text_string[1] == :start\r\n # Convert current number to English if it's a multiple\r\n if base_pair.class == Integer\r\n text_string[0] += english_number(base_pair)\r\n text_string[1] = :multiple\r\n elsif base_pair[:number] >= ONE_PREFIX_BOUNDARY\r\n # Otherwise, if it's >= 100 and preceding unit is not a multiple add 'one'\r\n text_string[0] += 'one ' unless text_string[1] == :multiple\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :above_boundary\r\n else\r\n # Otherwise, if it's <100 and transitioning from >=100, add 'and'\r\n text_string[0] += 'and ' if text_string[1] == :above_boundary\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :below_boundary\r\n end\r\n text_string\r\n }[0]\r\n return english_result\r\nend",
"def englishNumberOf number\n\n if number == 0\n return 'zero'\n end\n\n # database (database for thousands numbers is in helper method)\n onesPlaces = ['one', 'two', 'three', 'four', 'five',\n 'six', 'seven', 'eight', 'nine']\n tensPlaces = ['ten', 'twenty', 'thirty', 'forty', 'fifty',\n 'sixty', 'seventy', 'eighty', 'ninety']\n teenagers = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen',\n 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n\n # englishNum is the string we will return.\n if number < 0\n englishNum = 'negative '\n # make number positive so that when converted to sting,\n # all characters are digits\n number = -number\n else\n englishNum = ''\n end\n\n strNum = number.to_s # convert to string for easy access of digits\n length = strNum.length # save length so we don't have to find it every time\n\n # write from largest to smallest digit (left to right)\n i = 0 # we will work on the ith digit (counting from zero)\n while i < length\n\n digit = strNum[i].to_i\n\n case (i - length) % 3 # used to sort between ones, tens, and hundreds\n\n when 2 # ones digit don't ask me why\n if digit > 0 # only do anything if there is a ones digit\n # The \"- 1\" is because onesPlaces[3] is 'four', not 'three'.\n englishNum += onesPlaces[digit - 1]\n end\n\n # only add thousands number if at least one of the last three digits\n # wasn't 0 (don't need to worry about nil)\n # and this is not the last digit\n if (digit > 0 || strNum[i - 1] != '0' || strNum[i - 2] != '0') &&\n i != length - 1\n englishNum += ' ' + thousandsWordOf(length - i - 1) + ' '\n end\n\n when 1 # tens digit don't ask me why\n if digit > 0 # only do anything if there is a tens digit\n # Since we can't write \"tenty-two\" instead of \"twelve\",\n # we have to make a special exception for these.\n if ((digit == 1) && (strNum[i + 1] != '0')) # next digit not 0\n # The \"-1\" is because teenagers[3] is 'fourteen', not 'thirteen'.\n englishNum += teenagers[strNum[i + 1].to_i - 1]\n # Since we took care of the digit in the ones place already,\n # we have nothing left to write in the next digit\n strNum[i + 1] = '0'\n else\n # The \"-1\" is because tensPlaces[3] is 'forty', not 'thirty'.\n englishNum += tensPlaces[digit - 1]\n end\n if strNum[i + 1] != '0' # So we don't write 'sixtyfour'...\n englishNum += '-'\n end\n end\n\n when 0 # hundreds digit don't ask me why\n if digit > 0\n # The \"- 1\" is because onesPlaces[3] is 'four', not 'three'.\n englishNum += onesPlaces[digit - 1] + ' hundred'\n # So we don't write 'two hundredfifty-one' or 'two hundredone'...\n if strNum[i + 1] != '0' || strNum[i + 2] != '0'\n englishNum += ' '\n end\n end\n\n else\n puts 'Error: i % 3 out of range'\n end # end case statement\n\n i += 1\n end # end while loop\n\n return englishNum\nend",
"def in_words(num)\n\tnumbers = \n\t\t{0 => \"zero\",\n\t\t1 => \"one\",\n\t\t2 => \"two\",\n\t\t3 => \"three\",\n\t\t4 => \"four\",\n\t\t5 => \"five\",\n\t\t6 => \"six\",\n\t\t7 => \"seven\",\n\t\t8 => \"eight\",\n\t\t9 => \"nine\",\n\t\t10 => \"ten\",\n\t\t11 => \"eleven\",\n\t\t12 => \"twelve\",\n\t\t13 => \"thirteen\",\n\t\t15 => \"fifteen\",\n\t\t20 => \"twenty\",\n\t\t30 => \"thirty\",\n\t\t50 => \"fifty\"}\n\n\tnum_array = num.to_s.split(//).map(&:to_i)\n\tcase num_array.length\n\twhen 1\n\t\tnumbers[num_array[0]]\n\twhen 2\n\t\tif num_array[1] == 0\n\t\t\tif numbers[num].nil?\n\t\t\t\tnumbers[num_array[0]] + \"ty\"\n\t\t\telse numbers[num]\n\t\t\tend\n\t\telse\n\t\t\tcase num_array[0]\n\t\t\twhen 1\n\t\t\t\tif numbers[num].nil?\n\t\t\t\t\tnumbers[num_array[1]] + \"teen\"\n\t\t\t\telse numbers[num]\n\t\t\t\tend\n\t\t\twhen 2\n\t\t\t\tnumbers[20] + \" \" + numbers[num_array[1]]\n\t\t\twhen 3\n\t\t\t\tnumbers[30] + \" \" + numbers[num_array[1]]\n\t\t\twhen 5\n\t\t\t\tnumbers[50] + \" \" + numbers[num_array[1]]\n\t\t\telse numbers[num_array[0]] + \"ty \" + numbers[num_array[1]]\n\t\t\tend\n\t\tend\n\telse\n\t\t\"one hundred\"\n\tend\nend",
"def in_words(num)\n hash = {0=> \"zero\",1=>\"one\",2=> \"two\", 3=> \"three\", 4=> \"four\", 5=> \"five\", 6=>\"six\", 7=>\"seven\", 8=>\"eight\", 9=> \"nine\", 10=> \"ten\", 11=> \"eleven\", 12 => \"twelve\", 13 => \"thirteen\", 14=> \"fourteen\", 15 => \"fifteen\", 16=> \"sixteen\", 17=>\"seventeen\", 18=> \"eighteen\", 19=> \"nineteen\", 20=> \"twenty\", 30=> \"thirty\", 40=> \"fourty\", 50=> \"fifty\", 60=> \"sixty\", 70=> \"seventy\", 80=> \"eighty\", 90=> \"ninety\", 100=> \"hundred\"}\n if hash.has_key?(num)\n hash[num]\n elsif num < 100\n hash[num - num % 10] + \" \" + hash[num % 10]\n else\n raise ArgumentError.new(\"Number not in the specified range\")\n end\n \nend",
"def toEnglish(n)\n hundredsString = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n number = n\n write = number / 100 # write is the part we are writing right now\n puts write.to_s + ' write hundreds'\n hundreds = write\n puts hundreds.to_s + ' hundreds hundreds'\n number = number - write * 100 #subtract the hundreds. left with tens\n puts number.to_s + ' number hundreds'\n\n write = number / 10 #remember shit rounds down in programming\n puts write.to_s + ' write tens'\n tens = write\n number = number - write * 10\n puts number.to_s + ' number tens'\n ones = number\n\n def tensMethod(tens, ones)\n onesString = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n teens = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n tensString = ['twenty', 'thirty', 'fourty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\n if tens == 0\n return onesString[ones - 1]\n elsif tens == 1 \n return teens[ones - 1]\n elsif tens >= 2\n return tensString[tens - 2] + '-' + onesString[ones - 1]\n end\n end\n\n if hundreds == 0 \n return tensMethod(tens, ones)\n end\n if hundreds >= 1 \n puts hundredsString[hundreds - 1].to_s + ' hundred ' + tensMethod(tens, ones).to_s\n end\n\nend",
"def one_to_one_thousand()\n\n\tmega_string = \"\"\n\n\tone_to_nine = {1 => \"one\", 2 => \"two\",\n\t\t\t\t3 => \"three\", 4 => \"four\",\n\t\t\t\t5 => \"five\", 6 => \"six\",\n\t\t\t\t7 => \"seven\", 8 => \"eight\",\n\t\t\t\t9 => \"nine\"\n\t\t\t\t}\n\tten_to_nineteen = {10 => \"ten\", 11 => \"eleven\",\n\t\t\t\t\t\t12 => \"twelve\", 13 => \"thirteen\",\n\t\t\t\t\t\t14 => \"fourteen\", 15 => \"fiftenn\",\n\t\t\t\t\t\t16 => \"fifteen\", 17 => \"seventeen\",\n\t\t\t\t\t\t18 => \"eighteen\", 19 => \"nineteen\"\t\t\n\t\t\t\t\t\t}\n\ttwenty_to_ninety = {20 => \"twenty\", 30 => \"thirty\",\n\t\t\t\t\t\t40 => \"forty\", 50 =>\"fifty\",\n\t\t\t\t\t\t60 => \"sixty\", 70 => \"seventy\",\n\t\t\t\t\t\t80 => \"eighty\",90 => \"ninety\"\n\t\t\t\t\t\t}\t\t\t\t\t\n\thundreds = {100=>\"one hundred\", 200 => \"two hundred\",\n\t\t\t\t300 => \"three hundred\", 400 => \"four hundres\",\n\t\t\t\t500 => \"five hundred\", 600 => \"six hundred\",\n\t\t\t\t700 => \"seven hundred\", 800 => \"eight hundred\",\n\t\t\t\t900 => \"nine hundred\"}\n\n\tone_thousand = {1000 => \"one thousand\"}\t\t\t\n\n\t(1..1000).each do |num|\n\t\tif num < 10\n\t\t\t# p one_to_nine[num]\n\t\t\tmega_string << \" \" + one_to_nine[num]\n\t\telsif num < 20\n\t\t\t# p ten_to_nineteen[num]\n\t\t\tmega_string << \" \" + ten_to_nineteen[num]\n\t\telsif num < 100\n\t\t\tif num % 10 == 0\n\t\t\t\t# p twenty_to_ninety[num]\n\t\t\t\tmega_string << \" \" + twenty_to_ninety[num]\n\t\t\telse\n\t\t\t\tones_place = num % 10\n\t\t\t\t# p \"#{twenty_to_ninety[num-ones_place]} #{one_to_nine[ones_place]}\"\n\t\t\t\tmega_string << \" \" + \"#{twenty_to_ninety[num-ones_place]} #{one_to_nine[ones_place]}\"\n\t\t\tend\n\t\telsif num < 1000\n\t\t\tif num %100 == 0\n\t\t\t\t# p hundreds[num]\n\t\t\t\tmega_string << \" \" + hundreds[num]\n\t\t\telse\n\t\t\t\thundreds_remainder = num % 100\n\t\t\t\tif hundreds_remainder < 10\n\t\t\t\t\t# p \"#{hundreds[num - hundreds_remainder]} and #{one_to_nine[hundreds_remainder]}\"\n\t\t\t\t\tmega_string << \" \" + \"#{hundreds[num - hundreds_remainder]} and #{one_to_nine[hundreds_remainder]}\"\n\t\t\t\telsif hundreds_remainder < 20\n\t\t\t\t\t# p \"#{hundreds[num - hundreds_remainder]} and #{ten_to_nineteen[hundreds_remainder]}\"\n\t\t\t\t\tmega_string << \" \" + \"#{hundreds[num - hundreds_remainder]} and #{ten_to_nineteen[hundreds_remainder]}\"\n\t\t\t\telsif hundreds_remainder < 100\n\t\t\t\t\tif hundreds_remainder % 10 == 0\n\t\t\t\t\t\t# p \"#{hundreds[num - hundreds_remainder]} and #{twenty_to_ninety[hundreds_remainder]}\"\n\t\t\t\t\t\tmega_string << \" \" + \"#{hundreds[num - hundreds_remainder]} and #{twenty_to_ninety[hundreds_remainder]}\"\n\t\t\t\t\telse\n\t\t\t\t\t\ttens_remainder = hundreds_remainder % 10\n\t\t\t\t\t\t# p \"#{hundreds[num - hundreds_remainder]} and #{twenty_to_ninety[hundreds_remainder - tens_remainder]} #{one_to_nine[tens_remainder]}\"\n\t\t\t\t\t\tmega_string << \" \" + \"#{hundreds[num - hundreds_remainder]} and #{twenty_to_ninety[hundreds_remainder - tens_remainder]} #{one_to_nine[tens_remainder]}\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\telsif num == 1000\n\t\t\t# p one_thousand[num]\n\t\t\tmega_string << \" \" + one_thousand[num]\n\t\t\t\t\n\t\tend\n\t\t\t\t\n\tend\n\treturn mega_string\nend",
"def english(x)\n dictionary = {\n 1000 => 'onethousand',\n 100 => 'handred',\n 90 => 'ninety',\n 80 => 'eighty',\n 70 => 'seventy',\n 60 => 'sixty',\n 50 => 'fifty',\n 40 => 'forty',\n 30 => 'thirty',\n 20 => 'twenty',\n 19 => 'nineteen',\n 18 => 'eighteen',\n 17 => 'seventeen',\n 16 => 'sixteen',\n 15 => 'fifteen',\n 14 => 'fourteen',\n 13 => 'thirteen',\n 12 => 'twelve',\n 11 => 'eleven',\n 10 => 'ten',\n 9 => 'nine',\n 8 => 'eight',\n 7 => 'seven',\n 6 => 'six',\n 5 => 'five',\n 4 => 'four',\n 3 => 'three',\n 2 => 'two',\n 1 => 'one',\n }\n result = ''\n while x > 0\n dictionary.each do |k, v|\n if x >= k\n if k == 100\n result += dictionary[x / 100] + v\n x %= 100\n if x > 0\n result += 'and'\n end\n else\n result += v\n x -= k\n end\n break\n end\n end\n end\n result\nend",
"def specific_word(number)\n # Create specific values for non repetitive words\n case number\n when 0 then return \"zero\"\n when 1 then return \"one\"\n when 2 then return \"two\"\n when 3 then return \"three\"\n when 4 then return \"four\"\n when 5 then return \"five\"\n when 6 then return \"six\"\n when 7 then return \"seven\"\n when 8 then return \"eight\"\n when 9 then return \"nine\"\n when 10 then return \"ten\"\n when 11 then return \"eleven\"\n when 12 then return \"twelve\"\n when 13 then return \"thirteen\"\n when 14 then return \"fourteen\"\n when 15 then return \"fifteen\"\n when 16 then return \"sixteen\"\n when 17 then return \"seventeen\"\n when 18 then return \"eighteen\"\n when 19 then return \"nineteen\"\n when 20 then return \"twenty\"\n when 30 then return \"thirty\"\n when 40 then return \"forty\"\n when 50 then return \"fifty\"\n when 60 then return \"fifty\"\n when 70 then return \"seventy\"\n when 80 then return \"eighty\"\n when 90 then return \"ninety\"\n when 100 then return \"one hundred\"\n end\nend",
"def num_to_word (num)\n\n\t# irregular numbers\n\tcase num\n\t\twhen 10\n\t\t\treturn \"ten\"\n\t\twhen 11\n\t\t\treturn \"eleven\"\n\t\twhen 12\n\t\t\treturn \"twelve\"\n\t\twhen 13\n\t\t\treturn \"thirteen\"\n\t\twhen 14\n\t\t\treturn \"fourteen\"\n\t\twhen 15\n\t\t\treturn \"fifteen\"\n\t\twhen 16\n\t\t\treturn \"sixteen\"\n\t\twhen 17\n\t\t\treturn \"seventeen\"\n\t\twhen 18\n\t\t\treturn \"eighteen\"\n\t\twhen 19\n\t\t\treturn \"nineteen\"\n\tend\n\n\t#normal numbers\n\tarray = num.to_s.split(\"\")\n\tones_digit = array.last\n\tif array.length > 1\n\t\ttens_digit = array.first\n\tend\n\n\n\tcase ones_digit\n\t\twhen \"1\"\n\t\t\tones_word = \"one\"\n\t\twhen \"2\"\n\t\t\tones_word = \"two\"\n\t\twhen \"3\"\n\t\t\tones_word = \"three\"\n\t\twhen \"4\"\n\t\t\tones_word = \"four\"\n\t\twhen \"5\"\n\t\t\tones_word = \"five\"\n\t\twhen \"6\"\n\t\t\tones_word = \"six\"\n\t\twhen \"7\"\n\t\t\tones_word = \"seven\"\n\t\twhen \"8\"\n\t\t\tones_word = \"eight\"\n\t\twhen \"9\"\n\t\t\tones_word = \"nine\"\n\t\twhen \"0\"\n\t\t\tones_word = \"\"\n\tend\n\n\treturn ones_word if array.length == 1\n\n\tcase tens_digit\n\t\twhen \"1\"\n\t\t\ttens_word = \"one\"\n\t\twhen \"2\"\n\t\t\ttens_word = \"twenty\"\n\t\twhen \"3\"\n\t\t\ttens_word = \"thirty\"\n\t\twhen \"4\"\n\t\t\ttens_word = \"fourty\"\n\t\twhen \"5\"\n\t\t\ttens_word = \"fifty\"\n\t\twhen \"6\"\n\t\t\ttens_word = \"sixty\"\n\t\twhen \"7\"\n\t\t\ttens_word = \"seventy\"\n\t\twhen \"8\"\n\t\t\ttens_word = \"eighty\"\n\t\twhen \"9\"\n\t\t\ttens_word = \"ninety\"\n\tend\n\n\treturn tens_word if ones_word == 0\n\n\treturn \"#{tens_word} #{ones_word}\"\n\n\nend",
"def printword(digit)\n ones = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n tens = ['twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\n tenones = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen','seventeen', 'eighteen', 'nineteen']\n if digit < 10\n return ones[digit]\n elsif digit < 20\n onesplace = digit % 10\n return tenones[onesplace]\n elsif digit < 100\n tensdigit = (digit / 10).floor\n onesdigit = digit % 10\n return \"#{tens[tensdigit - 2]} #{ones[onesdigit]}\"\n elsif digit < 1_000\n hunddigit = (digit / 100).floor\n hundremainder = digit % 100\n return \"#{printword(hunddigit)} hundred #{printword(hundremainder)}\"\n elsif digit < 1_000_000\n thoudigit = (digit / 1000).floorx\n thouremainder = digit % 1000\n return \"#{printword(thoudigit)} thousand #{printword(thouremainder)}\"\n elsif digit < 1_000_000_000\n milldigit = (digit / 1_000_000).floor\n millremainder = digit % 1_000_000\n return \"#{printword(milldigit)} million #{printword(millremainder)}\"\n elsif digit < 1_000_000_000_000\n billdigit = (digit / 1_000_000_000).floor\n billremainder = digit % 1_000_000\n return \"#{printword(billdigit)} billion #{printword(billremainder)}\"\n end\nend",
"def to_words(n)\n\nwords_hash = {0=>\"zero\",1=>\"one\",2=>\"two\",3=>\"three\",4=>\"four\",5=>\"five\",6=>\"six\",7=>\"seven\",8=>\"eight\",9=>\"nine\",\n 10=>\"ten\",11=>\"eleven\",12=>\"twelve\",13=>\"thirteen\",14=>\"fourteen\",15=>\"fifteen\",16=>\"sixteen\",\n 17=>\"seventeen\", 18=>\"eighteen\",19=>\"nineteen\",\n 20=>\"twenty\",30=>\"thirty\",40=>\"forty\",50=>\"fifty\",60=>\"sixty\",70=>\"seventy\",80=>\"eighty\",90=>\"ninety\"}\n \nif words_hash.has_key?(n)\n return words_hash[n]\nelsif n <= 99\n\n final_string = \"\"\n remainder = (n%10)\n key_value = n - remainder\n final_string = words_hash[key_value] + \" \" + words_hash[remainder]\n return final_string\n\nelse\n return \"one hundred\"\n\nend\nend",
"def number_to_english(n)\n\n numbers_to_name = {\n 1000 => \"thousand\",\n 100 => \"hundred\",\n 90 => \"ninety\",\n 80 => \"eighty\",\n 70 => \"seventy\",\n 60 => \"sixty\",\n 50 => \"fifty\",\n 40 => \"forty\",\n 30 => \"thirty\",\n 20 => \"twenty\",\n 19=>\"nineteen\",\n 18=>\"eighteen\",\n 17=>\"seventeen\",\n 16=>\"sixteen\",\n 15=>\"fifteen\",\n 14=>\"fourteen\",\n 13=>\"thirteen\",\n 12=>\"twelve\",\n 11 => \"eleven\",\n 10 => \"ten\",\n 9 => \"nine\",\n 8 => \"eight\",\n 7 => \"seven\",\n 6 => \"six\",\n 5 => \"five\",\n 4 => \"four\",\n 3 => \"three\",\n 2 => \"two\",\n 1 => \"one\",\n 0 => \"zero\"\n }\n\n\n str = \"\"\n numbers_to_name.each do |num, name|\n\n if n == 0\n return str\n\n elsif n > 99999\n return str\n\n elsif n.to_s.length == 1 && n/num > 0\n return \"#{name}\"\n\n elsif n < 100 && n/num > 0\n\n return \"#{name}\" if n%num == 0\n return \"#{name} \" + number_to_english(n%num)\n\n elsif n/num > 0\n return number_to_english(n/num) + \" #{name} \" + number_to_english(n%num)\n\n end\n\n end\nend",
"def english_number num\n if num < 0\n return 'Please enter a positive number'\n end\n if num == 0\n return 'zero'\n end\n num_string = ''\nones_place = [' one', ' two', ' three',\n ' four',' five', ' six',\n ' seven', ' eight', ' nine']\ntens_place = [' ten', ' twenty', ' thirty',\n ' forty', ' fifty', ' sixty',\n ' seventy', ' eighty', ' ninety']\nteens = [' eleven',' twelve',' thirteen',\n ' fourteen', ' fifteen',' sixteen',\n ' seventeen', ' eighteen',' nineteen']\n\nleft = num\n\nwrite = left/ 1000000000000\nleft = left - write*1000000000000\n if write > 0\n trillions = english_number write\n num_string = num_string + trillions + ' trillion'\n if left > 0\n num_string = num_string + ''\n end\n end\n\nwrite = left/ 1000000000\nleft = left -write*1000000000\n if write > 0\n billions = english_number write\n num_string = num_string + billions + ' billion'\n if left > 0\n num_string = num_string + ''\n end\n end\n\nwrite = left/ 1000000\nleft = left -write*1000000\n if write > 0\n millions = english_number write\n num_string = num_string + millions + ' million'\n if left > 0\n num_string = num_string + ''\n end\n end\n\nwrite = left / 1000\nleft = left - write*1000\n if write > 0\n thousands = english_number write\n num_string = num_string + thousands + ' thousand'\n if left > 0\n num_string = num_string + ''\n end\n end\n\nwrite = left / 100\nleft = left - write*100\n if write > 0\n hundreds = english_number write\n num_string = num_string + hundreds + ' hundred'\n if left > 0\n num_string = num_string + ''\n end\n end\n\nwrite = left/10\nleft = left - write*10\n if write > 0\n if ((write== 1) and (left > 0))\n num_string = num_string + teen[left-1]\n left = 0\n else\n num_string = num_string + tens_place[write-1]\n end\n end\n\n write = left\n left = 0\n if write > 0\n num_string = num_string + ones_place[write-1]\n end\n\n return num_string\nend",
"def in_words\n num_in_words = \"\"\n ones, tens = \"\", \"\"\n number = self\n return \"zero\" if number == 0\n if number % 100 > 9 && number % 100 < 20\n # we've hit a teen number\n tens = TEENS[number % 100]\n num_in_words.insert(0, tens)\n else\n ones = ONES[number % 10]\n number -= number % 10\n num_in_words.insert(0, ones) if !ones.nil?\n\n if number % 100 > 0\n tens = TENS[number % 100]\n number -= number % 100\n num_in_words.insert(0, tens + \" \")\n end\n end\n\n if (number%1000) >= 100 && (number%1000) < 1000\n hundreds = ONES[(number % 1000)/100] + \" hundred\"\n number -= number % 1000\n num_in_words.insert(0, hundreds + \" \")\n end\n\n greater_than_num = \"\"\n if number >= 1000000000000\n trillions = (number / 1000000000000).in_words + \" trillion\"\n number -= (number / 1000000000000) * 1000000000000\n greater_than_num << trillions + \" \"\n end\n if number >= 1000000000\n billions = (number / 1000000000).in_words + \" billion\"\n number -= (number / 1000000000) * 1000000000\n greater_than_num << billions + \" \"\n end\n if number >= 1000000\n millions = (number / 1000000).in_words + \" million\"\n number -= (number / 1000000) * 1000000\n greater_than_num << millions + \" \"\n end\n if number >= 1000\n thousands = (number / 1000).in_words + \" thousand\"\n number = 0\n greater_than_num << thousands + \" \"\n end\n (greater_than_num + num_in_words).strip\n end",
"def english_number(num)\n num_string = \"\"\n if num < 0\n return \"Please enter a non-negative number.\"\n end\n if num == 0\n return \"zero\"\n end\n\n ones_place = ['one','two','three','four','five','six','seven','eight','nine']\n tens_place = ['ten','twenty','thirty','fourty','fifty','sixty','seventy','eighty','ninety']\n teenagers = ['eleven', 'twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']\n\n left = num\n write = left/100\n left = left - write*100\n\n if write > 0\n hundreds = english_number(write)\n num_string = num_string + hundreds + ' hundred'\n if left > 0\n num_string = num_string + ' '\n end\n end\n\n write = left/10\n left = left - write*10\n\n if write > 0\n if ((write == 1) && (left > 0))\n num_string = num_string + teenagers[left-1]\n left = 0\n else\n num_string = num_string + tens_place[write-1]\n end\n\n if left > 0\n num_string = num_string + '-'\n end\n end\n\n write = left\n left = 0\n\n if write > 0\n num_string = num_string + ones_place[write-1]\n end\n return num_string\nend",
"def in_words(n)\n # n / power of 10 = leftmost digit. n % power of 10 = remaining right digits.\n\n words = []\n\n case n\n when 0..19\n words.unshift(teen(n))\n when 20..99\n words.unshift(tens(n))\n when 100..999\n words.unshift(hundreds(n))\n when 1000..999_999\n words.unshift(thousands(n))\n end\n\n words.join(' ')\nend",
"def englishNumber number\n if number < 0 # No negative numbers.\n return 'Please enter a number that isn\\'t negative.'\n end\n if number == 0\n return 'zero'\n end\n\n\n numString = '' # This is the string we will return.\n\n onesPlace = ['one', 'two', 'three', 'four', 'five',\n 'six', 'seven', 'eight', 'nine']\n tensPlace = ['ten', 'twenty', 'thirty', 'forty', 'fifty',\n 'sixty', 'seventy', 'eighty', 'ninety']\n teenagers = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen',\n 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n\n # \"left\" is how much of the number we still have left to write out.\n # \"write\" is the part we are writing out right now.\n left = number\n\t\n\twrite = left/1000000000000\t\t\t\t # How many trillions left to write out?\n\tleft = left - write*1000000000000 # Subtract off those thousands\n\t\n\tif write > 0\n\t\ttrillions = englishNumber write\n\t\tnumString = numString + trillions + ' trillion'\n\t\t\n\t\tif left > 0\n\t\t\tnumString = numString + ' '\n\t\tend\n\tend\n\t\n\twrite = left/1000000000\t\t\t\t # How many billions left to write out?\n\tleft = left - write*1000000000 # Subtract off those thousands\n\t\n\tif write > 0\n\t\tbillions = englishNumber write\n\t\tnumString = numString + billions + ' billion'\n\t\t\n\t\tif left > 0\n\t\t\tnumString = numString + ' '\n\t\tend\n\tend\n\t\n\twrite = left/1000000\t\t\t\t # How many millions left to write out?\n\tleft = left - write*1000000 # Subtract off those thousands\n\t\n\tif write > 0\n\t\tmillions = englishNumber write\n\t\tnumString = numString + millions + ' million'\n\t\t\n\t\tif left > 0\n\t\t\tnumString = numString + ' '\n\t\tend\n\tend\n\t\n\twrite = left/1000 \t\t\t\t# How many thousands left to write out?\n\tleft = left - write*1000 # Subtract off those thousands\n\t\n\tif write > 0\n\t\tthousands = englishNumber write\n\t\tnumString = numString + thousands + ' thousand'\n\t\t\n\t\tif left > 0\n\t\t\tnumString = numString + ' '\n\t\tend\n\tend\n\t\n write = left/100 # How many hundreds left to write out?\n left = left - write*100 # Subtract off those hundreds.\n\n if write > 0\n hundreds = englishNumber write\n numString = numString + hundreds + ' hundred'\n\n if left > 0\n # So we don't write 'two hundredfifty-one'...\n numString = numString + ' '\n end\n end\n\n write = left/10 # How many tens left to write out?\n left = left - write*10 # Subtract off those tens.\n\n if write > 0\n\t\tif ((write == 1) and (left > 0)) #Deal with the teens, since we can't connect single digits for their english terms\n numString = numString + teenagers[left-1]\n\t\t\tleft = 0 # Nothing left to write because teens deals with the ones place\n else\n numString = numString + tensPlace[write-1]\n end\n\n if left > 0\n # So we don't write 'sixtyfour'...\n numString = numString + '-'\n end\n end\n\n write = left # How many ones left to write out?\n left = 0 # Subtract off those ones.\n\n if write > 0\n numString = numString + onesPlace[write-1]\n # The \"-1\" is because onesPlace[3] is 'four', not 'three'.\n end\n\n # Now we just return \"numString\"...\n numString\nend",
"def number_in_words(n,ending=nil)\n # It's probably the worst code in ruby I've ever written\n # It seems to work, but it definitely should not ;)\n n = n.to_i \n return '' if n.nil? or n == 0 \n sc = [''] + %w{jeden dwa trzy cztery pięć sześć siedem osiem dziewięć}\n sn = %w{dziesięć jedenaście dwanaście trzynaście czternaście piętnaście szesnaście siedemnaście osiemnaście dziewiętnaście}\n sd = ['',''] + %w{dwadzieścia trzydzieści czterdzieści pięćdziesiąt sześćdziesiąt siedemdziesiąt osiemdziesiąt dziewiędziesiąt sto}\n ss = [''] + %w{sto dwieście trzysta czterysta pięćset sześćset siedemset osiemset dziewięćset}\n b = (ending || ['','','']),%w{tysiąc tysiące tysięcy},%w{milion miliony milionów},%w{miliard miliardy miliardów},%w{bilion biliony bilionów} \n p = n.to_s.size \n return n if p > 15\n d,dn = n.to_s[0,(p%3 == 0 ? 3 : p%3)], n.to_s[(p%3 == 0 ? 3 : p%3)..-1]\n return \"#{d.to_i==0 ? '' : b[((p-1)/3.0).floor][0]} #{number_in_words(dn,ending)}\".strip if (d.to_i == 1 or d.to_i == 0 ) and n != 1\n r = ''\n (d.size-1).downto(0) do |i|\n r += ' ' unless r[-1] and r[-1].chr == ' '\n r += ss[d[-i-1].chr.to_i] if i == 2 \n d[-i-1].chr.to_i == 1 ? (r += sn[d[-i].chr.to_i]; d = d[0..-2]; break) : r += sd[d[-i-1].chr.to_i] if i == 1\n r += sc[d[-i-1].chr.to_i] if i == 0 \n end\n (2..4) === (d.to_i % 10) ? k=1 : k=2\n \"#{r.strip} #{b[((p-1)/3.0).floor][k]} #{number_in_words(dn.to_i,ending)}\".strip\n end",
"def in_words(int)\n ones = [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"]\n tens = [\"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"]\n if int < 19\n return ones[int-1]\n elsif int < 100\n return tens[int/10-2] + \" \" + ones[int%10-1]\n elsif int%10 == 0\n return ones[int/100-1] + \" hundred\"\n else\n return ones[int/100-1] + \" hundred \" + in_words(int%100)\n end\nend",
"def the2(number)\n english = ''\n pre10 = {'10' => 'ten', '11' => 'eleven', '12' => 'twelve', '13' => 'thirteen', '14' => 'fourteen', '15' => 'fifteen', \n '16' => 'sixteen', '17' => 'seventeen', '18' => 'eighteen', '19' => 'nineteen'}\n pre_other = {'2' => 'twenty', '3' => 'thirty', '4' => 'fourty', '5' => 'fifty', '6' => 'sixty',\n '7' => 'seventy', '8' => 'eighty', '9' => 'ninety'}\n if number[0] == '1'\n english = pre10[number]\n else\n english = pre_other[number[0]] + (number[1] == '0' ? '' : '-')\n end\n return english\nend",
"def englishNumber number\n if number < 0 # No negative numbers.\n return \"Please enter a number that isn't negative.\"\n end\n if number == 0\n return \"zero\"\n end\n\n numString = \"\"\n\n onesPlace = [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\"]\n tensPlace = [\"ten\", \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"]\n teenagers = [\"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"]\n\n left = number\n\n write = left/1000 \n left = left - write*1000 \n\n if write > 0\n thousands = englishNumber write\n numString = numString + thousands + \" thousand\"\n\n if left > 0\n numString = numString + \" \"\n end\n end\n\n write = left/100 \n left = left - write*100 \n\n if write > 0\n hundreds = englishNumber write\n numString = numString + hundreds + \" hundred\"\n\n if left > 0\n numString = numString + \" \"\n end\n end\n\n write = left/10 \n left = left - write * 10 \n\n if write > 0\n if ((write == 1) and (left > 0))\n numString = numString + teenagers[left - 1] \n left = 0\n else\n numString = numString + tensPlace[write - 1] \n end\n\n if left > 0 \n numString = numString + \"-\"\n end\n end\n\n write = left\n left = 0\n\n if write > 0\n numString = numString + onesPlace[write - 1]\n end\n\n numString\nend",
"def num_to_eng(int)\n ones_place = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n tens_place = ['', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\n teens = ['ten', 'eleven', 'twelve', 'thirteen','fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n \n array = int.to_s.split('').map {|x| x.to_i}\n\n if array.length == 1\n p ones_place[int]\n elsif array.length == 2 && array[0] == 1 && array[1] == 0\n p tens_place[1]\n elsif array.length == 2 && array[0] == 1\n p teens[array[1]]\n elsif array.length == 2 && array[0] > 1\n p tens_place[array[0]] + \" \" + ones_place[array[1]]\n elsif array.length == 3 && array[1] == 1\n p ones_place[array[0]] + \" hundred \" + teens[array[2]]\n elsif array.length == 3 && array[1] == 0\n p ones_place[array[0]] + \" hundred \" + ones_place[array[2]]\n elsif array.length == 3 && array[1] > 1\n p ones_place[array[0]] + \" hundred \" + tens_place[array[1]] + \" \" + ones_place[array[2]]\n end\nend",
"def in_words(int)\n numbers_to_name = {\n 1000000 => \"Million\",\n 1000 => \"Thousand\",\n 100 => \"Hundred\",\n 90 => \"Ninety\",\n 80 => \"Eighty\",\n 70 => \"Seventy\",\n 60 => \"Sixty\",\n 50 => \"Fifty\",\n 40 => \"Forty\",\n 30 => \"Thirty\",\n 20 => \"Twenty\",\n 19 => \"Nineteen\",\n 18 => \"Eighteen\",\n 17 => \"Seventeen\",\n 16 => \"Sixteen\",\n 15 => \"Fifteen\",\n 14 => \"Fourteen\",\n 13 => \"Thirteen\",\n 12 => \"Twelve\",\n 11 => \"Eleven\",\n 10 => \"Ten\",\n 9 => \"Nine\",\n 8 => \"Eight\",\n 7 => \"Seven\",\n 6 => \"Six\",\n 5 => \"Five\",\n 4 => \"Four\",\n 3 => \"Three\",\n 2 => \"Two\",\n 1 => \"One\"\n }\n str = \"\"\n numbers_to_name.each do |num, name|\n if int == 0\n return str\n elsif int.to_s.length == 1 && int/num > 0\n return str + \"#{name}\"\n elsif int < 100 && int/num > 0\n return str + \"#{name}\" if int%num == 0\n return str + \"#{name}\" + in_words(int%num)\n elsif int/num > 0\n return str + in_words(int/num) + \"#{name}\" + in_words(int%num)\n end\n end\n end",
"def in_words(integer)\n nums_to_words = {\n 1 => \"one\",\n 2 => \"two\",\n 3 => \"three\",\n 4 => \"four\",\n 5 => \"five\",\n 6 => \"six\",\n 7 => \"seven\",\n 8 => \"eight\",\n 9 => \"nine\",\n 10 => \"ten\",\n 11 => \"eleven\",\n 12 => \"twelve\",\n 13 => \"thirteen\",\n 14 => \"fourteen\",\n 15 => \"fifteen\",\n 16 => \"sixteen\",\n 17 => \"seventeen\",\n 18 => \"eighteen\",\n 19 => \"nineteen\",\n 20 => \"twenty\",\n 30 => \"thirty\",\n 40 => \"fourty\",\n 50 => \"fifty\",\n 60 => \"sixty\",\n 70 => \"seventy\",\n 80 => \"eighty\",\n 90 => \"ninety\",\n 100 => \"one hundred\",\n 1000 => \"one thousand\"\n }\n \n if nums_to_words.include? (integer)\n nums_to_words[integer]\n elsif\n int_arr = integer.to_s.chars\n if int_arr.length == 3 && int_arr[1] == \"1\" || int_arr[2] == \"0\"\n second_word = int_arr.pop(2).join.to_i\n first_word = int_arr.pop.to_i\n p nums_to_words[first_word] + \" hundred \" + nums_to_words[second_word]\n elsif int_arr.length == 3\n third_word = int_arr.pop.to_i\n second_word = int_arr.pop.chars.push(\"0\").join.to_i\n first_word = int_arr.pop.to_i\n p nums_to_words[first_word] + \" hundred \" + nums_to_words[second_word] + \" \" + nums_to_words[third_word]\n elsif \n second_word = int_arr.pop.to_i\n first_word = int_arr.push(\"0\").join.to_i\n p nums_to_words[first_word] + \" \" + nums_to_words[second_word]\n end\n end\nend",
"def num_to_words int\n\tones_place = [\"zero\",\"one\",\"two\",\"three\",\"four\",\" five\",\"six\",\"seven\",\"eight\",\"nine\",\"ten\"]\n\tteens_place = [\"blank\",\"eleven\",\"twelve\",\"thirteen\", \"fourteen\",\"fifteen\",\"sixteen\",\"seventeen\",\"eighteen\",\"nineteen\"]\n tens_place = [\"blank\",\"blank\",\"twenty\",\"thirty\",\"forty\",\"fifty\",\"sixty\",\"seventy\",\"eighty\",\"ninety\"]\n\n result = \"\"\n\n #Millions place\n\n left = int / 1000000\n remainder = int % 1000000\n\tresult << num_to_words(left) << \"million \" if left > 0\n\tint = remainder\n\n\t# #Thousands place\n\n\tleft = int / 1000\n\tremainder = int % 1000\n\tresult << num_to_words(left) << \"thousand \" if left > 0 \n\tint = remainder\n\n\t#Hundreds place\n\n\tleft = int / 100\n\tremainder = int % 100\n\tresult << num_to_words(left) << \"hundred \" if left > 0\n\tint = remainder\n\n\t#Tens place\n\n\tleft = int/10\n\tremainder = int % 10\n\n\tif left > 0\n\t\tif left == 1 && remainder > 0\n\t\t\tresult << teens_place[remainder]\n\t\t\tremainder = 0\n\t\telse\n\t\t\tresult << tens_place[left]\n\t\tend\n\tend\n\tleft = remainder\n\n\t# One's place\n\t\n\tresult << ones_place[left] if left > 0\n\tresult\nend",
"def english_number(i)\n raise ArgumentError.new('Input must be an integer') unless i.is_a? Integer\n raise ArgumentError.new('Input must be >= 0') if i < 0\n\n return 'zero' if i == 0\n\n conversion_table = {\n 10000000000000 => 'trillion',\n 1000000000 => 'billion',\n 1000000 => 'million',\n 1000 => 'thousand',\n 100 => 'hundred',\n 90 => 'ninety',\n 80 => 'eighty',\n 70 => 'seventy',\n 60 => 'sixty',\n 50 => 'fifty',\n 40 => 'fourty',\n 30 => 'thirty',\n 20 => 'twenty',\n 19 => 'nineteen',\n 18 => 'eighteen',\n 17 => 'seventeen',\n 16 => 'sixteen',\n 15 => 'fifteen',\n 14 => 'fourteen',\n 13 => 'thirteen',\n 12 => 'twelve',\n 11 => 'eleven',\n 10 => 'ten',\n 9 => 'nine',\n 8 => 'eight',\n 7 => 'seven',\n 6 => 'six',\n 5 => 'five',\n 4 => 'four',\n 3 => 'three',\n 2 => 'two',\n 1 => 'one',\n }\n\n result = []\n\n # i = 600\n conversion_table.each do |integer, english| ## integer = 100 , english = 100\n times = i / integer ## times = 600 / 100 = 6\n if times == 1\n prefix = 'one ' if integer >= 100\n result << prefix.to_s + english\n elsif times > 1 ## < - hit this case\n # english_number(600/100) + 'hundred\n # english _number(6) + \"hundred\"\n result << english_number(times) + '-' + english\n end\n i %= integer\n end\n\n return result.join '-'\n end",
"def small_word_to_num(number)\n ones = {0=>0, 1=>3, 2=>3, 3=>5, 4=>4, 5=>4, 6=>3, 7=>5, 8=>5, 9=>4, 10=>3, 11=>3, 12=>6, 13=>8, 14=>8, 15=>7, 16=>7, 17=>9, 18=>8, 19=>8}\n tens = {0=>0, 1=>0, 2=>6, 3=>6, 4=>5, 5=>5, 6=>5, 7=>7, 8=>6, 9=>6}\n \n\n count = 0\n\n if number < 20\n return ones[number]\n else number < 99\n return tens[number/10] + ones[number%10]\n end\n\nend",
"def thousandsWordOf numZeros\n # this number is useful in determining the thousand-word\n\tnumThousands = numZeros / 3 - 1;\n\n # overwhelmed, right? This is nothing, wait till you see latinRoots\n\tcase (numThousands)\n\twhen 0\n \treturn 'thousand';\n\twhen 1\n\t\treturn 'million';\n\twhen 2\n\t\treturn 'billion';\n\twhen 3\n\t\treturn 'trillion';\n\twhen 4\n\t\treturn 'quadrillion';\n\twhen 5\n\t\treturn 'quintillion';\n\twhen 6\n\t\treturn 'sextillion';\n\twhen 7\n\t\treturn 'septillion';\n\twhen 8\n\t\treturn 'octillion';\n\twhen 9\n\t\treturn 'nonillion';\n\n\twhen 10\n\t\treturn 'decillion';\n\twhen 20\n\t\treturn 'vigintillion';\n\twhen 30\n\t\treturn 'trigintillion';\n\twhen 40\n\t\treturn 'qradragintillion';\n\twhen 50\n\t\treturn 'quinquagintillion';\n\twhen 60\n\t\treturn 'sexagintillion';\n\twhen 70\n\t\treturn 'septagintillion';\n\twhen 80\n\t\treturn 'octogintillion';\n\twhen 90\n\t\treturn 'nonagintillion';\n\twhen 100\n\t\treturn 'centillion';\n\n\telse # if the number of zeros is not a tens or less than ten\n latinRoots = ['un', 'duo', 'tre', 'quattuor', 'quin',\n 'sex', 'septen', 'octo', 'novem']\n\t\tif numThousands > 10 # in case numThousands is -1 or smaller\n\t\t\t# the first part is the ones place, the second the tens place\n\t\t\t# the second part needs to be converted back to numZeros instead of\n\t\t\t# numThousands\n # the \"- 1\" is because latinRoots[5] is 'sex', not 'quin'\n\t\t\treturn latinRoots[numThousands % 10 - 1] +\n thousandsWordOf(numThousands / 10 * 30 + 3);\n # NOTE: if numThousands >= 110 (numZeros > 333) this will be stuck in\n # infinite recursion\n\t\tend\n\n\t\treturn ''; # if none apply\n\tend\nend",
"def englishNumber number\n if number < 0 #numbers from 0-100\n return \"Please enter a number zero or greater.\"\n end\n if number > 100\n return \"Please enter a number 100 or less.\"\n end\n\n numString = \"\" #string that will be returned.\n\n#left is how much of the number left to write\n# write is part of number we are writing now\n left = number \n write = left/100 #how many hundreds left to write\n left = left - write*100 #subtract off those hundreds\n\n if write > 0\n return \"one hundred\"\n end\n\n write = left/10 # how many tens left to write\n left = left - write*10 # subtract off those tens \n\n if write > 0\n if write == 1 \n if left == 0\n numString = numString + \"ten\"\n elsif left == 1\n numString = numString + \"eleven\"\n elsif left == 2\n numString = numString + \"twelve\"\n elsif left == 3\n numString = numString + \"thirteen\"\n elsif left == 4\n numString = numString + \"fourteen\"\n elsif left == 5\n numString = numString + \"fifteen\"\n elsif left == 6\n numString = numString + \"sixteen\"\n elsif left == 7\n numString = numString + \"seventeen\"\n elsif left == 8\n numString = numString + \"eighteen\"\n elsif left == 9\n numString = numString + \"nineteen\"\n end\n\n left = 0\n elsif write == 2\n numString = numString + \"twenty\"\n elsif write == 3\n numString = numString + \"thirty\"\n elsif write == 4\n numString = numString + \"forty\"\n elsif write == 5\n numString = numString + \"fifty\"\n elsif write == 6\n numString = numString + \"sixty\"\n elsif write == 7\n numString = numString + \"seventy\"\n elsif write == 8\n numString = numString + \"eighty\"\n elsif write == 9\n numString = numString + \"ninety\"\n end\n\n if left > 0\n numString = numString + \"-\"\n end\n end\n\n write = left\n left = 0\n\n if write > 0\n if write == 1\n numString = numString + \"one\"\n elsif write == 2\n numString = numString + \"two\"\n elsif write == 3\n numString = numString + \"three\"\n elsif write == 4\n numString = numString + \"four\"\n elsif write == 5\n numString = numString + \"five\"\n elsif write == 6\n numString = numString + \"six\"\n elsif write == 7\n numString = numString + \"seven\"\n elsif write == 8\n numString = numString + \"eight\"\n elsif write == 9\n numString = numString + \"nine\"\n end\n end\n\n if numString == \"\"\n return \"zero\"\n end\n numString\nend",
"def in_words(number)\n\tzero_twenty = %w[zero one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty]\n\ttwenty_hundred = ['zero', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'one hundred']\n\treturn zero_twenty[number] if (0..20).include?(number)\n\treturn twenty_hundred[number / 10] + ' ' + zero_twenty[number % 10]\nend",
"def english_number number\n if number < 0\n return 'Please enter a number that is not negative.'\n end\n if number == 0\n return 'zero'\n end\n\n num_string = ''\n ones_place = ['one', 'two', 'three','four','five', 'six', 'seven', 'eight', 'nine']\n tens_place = ['ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\n teenagers = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sisxteen', 'seventeen', 'eighteen', 'nineteen']\n millions = [['hundred',2],['thousand', 3], ['million', 6], ['billion', 9] ]\n\nleft = number\n\nwhile millions.length > 0\n mil_pair = millions.pop\n mil_name = mil_pair[0]\n mil_base = 10 ** mil_pair[1]\n write = left/mil_base\n left = left - write * mil_base\n\n if write > 0\n prefix = english_number write\n num_string = num_string + prefix + ' ' + mil_name\n if left > 0\n num_string =num_string + ' '\n end\n end\n end\n\n\nwrite = left/10\nleft = left - write * 10\n\nif write > 0\n hundreds = english_number write\n num_string = num_string + hundreds + 'hundred'\nif left > 0\n num_string = num_string + ' '\nend\nend\nif write > 0\n if ((write == 1) and (left > 0))\n num_string = num_string + teenagers[left-1]\n left = 0\n else\n num_string = num_string + tens_place[write-1]\n end\n if left > 0\n num_string = num_string + '-'\n end\nend\nwrite = left\nleft = 0\n\nif write > 0\n num_string = num_string + ones_place[write-1]\nend\n\nnum_string\nend",
"def number_letters_count\n ones = { \n 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five',\n 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine', 10 => 'ten',\n 11 => 'eleven', 12 => 'twelve', 13 => 'thirteen', 14 => 'fourteen',\n 15 => 'fifteen', 16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen',\n 19 => 'nineteen' \n }\n \n tens = { \n 20 => 'twenty', 30 => 'thirty', 40 => 'forty', 50 => 'fifty', 60 => 'sixty', \n 70 => 'seventy', 80 => 'eighty', 90 => 'ninety' \n }\n\n (1..1000).to_a.map do |num|\n digits = num.to_s.chars.map(&:to_i)\n if num < 20\n num = ones[num]\n elsif num >= 20 && num < 100\n if digits[1] == 0\n num = tens[digits[0] * 10]\n else \n num = tens[digits[0] * 10] + ' ' + ones[digits[1]]\n end\n elsif num >= 100 && num < 1000\n if digits[1] == 0 && digits[2] == 0\n num = ones[digits[0]] + ' hundred'\n elsif digits[1] == 0 && digits[2] != 0\n num = ones[digits[0]] + ' hundred' + ' and ' + ones[digits[2]]\n elsif ones.include? digits[1..2].join.to_i\n num = ones[digits[0]] + ' hundred' + ' and ' + ones[digits[1..2].join.to_i]\n elsif digits[1] != 0 && digits[2] == 0\n num = ones[digits[0]] + ' hundred' + ' and ' + tens[digits[1] * 10]\n elsif digits[1] != 0 && digits[2] != 0\n num = ones[digits[0]] + ' hundred' + ' and ' + tens[digits[1] * 10] + ' ' + ones[digits[2]]\n end\n elsif num == 1000\n num = 'one thousand'\n end\n end.map { |word| word.gsub(' ', '') }.join.length\nend",
"def make_words(n)\n\n\nn_string = n.to_s\n\n\nsingles = {\n \"1\" => \"one\",\n \"2\" => \"two\",\n \"3\" => \"three\",\n \"4\" => \"four\",\n \"5\" => \"five\",\n \"6\" => \"six\",\n \"7\" => \"seven\",\n \"8\" => \"eight\",\n \"9\" => \"nine\",\n }\n\n\ntens = {\n \"2\" => \"twenty\",\n \"3\" => \"thirty\",\n \"4\" => \"forty\",\n \"5\" => \"fifty\",\n \"6\" => \"sixty\",\n \"7\" => \"seventy\",\n \"8\" => \"eighty\",\n \"9\" => \"ninety\",\n }\n\n if n_string.length == 1\n\n puts singles[n_string]\n\n elsif n_string == \"10\"\n p \"TEN!\"\n\n elsif n_string == \"11\"\n p \"eleven\"\n\n elsif n_string == \"12\"\n p \"twelve\"\n\n elsif n_string == \"13\"\n p \"thirteen\"\n\n elsif n_string == \"14\"\n p \"fourteen\"\n\n elsif n_string == \"15\"\n p \"fifeteen\"\n\n elsif n_string == \"16\"\n p \"sixteen\"\n\n elsif n_string == \"17\"\n p \"seventeen\"\n\n elsif n_string == \"18\"\n p \"eighteen\"\n\n elsif n_string == \"19\"\n p \"nineteen\"\n\n\n\n elsif n_string.length == 2\n array = n_string.split(//)\n\n if array[1] == \"0\"\n p tens[array[0]]\n\n else\n p tens[array[0]] + singles[array[1]]\n\n end\n\n else n_string.length == 3\n p \"ONE HUNDRED!\"\n\n end\nend",
"def to_words\n if is_a? Integer\n num = self\n else\n num = self.to_i\n end\n\n if (n = num.to_s.size) > 102\n return \"more than a googol! (#{n} digits)\"\n end\n\n whole_thing = []\n\n triplets = num.commatize.split(',')\n num_triplets = triplets.size\n\n triplets.each_with_index do |triplet, i|\n next if triplet.to_i == 0\n\n result = []\n\n tens, hunds = nil, nil\n\n digits = triplet.chars.to_a\n\n raise \"Error: Not a triplet: #{triplet}\" if digits.size > 3 or digits.size < 1\n\n if digits.size == 3\n digit = digits.shift.to_i\n hunds = NAMES_SMALL[digit] + \"-hundred\" if digit > 0\n digits.shift if digits.first == '0'\n end\n\n if digits.size == 2\n n = digits.join('').to_i\n\n if n > 0 and n < 20\n tens = NAMES_SMALL[n]\n elsif n > 0\n tens = NAMES_MEDIUM[digits.shift.to_i - 2]\n if digits.first != '0'\n tens += \"-\" + NAMES_SMALL[digits.shift.to_i]\n else\n digits.shift\n end\n end\n end\n\n if digits.size == 1\n n = digits.join('').to_i\n tens = NAMES_SMALL[n] if n > 0\n end\n\n if hunds\n if tens\n result << \"#{hunds} and #{tens}\"\n else\n result << hunds\n end\n else\n result << tens if tens\n end\n\n magnitude = (num_triplets - i)\n result << NAMES_LARGE[magnitude-2] if magnitude > 1\n\n whole_thing << result.join(' ') if result.any?\n end\n\n whole_thing.join ', '\n end",
"def in_words(int)\n numbers_to_name = {\n 1000000 => \"million\",\n 1000 => \"thousand\",\n 100 => \"hundred\",\n 90 => \"ninety\",\n 80 => \"eighty\",\n 70 => \"seventy\",\n 60 => \"sixty\",\n 50 => \"fifty\",\n 40 => \"forty\",\n 30 => \"thirty\",\n 20 => \"twenty\",\n 19=>\"nineteen\",\n 18=>\"eighteen\",\n 17=>\"seventeen\",\n 16=>\"sixteen\",\n 15=>\"fifteen\",\n 14=>\"fourteen\",\n 13=>\"thirteen\",\n 12=>\"twelve\",\n 11 => \"eleven\",\n 10 => \"ten\",\n 9 => \"nine\",\n 8 => \"eight\",\n 7 => \"seven\",\n 6 => \"six\",\n 5 => \"five\",\n 4 => \"four\",\n 3 => \"three\",\n 2 => \"two\",\n 1 => \"one\"\n }\n str = \"\"\n numbers_to_name.each do |num, name|\n if int == 0\n return str\n elsif int.to_s.length == 1 && int/num > 0\n return str + \"#{name}\"\n elsif int < 100 && int/num > 0\n return str + \"#{name}\" if int%num == 0\n return str + \"#{name} \" + in_words(int%num)\n elsif int/num > 0\n return str + in_words(int/num) + \" #{name} \" + in_words(int%num)\n end\n end\n end",
"def to_english(number)\nsingle_digits = {\n 0 => \"zero\",\n 1 => \"one\",\n 2 => \"two\",\n 3 => \"three\",\n 4 => \"four\",\n 5 => \"five\",\n 6 => \"six\",\n 7 => \"seven\",\n 8 => \"eight\",\n 9 => \"nine\"\n }\n teens = {\n \"zero\" => \"ten\",\n \"one\" => \"eleven\",\n \"two\" => \"twelve\",\n \"three\" => \"thirteen\",\n \"four\" => \"fourteen\",\n \"five\" => \"fifteen\",\n \"six\" => \"sixteen\",\n \"seven\" => \"seventeen\",\n \"eight\" => \"eighteen\",\n \"nine\" => \"nineteen\"\n }\n tens = {\n 0 => \"zero\",\n 2 => \"twenty\",\n 3 => \"thirty\",\n 4 => \"forty\",\n 5 => \"fifty\",\n 6 => \"sixty\",\n 7 => \"seventy\",\n 8 => \"eighty\",\n 9 => \"ninety\"\n }\n\nif number.to_i == 0\n puts \"zero\"\nelse\n\neach_number = number.to_s.split(\"\").reverse\n\neach_number.each_with_index do |n, i|\n if i == 0 || i == 2 || i == 3 || i == 5 || i == 6 || i == 8 || i == 9\n each_number[i].replace(single_digits.fetch(each_number[i].to_i))\n elsif i == 1 && n != \"1\"\n each_number[i].replace(tens.fetch(each_number[i].to_i))\n elsif i == 1 && n == \"1\"\n each_number[i - 1].replace(teens.fetch(each_number[i - 1]))\n each_number[i].replace(\"zero\")\n elsif i == 4 && n != \"1\"\n each_number[i].replace(tens.fetch(each_number[i].to_i))\n elsif i == 4 && n == \"1\"\n each_number[i - 1].replace(teens.fetch(each_number[i - 1]))\n each_number[i].replace(\"zero\")\n elsif i == 7 && n != \"1\"\n each_number[i].replace(tens.fetch(each_number[i].to_i))\n elsif i == 7 && n == \"1\"\n each_number[i - 1].replace(teens.fetch(each_number[i - 1]))\n each_number[i].replace(\"zero\")\n end\nend\n\neach_number.each_with_index do |n, i|\n if i == 2\n each_number[i] = n + \" hundred\"\n elsif i == 3\n each_number[i] = n + \" thousand\"\n elsif i == 4 && each_number[i - 1].match?(/zero/)\n each_number[i] = n + \" thousand\"\n elsif i == 5 \n if each_number[i - 1].match?(/zero/) && each_number[i - 2].match?(/zero/)\n each_number[i] = n + \" hundred thousand\"\n else \n each_number[i] = n + \" hundred\"\n end\n elsif i == 6\n each_number[i] = n + \" million\"\n elsif i == 7 && each_number[i - 1].match?(/zero/)\n each_number[i] = n + \" million\"\n elsif i == 8\n if each_number[i - 1].match?(/zero/) && each_number[i - 2].match?(/zero/)\n each_number[i] = n + \" hundred million\"\n else \n each_number[i] = n + \" hundred\"\n end\n elsif i == 9\n each_number[i] = n + \" billion\"\n end\nend\n\ni = 0\nuntil i == each_number.length\n if each_number[i].match?(/zero/)\n each_number.delete_at(i)\n else\n i += 1\n end\nend\n\nputs each_number.reverse.join(\" \")\n\nend\n\nend",
"def in_words(givenNumber)\n\t\tstr = \"\"\n\t\tgivenNumber = givenNumber.abs\n\n\t \t# for unique numbers, returns from hash\n\t \tif number_words.has_key?(givenNumber)\n\t \treturn number_words[givenNumber];\n\t \tend\n\n\t\tnumber_words.each do |num, name|\n\t\t if givenNumber == 0\n\t\t return str\n\t\t elsif givenNumber < 100 && givenNumber/num > 0\n\t\t return str + \"#{name}\" if givenNumber% num == 0\n\t\t return str + \"#{name} \" + in_words(givenNumber%num)\n\t\t elsif givenNumber/num > 0 #Just kept it for future use. if givenNumber>100\n\t\t return str + in_words(givenNumber/num) + \" #{name} \" + in_words(givenNumber%num)\n\t\t end\n\t\tend\n\tend",
"def find_hundreds (n)\n words =\"\"\n num_words = Hash.new(0)\n num_words = {1=>\"One\",2=>\"Two\",3=>\"Three\",4=>\"Four\",5=>\"Five\",6=>\"Six\",7=>\"Seven\",8=>\"Eight\",9=>\"Nine\",10=>\"Ten\",11=>\"Eleven\",12=>\"Twelve\",13=>\"Thirteen\",14=>\"Fourteen\",15=>\"Fifteen\",16=>\"Sixteen\",17=>\"Seventeen\",18=>\"Eighteen\",19=>\"Nineteen\",20=>\"Twenty\",30=>\"Thirty\",40=>\"Fourty\",50=>\"Fifty\",60=>\"Sixty\",70=>\"Seventy\",80=>\"Eighty\",90=>\"Ninety\"}\n\n if n/100 > 0\n # Append the String you get to the string that holds the words\n words = num_words[n/100] +\" Hundred \"\n if n%10 !=0\n words= words + \"and \"\n end\n n=n%100\n end\n\n if n/10 > 0\n if n/10 == 1\n words = words+num_words[n]+ \" \"\n elsif n%10 == 0\n words = words +num_words[n]\n else\n words = words +num_words[n/10*10] +\" \"+ num_words[n%10]\n end\n elsif n == 0\n words\n else\n words = words +num_words[n]\n end\n words\nend",
"def the3(number)\n english = ''\n digits = {'0' => '', '1' => 'one', '2' => 'two', '3' => 'three', '4' => 'four', '5' => 'five',\n '6' => 'six', '7' => 'seven', '8' => 'eight', '9' => 'nine'}\n for i in 0..2\n case i\n when 0 then english += digits[number[i]] + (number[i] == '0' ? '' : ' hundred ')\n when 1 then english += number[i] == '0' ? '' : the2(number[1..2])\n when 2 then english += number[i - 1] == '1' ? '' : digits[number[i]]\n end\n end\n return english\nend",
"def say_it_in_english_please(number)\n\n\tnumber_array = number.to_s.split(\"\") #split the number into separate digits\n\n\tarray_length = number_array.length \n\n\tnumber_array.each do |x|\n\t\n\t\tif array_length == 1\n\t\t\tif x == \"1\"\n\t\t\t\tputs \"One\"\n\t\t\telsif x == \"2\"\n\t\t\t\tputs \"Two\"\n\t\t\telsif x == \"3\"\n\t\t\t\tputs \"Three\"\n\t\t\telsif x == \"4\"\n\t\t\t\tputs \"Four\"\n\t\t\telsif x == \"5\"\n\t\t\t\tputs \"Five\"\n\t\t\telsif x == \"6\"\n\t\t\t\tputs \"Six\"\n\t\t\telsif x == \"7\" \n\t\t\t\tputs \"Seven\"\n\t\t\telsif x == \"8\"\n\t\t\t\tputs \"Eight\"\n\t\t\telsif x == \"9\"\n\t\t\t\tputs \"Nine\"\n\t\t\tend #finished 1-digit length loop\n\n\t\telsif array_length == 2\n\t\t\tif x == \"1\" && x+1 == \"2\"\n\t\t\t\tputs \"Twelve\"\n\t\t\tend\n\n\t\telse #meaning 3-digit number\n\t\t\tputs \"One-Hundred\"\n\t\tend #finishes the array_length if statement\n\n\tend #finished the do statement\n\n\nend",
"def textify(number)\n return UNITS[number] if number < UNITS.length\n\n tens, units = number.divmod(10)\n hundreds, tens = tens.divmod(10)\n\n out = ''\n out << \"#{UNITS[hundreds]} hundred \" if hundreds > 0\n out << \"#{TENS[tens]}\" if tens > 0 && number >= 20\n out << \"-\" if tens > 0 && units > 0\n out << \"#{UNITS[units]}\" if units > 0\n out.strip\n end",
"def beyond100_en(number)\n return \"#{number}th\" if tens_digit_is_a_one(number)\n\n case number % 10\n when 0, 4, 5, 6, 7, 8, 9\n \"#{number}th\"\n when 1\n \"#{number}st\"\n when 2\n \"#{number}nd\"\n when 3\n \"#{number}rd\"\n end\n end",
"def englishNumber remaining_number\n if remaining_number == 0\n return 'zero'\n end\n number_string = remaining_number < 0 ? \"negative \" : \"\"\n remaining_number = remaining_number.abs\n\n #build arrays\n onesPlace = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']\n tensPlace = ['ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']\n teenagers = ['eleven','twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']\n million_billion = [[100,\"hundred\"]]\n big_array = [\"thousand\",\"million\",\"billion\",\"trillion\",\"quadrillion\",\"quintillion\",\"sextillion\",\"septillion\",\"octillion\",\"nonillion\",\"decillion\",\"undecillion\",\"duodecillion\",\"tredecillion\",\"quattuordecillion\",\"quindecillion\",\"sexdecillion\",\"septendecillion\",\"octodecillion\",\"novemdecillion\",\"vigintillion\",\"unvigintillion\",\"duovigintillion\",\"trevigintillion\",\"quattuorvigintillion\",\"quinvigintillion\",\"sexvigintillion\",\"septenvigintillion\",\"octovigintillion\",\"novemvigintillion\",\"trigintillion\",\"untrigintillion\",\"duotrigintillion\",\"tretrigintillion\",\"quattuortrigintillion\",\"quintrigintillion\",\"sextrigintillion\",\"septentrigintillion\",\"octotrigintillion\",\"novemtrigintillion\",\"quadragintillion\",\"unquadragintillion\",\"duoquadragintillion\",\"trequadragintillion\",\"quattuorquadragintillion\",\"quinquadragintillion\",\"sexquadragintillion\",\"septenquadragintillion\",\"octoquadragintillion\",\"novemquadragintillion\",\"quinquagintillion\",\"unquinquagintillion\",\"duoquinquagintillion\",\"trequinquagintillion\",\"quattuorquinquagintillion\",\"quinquinquagintillion\",\"sexquinquagintillion\",\"septenquinquagintillion\",\"octoquinquagintillion\",\"novemquinquagintillion\",\"sexagintillion\",\"unsexagintillion\",\"duosexagintillion\",\"tresexagintillion\",\"quattuorsexagintillion\",\"quinsexagintillion\",\"sexsexagintillion\",\"septensexagintillion\",\"octosexagintillion\",\"novemsexagintillion\",\"septuagintillion\",\"unseptuagintillion\",\"duoseptuagintillion\",\"treseptuagintillion\",\"quattuorseptuagintillion\",\"quinseptuagintillion\",\"sexseptuagintillion\",\"septenseptuagintillion\",\"octoseptuagintillion\",\"novemseptuagintillion\",\"octogintillion\",\"unoctogintillion\",\"duooctogintillion\",\"treoctogintillion\",\"quattuoroctogintillion\",\"quinoctogintillion\",\"sexoctogintillion\",\"septenoctogintillion\",\"octooctogintillion\",\"novemoctogintillion\",\"nonagintillion\",\"unnonagintillion\",\"duononagintillion\",\"trenonagintillion\",\"quattuornonagintillion\",\"quinnonagintillion\",\"sexnonagintillion\",\"septennonagintillion\",\"octononagintillion\",\"novemnonagintillion\",\"centillion\"]\n big_array.each_with_index do |array_words,index|\n million_billion << [1000 ** (index + 1),array_words]\n end\n\n #bignums\n million_billion.reverse_each do |array_number,array_words|\n currently_writing = remaining_number/array_number\n remaining_number -= currently_writing * array_number\n if currently_writing > 0\n number_string += englishNumber(currently_writing) + ' ' + array_words\n if remaining_number > 0\n number_string += ' '\n end\n end\n end\n #tens\n currently_writing = remaining_number/10\n remaining_number -= currently_writing*10\n if currently_writing > 0\n if ((currently_writing == 1) and (remaining_number > 0))\n number_string += teenagers [remaining_number-1]\n remaining_number = 0\n else\n number_string += tensPlace[currently_writing-1]\n end\n if remaining_number > 0\n number_string += '-'\n end\n end\n #ones\n number_string += onesPlace [remaining_number-1] if remaining_number > 0\n number_string\nend",
"def englishNumber(number)\n\tnumber_as_string = \"\" #this is the string we will return\n\tif number == 0\n\t\tnumber_as_string = \"zero\"\n\telsif number == 100\n\t\tnumber_as_string = \"one hundred\"\n\telsif \n\t\t#take care of 1-10\n\t\t#take care of 11-19\n\t\t#take care of 20,30,40,50,60,70,80,90\n\telse\n\t\tnumber_as_string = \"You didn't give me a number between 0 and 100\"\n\tend\n\t\t\n\n\treturn number_as_string\nend",
"def number_to_words( num, config )\n\t\treturn [config[:zero]] if num.to_i.zero?\n\t\tchunks = []\n\n\t\t# Break into word-groups if groups is set\n\t\tif config[:group].nonzero?\n\n\t\t\t# Build a Regexp with <config[:group]> number of digits. Any past\n\t\t\t# the first are optional.\n\t\t\tre = Regexp::new( \"(\\\\d)\" + (\"(\\\\d)?\" * (config[:group] - 1)) )\n\n\t\t\t# Scan the string, and call the word-chunk function that deals with\n\t\t\t# chunks of the found number of digits.\n\t\t\tnum.to_s.scan( re ) {|digits|\n\t\t\t\tdebug_msg \" digits = #{digits.inspect}\"\n\t\t\t\tfn = NumberToWordsFunctions[ digits.size ]\n\t\t\t\tnumerals = digits.flatten.compact.collect {|i| i.to_i}\n\t\t\t\tdebug_msg \" numerals = #{numerals.inspect}\"\n\t\t\t\tchunks.push fn.call( config[:zero], *numerals ).strip\n\t\t\t}\n\t\telse\n\t\t\tphrase = num.to_s\n\t\t\tphrase.sub!( /\\A\\s*0+/, '' )\n\t\t\tmill = 0\n\n\t\t\t# Match backward from the end of the digits in the string, turning\n\t\t\t# chunks of three, of two, and of one into words.\n\t\t\tmill += 1 while\n\t\t\t\tphrase.sub!( /(\\d)(\\d)(\\d)(?=\\D*\\Z)/ ) {\n\t\t\t\t\twords = to_hundreds( $1.to_i, $2.to_i, $3.to_i, mill, \n\t\t\t\t\t\t\t\t\t\t config[:and] )\n\t\t\t\t\tchunks.unshift words.strip.squeeze(' ') unless words.nil?\n\t\t\t\t\t''\n\t\t\t\t}\t\t\t\t\n\n\t\t\tphrase.sub!( /(\\d)(\\d)(?=\\D*\\Z)/ ) {\n\t\t\t\tchunks.unshift to_tens( $1.to_i, $2.to_i, mill ).strip.squeeze(' ')\n\t\t\t\t''\n\t\t\t}\n\t\t\tphrase.sub!( /(\\d)(?=\\D*\\Z)/ ) {\n\t\t\t\tchunks.unshift to_units( $1.to_i, mill ).strip.squeeze(' ')\n\t\t\t\t''\n\t\t\t}\n\t\tend\n\n\t\treturn chunks\n\tend",
"def weddingNumber number\n\tif number < 0 # No negative numbers.\n\t\treturn \"Please enter the year you were married.\"\n\tend\n\tif number == 0\n\t\treturn 'zero'\n\tend\n\n\t# No more sepcial cases! No more returns!\n\n\tnumString = \"\" # This is the string we will return.\n\n\tonesPlace = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight',\n 'nine']\n\ttensPlace = ['ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy',\n 'eighty', 'ninety']\n\tteenagers = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen',\n 'seventeen', 'eighteen', 'nineteen']\n\n\t# \"left\" is how much of the number we still have left to write out.\n\t# \"write\" is the part we are writing out right now.\n\n\tleft = number\n\n\twrite = left / 1000 # How many thousands left to write out?\n\tleft = left - write * 1000 # Subtract off those thousands.\n\n\tif write > 0\n\t\t# Using recurrence to call back the original method\n\t\tthousands = weddingNumber write\n\t\tnumString = numString + thousands + \" thousand\"\n\t\tif left > 0\n\t\t\t# So we don't write 'two thousandfifty-one'\n\t\t\tnumString = numString + \" and \"\n\t\tend\n\tend\n\n\twrite = left / 100 # How many hundreds left to write out?\n\tleft = left - write * 100 # Subtract off those hundreds.\n\n\tif write > 0\n\t\t# Using recurrence to call back the original method\n\t\thundreds = weddingNumber write\n\t\tnumString = numString + hundreds + \" hundred\"\n\t\tif left > 0\n\t\t\t# So we don't write 'two hundredfifty-one'...\n\t\t\tnumString = numString + \" and \"\n\t\tend\n\tend\n\n\twrite = left / 10 # How many tens left to write out?\n\tleft = left - write * 10 # Subtract off those tens.\n\n\tif write > 0\n\t\tif ((write == 1) and (left > 0))\n\t\t\t# Since we can't write 'tenty-two' instead of 'twelve',\n\t\t\t# we have to make a special exception for these.\n\t\t\tnumString = numString + teenagers[left - 1]\n\t\t\t# The \"-1\" is because teenagers[3] is 'fourteen', not 'thirteen'\n\t\t\t# Since we took care of the digit in the ones place already,\n\t\t\t# we have nothing left to write\n\t\t\tleft = 0\n\t\telse\n\t\t\tnumString = numString + tensPlace[write - 1]\n\t\t\t# The \"-1\" is because tensPlace[3] is 'forty', not 'thirty'\n\t\tend\n\n\t\tif left > 0\n\t\t\t# So we don't write 'sixtyfour'...\n\t\t\tnumString = numString + \" and \"\n\t\tend\n\tend\n\n\twrite = left # How many ones left to write out?\n\tleft = 0 # Subtract off those ones.\n\n\tif write > 0\n\t\tnumString = numString + onesPlace[write - 1]\n\t\t# The \"-1\" is because onesPlace[3] is 'four', not 'three'.\n\tend\n\n\t# Now we just return \"numString\n\tnumString\nend",
"def word(number)\n if number < 20\n return specific_word(number)\n else\n return two_digit(number)\n end\nend",
"def convert_hundred(val)\n\t\tif val < 19\n\t\t\t@@english_numeral += \"#{BASIC_MAP[val]}\" + ' ' \n\n\t\telse\n\t\t\tnum1 = val%10\n\t\t\tnum2 = val-num1\n\n\t\t\t@@english_numeral += \"#{BASIC_MAP[num2]}\" + ' ' + \"#{BASIC_MAP[num1]}\" + ' '\n\t\tend\n\tend",
"def num_to_word(number)\n\n\n\n\n# Refactored Solution\n\n\n\n\n\n\n# Reflection",
"def handle_hundred (num)\n num2str=''\n if (num%100==0)\n num2str+=NUM_MAP[num/100]+ ' '+ NUM_MAP[100]\n elsif (num%100>=10 && num%100 <= 99)\n num2str+=NUM_MAP[num/100]+ ' '+ NUM_MAP[100]+ ' ' +handle_ten(num%100)\n elsif (num%100>=1 && num%100 <= 9)\n num2str+=NUM_MAP[num/100]+ ' '+ NUM_MAP[100]+ ' ' +handle_bit(num%100)\n end\n return num2str\nend",
"def simple_number_to_words(number)\n I18n.t(\"spell_number.numbers.number_#{number}\", :locale => @options[:locale], :default => 'not_found')\n end",
"def number_to_words_hash\n num_hash = Hash.new\n num_hash[0] = \"zero\"\n num_hash[1] = \"one\"\n num_hash[2] = \"two\"\n num_hash[3] = \"three\"\n num_hash[4] = \"four\"\n num_hash[5] = \"five\"\n num_hash[6] = \"six\"\n num_hash[7] = \"seven\"\n num_hash[8] = \"eight\"\n num_hash[9] = \"nine\"\n num_hash[10] = \"ten\"\n num_hash[11] = \"eleven\"\n num_hash[12] = \"twelve\"\n num_hash[13] = \"thirteen\"\n num_hash[14] = \"fourteen\"\n num_hash[15] = \"fifteen\"\n num_hash[16] = \"sixteen\"\n num_hash[17] = \"seventeen\"\n num_hash[18] = \"eighteen\"\n num_hash[19] = \"nineteen\"\n num_hash[20] = \"twenty\"\n num_hash[30] = \"thirty\"\n num_hash[40] = \"forty\"\n num_hash[50] = \"fifty\"\n num_hash[60] = \"sixty\"\n num_hash[70] = \"seventy\"\n num_hash[80] = \"eighty\"\n num_hash[90] = \"ninety\"\n \n return num_hash\nend",
"def translate(n)\n\t\t# create word arrays\n\t\ttens = %w(. . twenty thirty forty fifty sixty seventy eighty ninety)\n\t\tteens = %w(ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen)\n\t\tones = %w(zero one two three four five six seven eight nine ten)\n\n\t\t# double digits\n\t\t# selects the correct string index from the word arrays based on the number\n\t\tif n >= 20 then\n\t\t\tstr = tens[n/10].capitalize\n\t\t\tif n % 10 != 0\n\t\t\t\tstr << \"-\" \n\t\t\t\tstr << ones[n%10]\n\t\t\tend\n\t\t\treturn str\n\t\tend\n\n\t\tif n >= 10 && n <= 19 then\n\t\t\treturn teens[n%10].capitalize\n\t\tend\n\n\t\t# single digits\n\t\tif n <= 9 then\n\t\t\tones[n].capitalize\n\t\tend\n\tend",
"def convert_to_english(num, add_and = false)\n \n numparts = []\n hundreds = (num - (num % 100)) / 100\n \n num -= hundreds * 100\n\n if hundreds > 0\n numparts.push \"#{NAMEMAP[hundreds]} hundred\"\n numparts.push \"and\" if add_and\n end\n\n return numparts.first if num == 0\n\n tens = TENS.find { |i| num - i < 10 }\n ones = num - tens\n\n if tens == 10\n ones = num\n tens = 0\n end\n\n # numparts.push tens > 0 ? \"#{NAMEMAP[tens]}-#{NAMEMAP[ones]}\" : NAMEMAP[ones]\n\n tt = [\n tens > 0 ? NAMEMAP[tens] : nil,\n ones > 0 ? NAMEMAP[ones] : nil\n ].compact.join('-')\n \n numparts.push tt\n\n numparts.join(' ')\n end",
"def spell(n)\n result = \"\"\n remaining = n\n \n while (remaining > 0) \n result.insert(0, lookup(remaining % 10).concat(\" \"))\n remaining = remaining / 10\n end\n \n return result\nend",
"def in_words(integer)\n nums_to_words = {\n 1 => \"one\",\n 2 => \"two\",\n 3 => \"three\",\n 4 => \"four\",\n 5 => \"five\",\n 6 => \"six\",\n 7 => \"seven\",\n 8 => \"eight\",\n 9 => \"nine\",\n 10 => \"ten\",\n 11 => \"eleven\",\n 12 => \"twelve\",\n 13 => \"thirteen\",\n 14 => \"fourteen\",\n 15 => \"fifteen\",\n 16 => \"sixteen\",\n 17 => \"seventeen\",\n 18 => \"eighteen\",\n 19 => \"nineteen\",\n 20 => \"twenty\",\n 30 => \"thirty\",\n 40 => \"fourty\",\n 50 => \"fifty\",\n 60 => \"sixty\",\n 70 => \"seventy\",\n 80 => \"eighty\",\n 90 => \"ninety\",\n 100 => \"one hundred\"\n }\n \n if nums_to_words.include? (integer)\n p nums_to_words[integer]\n elsif\n int_arr = integer.to_s.chars\n second_word = int_arr.pop.to_i\n first_word = int_arr.push(\"0\").join.to_i\n p nums_to_words[first_word] + \" \" + nums_to_words[second_word]\n end\nend",
"def solution(n)\r\n unit = UNITS[n % 10]\r\n dozen = DOZENS[(n % 100) / 10]\r\n hundred = HUNDREDS[(n % 1000) / 100]\r\n thousand = THOUSAND * (n / 1000)\r\n [thousand, hundred, dozen, unit].join\r\nend",
"def nums_to_words_ones(number)\n case number\n when 1\n puts \"one\"\n when 2\n puts \"two\"\n when 3\n puts \"three\"\n when 4\n puts \"four\"\n when 5\n puts \"five\"\n when 6\n puts \"six\"\n when 7\n puts \"seven\"\n when 8\n puts \"eight\"\n when 9\n puts \"nine\"\n when 10\n puts \"ten\"\n when 11\n puts \"eleven\"\n when 12\n puts \"twelve\"\n when 13\n puts \"thirteen\"\n when 14\n puts \"fourteen\"\n when 15\n puts \"fifteen\"\n when 16\n puts \"sixteen\"\n when 17\n puts \"seventeen\"\n when 18\n puts \"eighteen\"\n when 19\n puts \"nineteen\"\n end\n puts\nend",
"def n2e(num)\n\n return '' if num.kind_of?(String) and (num =~ /^[0]+$/)\n return '' if num.kind_of?(String) and (num !~ /^\\d+$/)\n \n num = num.to_i if num.kind_of?(String)\n n = num.to_s.split(//)\n len = n.size\n \n # To create constance inside a function, we need to use instance\n # variables. Ruby 1.9 is very picky about this subject!\n\n @Hundred = 'hundred'\n @Thousand= 'thousand'\n @Million = 'million'\n @Billion = 'billion'\n\n h = { :ones => %w(zero one two three four five six seven\n eight nine ten eleven twelve thirteen\n fourteen fifteen sixtee seventeen eigthteen\n nineteen),\n :twos => %w(nil ten twenty thirty forty fifty sixty \n seventy eighty ninety)\n }\n\n if num < 20\n str = h[:ones][num] \n elsif len == 2\n str = (n[0] > \"1\") ? h[:twos][n[0].to_i] : h['tens'][n[0].to_i-1] \n str += (n[1] > \"0\" ) ? (' ' + h[:ones][n[1].to_i]) : ''\n elsif len == 3\n str = n2e(n[0])+' '+@Hundred+' '+ n2e(n[1]+n[2])\n elsif len == 4\n str = n2e(n[0])+' '+@Thousand+' '+ n2e(n[1]+n[2]+n[3])\n elsif len == 5 \n str = n2e(n[0]+n[1])+' '+ @Thousand +' '\n str += n2e(n[2]+n[3]+n[4])\n elsif len == 6 \n str = n2e(n[0]+n[1]+n[2])+' '+ @Thousand +' '\n str += n2e(n[3]+n[4]+n[5])\n elsif len == 7 \n str = h[:ones][n[0].to_i]+' '+@Million+' '\n str += n2e(n[1]+n[2]+n[3]+n[4]+n[5]+n[6])\n elsif len == 8 \n str = n2e(n[0]+n[1])+' '+ @Million + ' '\n str += n2e(n[2]+n[3]+n[4]+n[5]+n[6]+n[7])\n elsif len == 9 \n str = n2e(n[0]+n[1]+n[2])+' '+ @Million + ' '\n str += n2e(n[3]+n[4]+n[5]+n[6]+n[7]+n[8])\n elsif len == 10 \n str = h[:ones][n[0].to_i]+' '+@Billion+' '\n str += n2e(n[1]+n[2]+n[3]+n[4]+n[5]+n[6]+n[7]+n[8]+n[9])\n elsif len == 11 \n str = n2e(n[0]+n[1])+' '+@Billion+' '\n str += n2e(n[2]+n[3]+n[4]+n[5]+n[6]+n[7]+n[8]+n[9]+n[10])\n elsif len == 12 \n str = n2e(n[0]+n[1]+n[2])+' '+@Billion+' '\n str += n2e(n[3]+n[4]+n[5]+n[6]+n[7]+n[8]+n[9]+n[10]+n[11])\n else\n abort(\"Number Overflow\\n\")\n end\n return str\nend",
"def numberInWords (numVal)\n\t\ttotalNoOfDigits = (numVal.to_i.to_s).length\n\t\tquad = numVal.to_i\n\t\tnumValStr = \"\"\n\t\twhile quad > 0 do\n\t\t\tquadDigits = (quad.to_s).length\n\t\t\tcurrentUnit = 10 ** (totalNoOfDigits - quadDigits)\n\t\t\tcurrStr = nil\n\t\t\tcurrStr = getThreeDigitNumberStr((quad%1000))\n\t\t\tquad = quad/1000\n\t\t\tunless currStr.blank?\n\t\t\t\tcurrStr = currStr + \" \" + (currentUnit == 1 ? \"\" : getNumberAsStr[currentUnit])\n\t\t\t\tnumValStr = numValStr.blank? || currStr.blank? ? currStr + numValStr : currStr + \"\" + numValStr\n\t\t\tend\n\t\tend\n\t\tnumValStr.lstrip.capitalize\n\tend",
"def translate(n)\n if 0 <= n && n <= 19 #for all n between 0 and 19, we output the following (here n is used as the index for the output)\n %w(zero one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen)[n]\n elsif n % 10 == 0 #if they are divisible by 10, we output the following (n/10 is used as the index for the output)\n %w(zero ten twenty thirty forty fifty sixty seventy eighty ninety)[n/10]\n else #for all n that don't satisfy the above two conditions (i.e. between the tens and more than 20)\n \"#{translate n/10*10}-#{translate n%10}\".downcase\n end.capitalize\n end",
"def to_en(number)\n return number.to_s unless number.is_a?(Integer)\n case number\n when 1\n \"one\"\n when 2\n \"two\"\n when 3\n \"three\"\n when 4\n \"four\"\n when 5\n \"five\"\n when 6\n \"six\"\n when 7\n \"seven\"\n when 8\n \"eight\"\n when 9\n \"nine\"\n when 10\n \"ten\"\n when 11\n \"eleven\"\n when 12\n \"twelve\"\n when 13\n \"thirteen\"\n when 14\n \"fourteen\"\n when 15\n \"fifteen\"\n when 16\n \"sixteen\"\n when 17\n \"seventeen\"\n when 18\n \"eighteen\"\n when 19\n \"nineteen\"\n when 20\n \"twenty\"\n when 30\n \"thirty\"\n when 40\n \"forty\"\n when 50\n \"fifty\"\n when 60\n \"sixty\"\n when 70\n \"seventy\"\n when 80\n \"eighty\"\n when 90\n \"ninety\"\n when 21 .. 99\n x_one = number % 10\n x_ten = number - x_one\n to_en(x_ten) + \"-\" + to_en(x_one)\n when 100 .. 999\n front_num = number / 100\n rear_num = number % 100\n if rear_num == 0\n to_en(front_num) + \" hundred\"\n else\n to_en(front_num) + \" hundred and \" + to_en(rear_num)\n end\n when 1e3 .. 999999\n front_num = number / 1000\n rear_num = number % 1000\n if rear_num == 0\n to_en(front_num) + \" thousand\"\n else\n to_en(front_num) + \" thousand and \" + to_en(rear_num)\n end\n else\n number.to_s\n end\n end",
"def number_words\n { 10 => 'Ten', 9 => 'Nine', 8 => 'Eight', 7 => 'Seven', 6 => 'Six', 5 => 'Five', 4 => 'Four', 3 => 'Three', 2 => 'Two', 1 => 'One' }\nend",
"def numwords( number, hashargs={} )\n\t\tnum = number.to_s\n\t\tconfig = NumwordDefaults.merge( hashargs )\n\t\traise \"Bad chunking option: #{config[:group]}\" unless\n\t\t\tconfig[:group].between?( 0, 3 )\n\n\t\t# Array of number parts: first is everything to the left of the first\n\t\t# decimal, followed by any groups of decimal-delimted numbers after that\n\t\tparts = []\n\n\t\t# Wordify any sign prefix\n\t\tsign = (/\\A\\s*\\+/ =~ num) ? 'plus' : (/\\A\\s*\\-/ =~ num) ? 'minus' : ''\n\n\t\t# Strip any ordinal suffixes\n\t\tord = true if num.sub!( /(st|nd|rd|th)\\Z/, '' )\n\n\t\t# Split the number into chunks delimited by '.'\n\t\tchunks = if !config[:decimal].empty? then\n\t\t\t\t\t if config[:group].nonzero?\n\t\t\t\t\t\t num.split(/\\./)\n\t\t\t\t\t else\n\t\t\t\t\t\t num.split(/\\./, 2)\n\t\t\t\t\t end\n\t\t\t\t else\n\t\t\t\t\t [ num ]\n\t\t\t\t end\n\n\t\t# Wordify each chunk, pushing arrays into the parts array\n\t\tchunks.each_with_index {|chunk,section|\n\t\t\tchunk.gsub!( /\\D+/, '' )\n\n\t\t\t# If there's nothing in this chunk of the number, set it to zero\n\t\t\t# unless it's the whole-number part, in which case just push an\n\t\t\t# empty array.\n\t\t\tif chunk.empty?\n\t\t\t\tif section.zero?\n\t\t\t\t\tparts.push []\n\t\t\t\t\tnext \n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Split the number section into wordified parts unless this is the\n\t\t\t# second or succeeding part of a non-group number\n\t\t\tunless config[:group].zero? && section.nonzero?\n\t\t\t\tparts.push number_to_words( chunk, config )\n\t\t\telse\n\t\t\t\tparts.push number_to_words( chunk, config.merge(:group => 1) )\n\t\t\tend\t\t\t\t\t\n\t\t}\n\n\t\tdebug_msg \"Parts => #{parts.inspect}\"\n\t\t\n\t\t# Turn the last word of the whole-number part back into an ordinal if\n\t\t# the original number came in that way.\n\t\tif ord && !parts[0].empty?\n\t\t\tparts[0][-1] = ordinal( parts[0].last )\n\t\tend\n\n\t\t# If the caller's expecting an Array return, just flatten and return the\n\t\t# parts array.\n\t\tif config[:asArray]\n\t\t\tunless sign.empty?\n\t\t\t\tparts[0].unshift( sign )\n\t\t\tend\n\t\t\treturn parts.flatten\n\t\tend\n\n\t\t# Catenate each sub-parts array into a whole number part and one or more\n\t\t# post-decimal parts. If grouping is turned on, all sub-parts get joined\n\t\t# with commas, otherwise just the whole-number part is.\n\t\tif config[:group].zero?\n\t\t\tif parts[0].size > 1\n\n\t\t\t\t# Join all but the last part together with commas\n\t\t\t\twholenum = parts[0][0...-1].join( config[:comma] )\n\n\t\t\t\t# If the last part is just a single word, append it to the\n\t\t\t\t# wholenum part with an 'and'. This is to get things like 'three\n\t\t\t\t# thousand and three' instead of 'three thousand, three'.\n\t\t\t\tif /^\\s*(\\S+)\\s*$/ =~ parts[0].last\n\t\t\t\t\twholenum += config[:and] + parts[0].last\n\t\t\t\telse\n\t\t\t\t\twholenum += config[:comma] + parts[0].last\n\t\t\t\tend\n\t\t\telse\n\t\t\t\twholenum = parts[0][0]\n\t\t\tend\n\t\t\tdecimals = parts[1..-1].collect {|part| part.join(\" \")}\n\n\t\t\tdebug_msg \"Wholenum: #{wholenum.inspect}; decimals: #{decimals.inspect}\"\n\n\t\t\t# Join with the configured decimal; if it's empty, just join with\n\t\t\t# spaces.\n\t\t\tunless config[:decimal].empty?\n\t\t\t\treturn sign + ([ wholenum ] + decimals).\n\t\t\t\t\tjoin( \" #{config[:decimal]} \" ).strip\n\t\t\telse\n\t\t\t\treturn sign + ([ wholenum ] + decimals).\n\t\t\t\t\tjoin( \" \" ).strip\n\t\t\tend\n\t\telse\n\t\t\treturn parts.compact.\n\t\t\t\tseparate( config[:decimal] ).\n\t\t\t\tdelete_if {|el| el.empty?}.\n\t\t\t\tjoin( config[:comma] ).\n\t\t\t\tstrip\n\t\tend\n\tend",
"def to_string(num)\n\tteens = %w[eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen]\n\tones = %w[one two three four five six seven eight nine]\n\ttens = %w[ten twenty thirty forty fifty sixty seventy eighty ninety]\n\n\tdigits = num.to_s.split(\"\").map { |e| e.to_i }.reverse\n\twords = []\n\twrite_and = false\n\n\tdigits.each_with_index do |n, i|\n\t\tnext if n == 0\n\n\t\tif ((i == 2) || (i == 3))\n\t\t\tif write_and\n\t\t\t\twords.push(\"and\")\n\t\t\t\twrite_and = false\n\t\t\tend\n\t\tend\n\n\t\tcase i\n\t\twhen 0\n\t\t\tif (digits[i+1] == 1)\n\t\t\t\twords.push(teens[n-1])\n\t\t\t\tdigits[i+1] = 0\n\t\t\telse\n\t\t\t\twords.push(ones[n-1])\n\t\t\tend\n\n\t\t\twrite_and = true\n\t\twhen 1\n\t\t\twords.push(tens[n-1])\n\n\t\t\twrite_and = true\n\t\twhen 2\n\t\t\twords.push(\"hundred\")\n\t\t\twords.push(ones[n-1])\n\t\twhen 3\n\t\t\twords.push(\"thousand\")\n\t\t\twords.push(ones[n-1])\n\t\tend\n\tend\n\n\treturn words.reverse.join(\"\")\nend",
"def nums_to_words() \n number_array = @number.to_s.split(\"\").map! {|item| item.to_i}\n if number_array.length === 4\n thousands_array = [number_array.shift]\n space_array = [three_array(thousands_array), \"thousand\"] \n num_total = 0\n number_array.each do |num|\n num_total += num\n end\n if num_total !=0\n space_array.push(three_array(number_array))\n end\n return space_array.join(\" \")\n end\n three_array(number_array)\n end",
"def new_numeral_maker(num)\n i = 'I' * ((num % 5) / 1)\n v = 'V' * ((num % 10) / 5)\n x = 'X' * ((num % 50) / 10)\n l = 'L' * ((num % 100) / 50)\n c = 'C' * ((num % 500) / 100)\n\n four_error = 'IIII'\n nine_error = 'VIIII'\n forty_error = 'XXXX'\n ninety_error = 'LXXXX'\n four_hundred_error = 'CCCC'\n\n # hundreds\n if c == four_hundred_error\n print('DC')\n else\n print(c)\n end\n\n # tens\n if l + x == ninety_error\n print('XC')\n elsif x == forty_error\n print('XL')\n else\n print(x)\n end\n\n # ones and teens\n if v + i == nine_error\n print('IX')\n elsif i == four_error\n print('IV')\n else\n print(v + i)\n end\nend",
"def determine_how_many(number, unit)\n\t(number / unit).in_words\nend",
"def two_digit(number)\n dizaine = (number/10) * 10\n unit = (number % 10)\n if unit == 0\n return specific_word(dizaine)\n else\n return specific_word(dizaine) + \" \" + specific_word(unit)\n end\nend",
"def to_words\n num_hash = {\n 20 => \"twenty\",\n 19=>\"nineteen\",\n 18=>\"eighteen\",\n 17=>\"seventeen\",\n 16=>\"sixteen\",\n 15=>\"fifteen\",\n 14=>\"fourteen\",\n 13=>\"thirteen\",\n 12=>\"twelve\",\n 11 => \"eleven\",\n 10 => \"ten\",\n 9 => \"nine\",\n 8 => \"eight\",\n 7 => \"seven\",\n 6 => \"six\",\n 5 => \"five\",\n 4 => \"four\",\n 3 => \"three\",\n 2 => \"two\",\n 1 => \"one\"\n }\n text = num_hash[1]\n puts text\nend",
"def convert_numbers(input_number, result)\n if input_number >= 1000\n input_number -= 1000\n result << \"M\"\n convert_numbers(input_number, result)\n elsif input_number >= 900\n result << \"CM\"\n input_number -= 900\n convert_numbers(input_number, result)\n elsif input_number >= 500\n input_number -= 500\n result << \"D\"\n convert_numbers(input_number, result)\n elsif input_number >= 400\n input_number -= 400\n result << \"CD\"\n convert_numbers(input_number, result) \n elsif input_number >= 100\n input_number -= 100\n result << \"C\"\n convert_numbers(input_number, result)\n elsif input_number >= 90\n input_number -= 90\n result << \"XC\"\n convert_numbers(input_number, result)\n elsif input_number >= 50\n input_number -= 50\n result << \"L\"\n convert_numbers(input_number, result)\n elsif input_number >= 40\n input_number -= 40\n result << \"XL\"\n convert_numbers(input_number, result)\n elsif input_number >= 10\n input_number -= 10\n result << \"X\"\n convert_numbers(input_number, result)\n elsif input_number >= 9\n input_number -= 9\n result << \"IX\"\n convert_numbers(input_number, result)\n elsif input_number >= 5\n input_number -= 5\n result << \"V\"\n convert_numbers(input_number, result)\n elsif input_number >= 4\n input_number -= 4\n result << \"IV\"\n convert_numbers(input_number, result)\n elsif input_number >= 1\n input_number -= 1\n result << \"I\"\n convert_numbers(input_number, result)\n else\n result\n end\nend",
"def read_numbers n\n if(n == 0)\n return \"\"\n end\n \n hash = number_to_words_hash\n num_str = n.to_s\n len = num_str.length\n placeholder = \" \" \n \n if (len == 4)\n placeholder = \" thousand \" \n end\n\n if (len == 3)\n placeholder = \" hundred \"\n if (n % 100 != 0)\n placeholder = placeholder + \"and \"\n end\n end\n\n if (len == 2)\n if hash.has_key?(n)\n return hash[n] \n end\n return hash[(num_str[0].to_s+\"0\").to_i] + \"-\" + hash[num_str[1].to_i]\n\n end\n \n return (hash[num_str[0].to_i] + placeholder + read_numbers(num_str[1, len].to_i)).rstrip \nend",
"def to_text(number, version = :gb)\n unless number.is_a?(String) || number.is_a?(Integer)\n raise ArgumentError.new 'Only Integer or String (that converts to integer) can be parsed'\n end\n\n version = version.to_sym if version.is_a? String\n unless [:uk, :gb, :us].include? version\n raise ArgumentError.new 'Only :uk, :gb or :us versions can be generated'\n end\n\n number = number.to_s if number.is_a? Integer\n number.strip!\n\n # strip prefix\n number[0] = '' if number[0] == '+' or number[0] == '-'\n\n # 0\n return 'zero' if number.length == 1 and number == '0'\n\n # 1..999\n return get_hundreds number, version if number.length < 4\n\n # 999 <\n i = 0\n portions = []\n portion_block = []\n number.reverse!\n\n number.each_char do |c|\n portion_block.push c\n i += 1\n\n if i % 3 == 0\n block_clone = portion_block.clone\n portions.push block_clone\n portion_block.clear\n i = 0\n end\n end\n\n portions.push portion_block unless portion_block.empty?\n portions.reverse!\n\n final_number = ''\n i = portions.length - 1\n portions.each do |p|\n p.reverse!\n p_in_text = get_hundreds(p.join.to_i.to_s, version)\n final_number += p_in_text\n final_number += ' ' + @scale[i] + ' ' if p_in_text != ''\n i -= 1\n end\n final_number.strip!\n end",
"def number_suffix(number)\n string = number.to_s\n last_index = string.length\n\n return 'th' if [11, 12, 13].include?(number % 100)\n\n case string[last_index - 1]\n when '1' then 'st'\n when '2' then 'nd'\n when '3' then 'rd'\n else 'th'\n end\nend"
] | [
"0.78867555",
"0.7808188",
"0.7764262",
"0.7741971",
"0.76921237",
"0.7686812",
"0.76815444",
"0.76790273",
"0.7654146",
"0.7646829",
"0.76276755",
"0.76263547",
"0.7600322",
"0.7580754",
"0.7577119",
"0.75752765",
"0.751148",
"0.7472468",
"0.745444",
"0.74488336",
"0.73551697",
"0.73486346",
"0.7348162",
"0.73437953",
"0.7328741",
"0.72922474",
"0.72814584",
"0.72735476",
"0.7266158",
"0.7258338",
"0.72550666",
"0.7253991",
"0.7237243",
"0.7236822",
"0.7225596",
"0.72250223",
"0.72150904",
"0.7211482",
"0.71919614",
"0.7180028",
"0.7175397",
"0.7173146",
"0.71661586",
"0.71635",
"0.7153937",
"0.7151996",
"0.7149725",
"0.7145955",
"0.7109629",
"0.7107143",
"0.70878077",
"0.70787466",
"0.7064697",
"0.7033943",
"0.7011731",
"0.69951236",
"0.69849294",
"0.6984175",
"0.6983617",
"0.6980464",
"0.6963824",
"0.6935272",
"0.6932585",
"0.69135106",
"0.68657637",
"0.68547",
"0.68412155",
"0.6812293",
"0.6775986",
"0.67470145",
"0.6742869",
"0.67410445",
"0.6731858",
"0.6721827",
"0.6668081",
"0.6649014",
"0.6634385",
"0.6628542",
"0.6622023",
"0.6610351",
"0.6602031",
"0.65996283",
"0.6587235",
"0.6575468",
"0.65742826",
"0.6566702",
"0.65559196",
"0.65329003",
"0.65271413",
"0.65041643",
"0.65013343",
"0.64752513",
"0.64669913",
"0.64483047",
"0.6408331",
"0.6400659",
"0.6394865",
"0.63588184",
"0.62829477",
"0.6273237"
] | 0.69322854 | 63 |
Converts position to char For Ex: (8,1) => H1 | def to_char(x, y)
"#{char_mapping.key(x).upcase}#{y}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_text(single_pos)\t\n\t\t\t\t\tcase single_pos\n\t\t\t\t\t\twhen 0\n\t \t\tsingle_pos =\"A\"\n\t \t\twhen 1\n\t \t\tsingle_pos =\"B\"\n\t \t\twhen 2\n\t \t\t\tsingle_pos =\"C\"\n\t \t\twhen 3\n\t \t\tsingle_pos =\"D\"\n\t \t\twhen 4\n\t \t\tsingle_pos =\"E\"\n\t \t\twhen 5\n\t \t\tsingle_pos =\"F\"\n\t \t\twhen 6\n\t \t\tsingle_pos =\"G\"\n\t \t\twhen 7\n\t \t\tsingle_pos =\"H\"\n\t \tend\n\t \t\t\treturn single_pos\n\tend",
"def position_for(char)\n return ''.freeze if char.position.y == @y\n\n @y = char.position.y\n char.position.to_s\n end",
"def char_at(index)\n self.to_array[index.to_i]\n #@word = TILE_VALUES[index]\n end",
"def pos_to_index(position)\n position[1] * 8 + position[0]\n end",
"def convert_to_piece_position(coordinates)\n alpha = ('a'..'h').to_a\n\n row_index, column_index = coordinates\n\n alpha[row_index-1] + column_index.to_s\n end",
"def char_at(column)\n line[column, 1]\n end",
"def get_char at\n index = range_correct_index(at)\n return internal_object_get(index + 1)\n end",
"def first_chr(num2 = 1, num1 = 0)\n self[num2,num1]\n end",
"def index_to_letter(index)\n ALPHA26[index]\n end",
"def text_pos(pos = @pos)\t\n\t\treturn to_text(pos[0]) + (pos[1] + 1).to_s\n\tend",
"def convert_to_board_coordinates(position)\n alpha = ('a'..'h').to_a\n\n x_coordinate, y_coordinate = position.split('')\n\n [alpha.index(x_coordinate)+1, y_coordinate.to_i]\n end",
"def get_print_char x,y, leer = nil, one = 'X', two = 'O'\n\n #return \"@\" if @field[x][y].winner\n\n case @field[x][y].player\n when 1 then one\n when 2 then two\n else\n if leer.nil? then\n $keymap.invert[[x,y]].to_s\n else\n leer\n end\n end\n end",
"def char_at(index)\n\tself.to_array[index.to_i]\n end",
"def column(position)\n ConsoleGlitter.escape(\"#{position}G\")\n end",
"def square_character(square_val)\n case square_val\n when :x, :o\n square_val.to_s.upcase\n else\n \" \"\n end\n end",
"def MidChar ( num )\n\n x = num.to_s.length()\n\n case x\n\n when 3\n\n return num.to_s[1,1]\n\n when 5\n\n return num.to_s[2,1]\n\n when 7\n\n return num.to_s[3,1]\n\n else\n\n return -1\n\n end\n\nend",
"def alphabet_position(text)\n \nend",
"def char_at(index)\n\tself.to_array[index.to_i]\nend",
"def band_char\n (@band+65).chr\n end",
"def map_position(position)\n coords = position.split(\"\")\n col, row = coords\n\n unless coords.length == 2 && ChessGame::LETTER_MAP[col] && row.to_i.between?(1,8)\n raise RuntimeError.new \"Invalid Input - Please use A-H and 1-8\"\n end\n\n [ChessGame::LETTER_MAP[col], (row.to_i)-1]\n end",
"def rc_to_alphanum(row:, column:)\n index_to_letter(row) + (column + 1).to_s\n end",
"def to_s\n \"#{position[0]} #{position[1]} #{@direction}\"\n end",
"def numToChar(number)\n return (number+65).chr\nend",
"def char_at(index)\n self.to_array[index.to_i]\n end",
"def get_char\n @look = @expression[@number]\n @number +=1\nend",
"def sgf_board_position tree\n x = ('a'.ord + tree['x']).chr\n y = ('a'.ord + tree['y']).chr\n \"#{x}#{y}\"\n end",
"def index_to_letter(idx)\n letter = \"\"\n while true\n idx -= 1\n r = idx % 26\n idx /= 26\n letter = (r + 97).chr + letter\n break if idx <= 0\n end\n letter\n end",
"def char_at(off)\n if off.abs >= @length\n return \"\"\n end\n off = (off + @length) % @length\n if isleaf(self)\n return str.slice(off,1)\n elsif off < left.length\n return @left.char_at(off)\n else \n return @right.char_at(off-@left.length)\n end\n end",
"def to_offset(text, position); end",
"def letter_for(n)\n offset = n < 26 ? 'A'.ord : 'a'.ord\n ascii = offset + (n % 26)\n ascii.chr\n end",
"def to_s\n \"#{@row_idx+1}&#{('A'.ord+@col_idx).chr}\"\n end",
"def getChar(c)\n c.chr\nend",
"def getChar(c)\n c.chr\nend",
"def line_char_to_offset(text, line, character); end",
"def to_char(c)\n x = c / 100\n y = c % 100\n c = valid?(x, y) ? (0xA0 + x) * 0x100 + (0xA0 + y) : nil\n c.chr(@encoding).encode(Encoding::UTF_8) rescue (return nil)\n end",
"def get_map_letter_index(x_value)\n\tif x_value >= 0 && x_value <= 50\n\t\treturn 'A'\n\telsif x_value >= 50 && x_value <= 100\n\t\treturn 'B'\n\telsif x_value >= 100 && x_value <= 150\n\t\treturn 'C'\n\telsif x_value >= 150 && x_value <= 200\n\t\treturn 'D'\n\telsif x_value >= 200 && x_value <= 250\n\t\treturn 'E'\n\telsif x_value >= 250 && x_value <= 300\n\t\treturn 'F'\n\telsif x_value >= 300 && x_value <= 350\n\t\treturn 'G'\n\telsif x_value >= 350 && x_value <= 400\n\t\treturn 'H'\n\telsif x_value >= 400 && x_value <= 450\n\t\treturn 'I'\n\telsif x_value >= 450 && x_value <= 500\n\t\treturn 'J'\t\t\n\telse\n\t\treturn '?'\n\tend\nend",
"def cipher(range,name,num,x)\n\n\tres = x.ord + num\t\t\t\t\t\t\t#.ord of the future character\n\tope = range.last.ord - range.first.ord + 1\t\t#the operation to do for drive the new character into the range\n\t\tif res < range.first.ord\t\t\t\t\t\n\t\t\t(ope + res).chr\n\t\telsif res > range.last.ord\n\t\t\t(- ope + res).chr\n\t\telse\n\t\t\tres.chr\t\t\t\t\t\t\t\t\t#the return of the function is the new character\t\t\n\t\tend\t\t\n\nend",
"def number_to_letter\n\t\t(self + 64).chr\n\tend",
"def character_location\n ((@cr[5] ^ 0x08) & 0x08) << 12 | (@cr[5] & 0x07) << 10\n end",
"def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend",
"def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend",
"def chr() end",
"def alphanumeric(row, column)\n alpha_r = ('A'..'H').to_a\n \"#{alpha_r[row]}#{column + 1}\"\n end",
"def output_letter\r\n a = @deck.first\r\n a = 53 if a.instance_of? String\r\n output = @deck[a]\r\n if output.instance_of? String\r\n nil\r\n else\r\n output -= 26 if output > 26\r\n (output + 64).chr\r\n end\r\n end",
"def to_s\n \"Position <#{@row}, #{@col}>\"\n end",
"def alphabet_position(text)\n text.downcase.delete(\"^a-z\").chars.map{ |chr| chr.ord - 96 }.join(\" \")\nend",
"def get_codepoint(character)\n \"%04x\" % character.unpack(\"U\")[0]\n end",
"def sub_char(entry)\n\t\t\tcol, row = coord(entry)\n\t\t\tADFGVX[row] + ADFGVX[col]\n\t\tend",
"def convert_laser_str(position_string)\n position_string.chomp.chars\n end",
"def useInstruct(letter, pos_x, pos_y)\n if letter == \"^\"\n pos_y -= 1\n elsif letter == \"v\"\n pos_y += 1\n elsif letter == \"<\"\n pos_x -= 1\n elsif letter == \">\"\n pos_x += 1\n end\n return pos_x, pos_y\nend",
"def move(board, location, char=\"X\")\n location = location.to_i\n board[location - 1] = char\nend",
"def convert_to_title(n)\n result = []\n while n > 0\n n = n - 1\n div, mod = n.divmod(26)\n result.unshift((mod + 'A'.ord).chr)\n n = div\n end\n\n return result.join(\"\")\nend",
"def to_space(index)\n case index[0]\n when 0\n r = \"A\"\n when 1\n r = \"B\"\n when 2\n r = \"C\"\n when 3\n r = \"D\"\n end\n c = index[1].to_s\n @board.hash[(r+c).to_sym]\n end",
"def char\n self.class.codepoint2char(@codepoint)\n end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def character; end",
"def char\n self[@char]\n end",
"def excel_col()\n ( ( ( (self - 1)/26>=1) ? ( (self - 1)/26+64).chr: '') + ((self - 1)%26+65).chr)\n end",
"def move(board,cell,char=\"X\")\n board[cell.to_i-1] = char\n puts board\nend",
"def charChange(char)\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\n charPosition = alpha.index(char)\n newChar = alpha[charPosition - 1]\n return newChar\nend",
"def char\n raise MathError, \"Non-integer for char\" unless int?\n raise MathError, \"Out of range for char\" unless between?(0, 255)\n if zero?\n \"\"\n else\n to_i.chr\n end\n end",
"def first_char_idx\n dewey? ? 3 : 0\n end",
"def text_coordinate\n return 39, 5, 222, 16\n end",
"def char\n\t\t\t\t@char\n\t\t\tend",
"def to(position)\n first position + 1\n end",
"def to(position)\n first position + 1\n end",
"def x_to_letter(x)\n %w(A B C D E F G H J K L M N O P Q R S T)[x]\n end",
"def col(num)\n \"#{27.chr}[3#{num.to_s}m\"\nend",
"def closest_character_index(position)\n\t\t\t# Move caret into position\n\t\t\t# Try to get as close to the position of the cursor as possible\n\t\t\twidth = @font.width(@string, @height)\n\t\t\tx = @position.x\n\t\t\tmouse_x = $window.mouse.position_in_world.x\n\t\t\t\n\t\t\t# Figure out where mouse_x is along the continuum from x to x+width\n\t\t\t# Use that to guess what the closest letter is\n\t\t\t# * basically, this algorithm is assuming fixed width, but it works pretty well\n\t\t\tpercent = (mouse_x - x)/width.to_f\n\t\t\ti = (percent * (@string.length)).to_i\n\t\t\t\n\t\t\ti = 0 if i < 0\n\t\t\ti = @string.length if i > @string.length\n\t\t\t\n\t\t\treturn i\n\t\tend",
"def alphabet_position(text)\n r = [*\"a\"..\"z\"] # a~z陣列\n text = text.downcase #轉成小寫\n text_to_array = text.split(\"\") #轉成陣列\n y = text_to_array.map do |i| #對應成陣列index值\n if r.index(i) != nil \n r.index(i) + 1 \n end \n end\n y = y.compact #去除nil\n y = y.join(\" \")\nend",
"def move(board, position, marker='X')\n board[position.to_i - 1] = marker.upcase\nend",
"def draw_segment(character, offset)\n puts \"#{' ' * offset}#{character}\"\nend",
"def pointOf emoji\n emoji.split(\"\")\n .map {|s| s.ord.to_s(16)}\n .join(\"-\")\nend",
"def prev_char c, number\n new_ord = c.ord - filter_by_95(number)\n if new_ord < 32\n new_ord += (126 - 31)\n end\n return new_ord.chr\nend",
"def cursor_at(row, col)\n \"\\e[#{row};#{col}H\"\nend",
"def encode(letters, char, offset)\n\t\t((((char - letters.min) + offset) % 26) + letters.min).chr\n\t\t# binding.pry\n\tend",
"def stringy(pos_int)\n result = ''\n pos_int.times do |ind|\n ind%2 == 0 ? result<<'1' : result<<'0'\n end\n result\nend",
"def to_s\n return '<unknown node position>' unless (from, size = refs_at)\n\n \"#{'^'.rjust(from, ' ')}#{'-'.rjust(size, '-')}^\"\n end",
"def to position\n self[0..position]\n end",
"def shift_character_by(char, index)\n new_ord = (char.ord + index)\n if new_ord > LAST_CHARACTER_ORD\n new_ord -= ALPHABET_SIZE\n elsif new_ord < FIRST_CHARACTER_ORD\n new_ord += ALPHABET_SIZE\n end\n new_ord.chr\n end",
"def switch_player_position\n if @position == 1\n @symbol = \"\\u{274C}\"\n @position = 2\n elsif @position == 2\n @symbol = \"\\u{2705}\"\n @position = 1\n end\n end",
"def current_char\n @current_char\n end",
"def find_position(pass) = pass.gsub(/./, {\n FRONT => 0,\n LEFT => 0,\n BACK => 1,\n RIGHT => 1\n}).to_i(2)"
] | [
"0.77012813",
"0.72112554",
"0.6871412",
"0.6850559",
"0.6648862",
"0.6539978",
"0.6537295",
"0.64946914",
"0.64938617",
"0.64849645",
"0.64834166",
"0.64622027",
"0.6432442",
"0.6432234",
"0.6411009",
"0.6402583",
"0.6390403",
"0.6389513",
"0.6380329",
"0.63203806",
"0.6306017",
"0.6303321",
"0.63011545",
"0.62696135",
"0.6266716",
"0.62662727",
"0.6242891",
"0.6231677",
"0.62116855",
"0.6167698",
"0.61588573",
"0.61584955",
"0.61584955",
"0.6158303",
"0.6145653",
"0.6129557",
"0.61278415",
"0.61262155",
"0.6123318",
"0.61223304",
"0.61223304",
"0.6101201",
"0.608454",
"0.60814655",
"0.607869",
"0.60599923",
"0.603731",
"0.6000361",
"0.5990313",
"0.5979272",
"0.59728575",
"0.59723264",
"0.5959987",
"0.59598804",
"0.5957511",
"0.5957511",
"0.5957511",
"0.5957511",
"0.5957511",
"0.5957511",
"0.5957511",
"0.5957511",
"0.5957511",
"0.5957462",
"0.5957462",
"0.5957462",
"0.5957462",
"0.5957462",
"0.5957462",
"0.5957462",
"0.5957462",
"0.5957462",
"0.5957462",
"0.59464115",
"0.594494",
"0.5933108",
"0.5931414",
"0.5916518",
"0.5913743",
"0.59117925",
"0.5899729",
"0.58997214",
"0.58997214",
"0.5897028",
"0.5895978",
"0.5895311",
"0.5885818",
"0.5880188",
"0.58761495",
"0.5873879",
"0.58633995",
"0.58623",
"0.5857957",
"0.58542925",
"0.58515316",
"0.58484215",
"0.58466053",
"0.58423436",
"0.5841334",
"0.58385235"
] | 0.65955293 | 5 |
Gets the shortest path from source to destination using BFS algorithm | def shortest_path
initial_position_obj = { position: start_position, source: {} }
knights_path = [initial_position_obj]
while knights_path.present?
current_position = knights_path.shift
position = current_position[:position]
if position == end_position
return path_to_destination(current_position, initial_position_obj)
end
add_possible_destination(position, current_position, knights_path)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shortest_path\n dist, previous = Hash.new(Infinity), {}\n dist[@source] = 0.0\n queue = @graph.vertex_set.dup\n\n until queue.empty?\n u = queue.min { |a,b| dist[a.name] <=> dist[b.name] }\n break if dist[u.name].infinite?\n queue.delete(u)\n\n u.each_edge do |e, v|\n alt = dist[u.name] + e.weight\n if alt < dist[v.name]\n dist[v.name] = alt\n previous[v.name] = u.name\n end\n end\n end\n\n path = []\n u = @dest\n until previous[u].nil?\n path.unshift(u)\n u = previous[u]\n end\n\n path.unshift(@source)\n end",
"def compute_shortest_path\n update_distance_of_all_edges_to(Float::INFINITY)\n @distance_to[@source_node] = 0\n\n # The prioriy queue holds a node and its distance from the source node.\n @pq.insert(@source_node, 0)\n while @pq.any?\n node = @pq.remove_min\n node.adjacent_edges.each do |adj_edge|\n relax(adj_edge)\n end\n end\n end",
"def shortest_way(source, dest)\n\t\t@source = source\n dijkstra source\n \n if @distances[dest] != @infinity\n return @distances[dest]\n end\n\tend",
"def shortest_path_between_nodes(initial, destination)\n initial.distance = 0\n\n current = initial\n loop do\n # at the destination node, stop calculating\n break if current == destination\n\n unvisited.delete(current)\n\n calculate_neighbor_shortest_distances(current)\n\n return nil if no_reachable_nodes\n\n current = unvisited.min_by(&:distance)\n end\n\n destination.path\n end",
"def shortest_paths(src, destinations)\n return [] if destinations.empty?\n\n paths = []\n visited = Set.new([src])\n queue = Containers::MinHeap.new\n queue.push([1, [src]])\n\n until queue.empty?\n _, path = queue.pop\n\n # Not going to find shorter paths than current best, return.\n break if paths.any? && paths[0].size < path.size\n\n cur = path.last\n paths << path if destinations.include?(cur)\n\n neighbors(cur).each do |pos|\n next if visited.include?(pos) || occupied?(pos)\n\n visited.add(pos)\n new_path = Array.new(path.size) { |i| path[i].dup }\n new_path << pos\n queue.push([new_path.size, new_path])\n end\n end\n\n paths\n end",
"def dijkstra_shortest_path(source, destination, graph)\n distances, previouses = Hash.new(Float::INFINITY), Hash.new\n distances[source] = 0\n\n vertices = graph.vertices.dup\n\n while !vertices.empty?\n closest_vertex = vertices.min_by { |v| distances[v] }\n vertices.delete closest_vertex\n\n if closest_vertex == destination\n return path(previouses, destination, [])\n end\n\n closest_vertex.adjacent_edges.each do |e|\n neighbor = e.destination\n distance = e.weight + distances[closest_vertex]\n\n if distance < distances[neighbor]\n distances[neighbor] = distance\n previouses[neighbor] = closest_vertex\n end\n end\n end\n\n return [] #no path to destination\nend",
"def breadth_first_search(graph, source, target = nil)\n # queue: first-in, first-out (FIFO). keeps track of which vertices have already\n # been visited but have not yet been visited from, so we know where to search.\n queue = Queue.new\n\n # a `Set` instance is a collection of unordered values with no duplicates\n # maintain a list of visited nodes and prevent checking a node more than once\n visited = Set.new\n\n # shortest path information, if applicable\n meta = {}\n\n # enqueue the source key (push it to the empty queue)\n queue.enq(source)\n\n until queue.empty?\n # current node, which we `shift` from the queue\n current = queue.deq\n\n # print the shortest path if it was found\n return path(source, current, meta) if target && current == target\n\n # we don't have to keep track of distance here, since we have a method\n # to access each of the node's neighbors. the neighbors are stored in a set.\n # process each neighboring vertex of the current node,\n # i.e. traverse all outgoing edges from the current node.\n current.neighbors.each do |neighbor|\n # if the neighbor node is unvisited, we ignore this edge\n unless visited.include?(neighbor)\n queue.enq(neighbor)\n visited.add(neighbor) # we just enqueued this node, so mark it as visited\n meta[neighbor] = current # record the path (only done once, b/c of `unless`)\n end\n end\n end\nend",
"def shortest_path_to(dest_node)\n return unless has_path_to?(dest_node)\n path = []\n while (dest_node != @node) do\n path.unshift(dest_node)\n dest_node = @edge_to[dest_node]\n end\n path.unshift(@node)\n end",
"def bfs_shortest_path(node1, node2)\n distance, route = breadth_first_search(node1)\n step = distance[node2]\n node = node2\n path = [ node2 ]\n while node != node1 and route[node]\n node = route[node]\n path.unshift(node)\n end\n return step, path\n end",
"def shortest_paths(source, dest)\n @graph_paths=[]\n @source = source\n dijkstra source\n @path=[]\n find_path dest\n actual_distance=if @distance[dest] != INFINITY\n @distance[dest]\n else\n \"no path\"\n end\n \"Shortest route and distance : #{@path.join(\"-->\")}, #{actual_distance} km\"\n end",
"def shortest_path(start_node, end_node, graph)\n adjacent_edges = graph.select{ | edge | edge[NODES].include?(start_node) }\n remaining_edges = graph - adjacent_edges\n shortest_path = Path.new\n adjacent_edges.each do | edge |\n path = Path.new [edge]\n neighbor_node = (edge[NODES] - [start_node])[0] # ['A', 'B'] - ['A'] => ['B']\n unless neighbor_node == end_node\n path_ahead = shortest_path(neighbor_node, end_node, remaining_edges)\n (path_ahead.empty?)? path.clear : path.concat(path_ahead)\n end \n shortest_path = path if path.distance < shortest_path.distance\n end\n shortest_path\n end",
"def shortest_path(from_x, from_y, to_x, to_y)\n @visited = Array.new(@matrix.size) { Array.new(@matrix.first.size) { false } }\n @farthest_node = nil\n queue = Queue.new\n queue << Node.new(from_x, from_y, 0)\n\n while !queue.empty? do\n node = queue.pop\n\n if !@farthest_node || node.dist > @farthest_node.dist\n @farthest_node =node\n end\n\n if node.x == to_x && node.y == to_y\n # We pathed to the target\n target_node = node\n break\n end\n [[-1,0],[1,0],[0,1],[0,-1]].each do |dir|\n x = node.x + dir[0]\n y = node.y + dir[1]\n if is_valid?(x, y)\n @visited[y][x] = true\n queue.push(Node.new(x, y, node.dist + 1, node))\n end\n end\n end\n\n # We didn't find a path to the target\n return nil unless target_node\n\n # Trace back the journey\n journey = []\n journey.push [node.x,node.y]\n while !node.parent.nil? do\n node = node.parent\n journey.push [node.x,node.y]\n end\n journey.reverse.drop(1)\n end",
"def shortest_paths(source, dest)\n\t\t\t@source = source\n\t\t\tdijkstra source\n\t\t\tprint_path dest\n\t\t\treturn @distance[dest]\n\t\tend",
"def shortest_path(root, dest)\n priority = Hash.new\n visited = Hash.new\n previous = Hash.new\n q = PriorityQueue.new\n @vertices.each do |k, up|\n if up\n priority[k] = @@infinity\n visited[k] = false\n previous[k] = nil\n end\n end\n priority[root] = 0\n q[root] = 0\n until q.empty?\n u = q.delete_min\n visited[u[0]] = true\n break if u[1] == @@infinity\n @edges_cost.each_key do |s|\n @edges_cost[s].each_key do |d|\n if edges_up[s].fetch(d) and vertices[s] and vertices[d]\n if !visited[d] and priority[s] + @edges_cost[s].fetch(d) < priority[d]\n previous[d] = s\n priority[d] = priority[s] + @edges_cost[s].fetch(d)\n q[d] = priority[d]\n end\n end\n end\n end\n end\n prior = dest\n out = \"#{prior} \"\n while previous[prior]\n out = \"#{previous[prior]} \" + out\n prior = previous[prior]\n end\n out += \"#{priority[dest]}\\n\"\n print out\n priority[dest]\n end",
"def shortest_paths(s)\n @source = s\n dijkstra s\n puts \"Source: #{@source}\"\n @nodes.each do |dest|\n puts \"\\nTarget: #{dest}\"\n print_path dest\n if @d[dest] != @INFINITY\n puts \"\\nDistance: #{@d[dest]}\"\n else\n puts \"\\nNO PATH\"\n end\n end\n end",
"def shortest_path(start, finish)\n queue << [start, 0]\n loop do\n break if queue.empty?\n vertex, d = queue.pop\n graph[*vertex] = d\n break if vertex == finish\n enqueue_neighbours(*vertex, d + 1)\n end\n queue.clear\n !blank?(finish) ? build_path(start, finish) : []\n end",
"def dijkstra(src, target = nil)\n frontier = PriorityQueue.new\n shortest_paths = {src => 0}\n frontier[src] = 0\n\n until frontier.empty?\n v, c = frontier.pop_min # much faster\n\n return c if target == v\n shortest_paths[v] = c\n\n v.outer_edges.each do |e|\n v2, c2 = e.to, e.cost\n next if shortest_paths[v2]\n\n frontier.insert([v2, c + c2]) # faster\n end\n end\n\n shortest_paths\nend",
"def shortest_path(nodes, starting, ending)\n queue = [starting]\n previous = {}\n previous[starting] = nil\n while !queue.empty?\n p queue\n last_node = queue.pop\n if last_node == ending\n path = []\n while previous[last_node]\n path.unshift(last_node)\n last_node = previous[last_node]\n end\n path.unshift(starting)\n return path\n end\n if neighbors = nodes[last_node]\n neighbors.each do |neighbor|\n unless previous.has_key?(neighbor)\n queue.unshift(neighbor) \n previous[neighbor] = last_node\n end\n end\n end\n end\nend",
"def return_shortest_path(from)\r\n\r\n queue = Queue.new\r\n queue << from\r\n from.distance = 0\r\n while(!queue.empty?)\r\n v= queue.pop\r\n count=0\r\n adjDir = find_adjacent_rooms(v.roomObject)\r\n while(count < adjDir.length)\r\n w = @vertices[v.roomObject.return_title(adjDir[count])]\r\n\r\n if(w.distance==Float::INFINITY)\r\n w.distance = v.distance + 1\r\n w.path = v.path + \" \" + adjDir[count].to_s()\r\n queue << w\r\n end\r\n count = count + 1\r\n end\r\n count=0\r\n end\r\n\r\n end",
"def find_shortest_path(start_node, end_node)\n\n\t\tif (!start_node || !end_node)\n\t\t\traise \"start and end nodes must be specified\"\n\t\tend\n\n\t\tqueue = Hash[@edges.keys.map { |k| [k, nil] }]\n\t\tqueue[start_node] = 0\n\n\t\tdistances = queue.dup\n\t\tcrumbs = {}\n\n\t\twhile queue.size > 0\n\n\t\t\texpanded_node = get_min(queue)\n\n\t\t\t# Check if the current path to each neighbor of the expanded_node\n\t\t\t# is shorter than the path currently stored on the distances hash\n\t\t\t@edges[expanded_node].each do |node, edge|\n\n\t\t\t\tif distances[expanded_node]\n\t\t\t\t\n\t\t\t\t\tcurrent_path_distance = distances[expanded_node] + edge.weight\n\n\t\t\t\t\t# The distance to node is shorter via the current path or the distance to node hasn't yet been computed.\n\t\t\t\t\t# Either way, the distance from start_node->node is updated with the current distance (since it is shorter)\n\t\t\t\t\tif (!distances[node] || current_path_distance < distances[node])\n\t\t\t\t\t\tdistances[node], queue[node] = current_path_distance, current_path_distance\n\t\t\t\t\t\tcrumbs[node] = expanded_node\n\t\t\t\t\tend\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\tqueue.delete(expanded_node)\n\n\t\tend\n\n\t\t# List of edges representing the shortest path from start_node to end_node\n\t\tshortest_path = []\n\t\tcurrent_node = end_node\n\n\t\twhile (current_node && current_node != start_node && crumbs.size > 0)\n\t\t\tprevious_node = crumbs[current_node]\n\t\t\tif (previous_node)\n\t\t\t\tshortest_path << @edges[previous_node][current_node]\n\t\t\t\tcrumbs.delete(current_node)\n\t\t\tend\n\t\t\tcurrent_node = previous_node\n\t\tend\n\n\t\treturn shortest_path.reverse\n\n\tend",
"def get_path(start, stop)\n @graph.dijkstra_shortest_path(@weight_map, start, stop)\n end",
"def shortest_paths(s)\n\t\t@source = s\n\t\tdijkstra s\n\t\tputs \"Source: #{@source}\"\n\t\t@nodes.each do |dest|\n\t\t\tputs \"\\nTarget: #{dest}\"\n\t\t\tprint_path dest\n\t\t\tif @d[dest] != @INFINITY\n\t\t\t\tputs \"\\nDistance: #{@d[dest]}\"\n\t\t\telse\n\t\t\t\tputs \"\\nNO PATH\"\n\t\t\tend\n\t\tend\n\tend",
"def shortest_path(start_coord, destination_coord)\n queue = Queue.new\n queue << [start_coord]\n seen = Set.new([start_coord])\n while queue\n begin\n path = queue.pop(non_block = true)\n rescue ThreadError\n return nil\n end\n x, y = path[-1]\n if [x, y] == destination_coord\n return path\n end\n for x2, y2 in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]\n if (0 <= x2 && x2 < @map[0].length) && (0 <= y2 && y2 < @map.length) && (@map[y2][x2] != @WALL && @map[y2][x2] != @PERMANENT_WALL) && !seen.include?([x2, y2])\n queue << (path + [[x2, y2]])\n seen.add([x2, y2])\n end\n end\n end\n end",
"def do_bfs(graph, source)\n\tbfs_info = []\n\n\t# Initialize all of our vertices to have nil values\n\tgraph.each_with_index {|v, i| bfs_info[i] = BFS_Vertex_Info.new(nil, nil)}\n\n\t# Set our initial (starting) vertex to have a distance of 0\n\t# since it is the origin of our search\n\tbfs_info[source].distance = 0\n\n\tqueue = Queue.new\n\tqueue.enqueue(source)\n\n\t# Traverse the graph\n\twhile !queue.is_empty?\n\t\tvertex = queue.dequeue();\n\n\t\t# Look at each vertex that is a neighbor of our \n\t\t# current vertex; if its distance is nil, we\n\t\t# haven't visited it yet.\n\t\tgraph[vertex].each do |v|\n\t\t\tif bfs_info[v].distance.nil?\n\t\t\t\tbfs_info[v].distance = bfs_info[vertex].distance + 1\n\t\t\t\tbfs_info[v].predecessor = vertex\n\t\t\t\tqueue.enqueue(v)\n\t\t\tend\n\t\tend\n\tend\n\n\t# Return a list of vertices, their distances, and\n\t# predecessors\n\tbfs_info\nend",
"def shortest_paths(source)\n init(source)\n relax_edges\n PathBuilder.new(source, @visitor.parents_map).paths(@graph.vertices)\n end",
"def solve_dijkstra\n\n unvisited_set = @unvisited_set.dup\n\n # create a queue for nodes to check\n @queue = []\n current_node = @start_node\n @queue << current_node\n\n # Stop If there are no unvisited nodes or the queue is empty\n while unvisited_set.size > 0 && @queue.size > 0 do\n\n # set the current node as visited and remove it from the unvisited set\n current_node = @queue.shift\n\n # remove visited node from the list of unvisited nodes\n unvisited_set.delete(current_node)\n\n # find the current node's neighbours and add them to the queue\n rolling_node = @node_list.find { |hash| hash[:id] == current_node }\n rolling_node[:neighs].each do |p|\n # only add them if they are unvisited and they are not in the queue\n if unvisited_set.index(p) && !@queue.include?(p)\n @queue << p\n # set the previous node as the current for its neighbours\n change_node = @node_list.find { |hash| hash[:id] == p }\n change_node[:prev] = current_node\n # increase the distance of each node visited\n change_node[:dist] = rolling_node[:dist] + @step\n end\n end\n\n if current_node == @goal_node\n find_shortest_path(rolling_node)\n break\n end\n end\n return @shortest_path_coords\n end",
"def djikstra(graph, start_node, end_node)\n path_weights = {}\n previous_shortest_path = {}\n remaining = graph.nodes\n\n # Begin by setting weight of start node to 0, others to infinity\n graph.nodes.each do |node|\n if node == start_node\n path_weights[node] = 0\n else\n path_weights[node] = Float::INFINITY\n end\n end\n\n #TODO: can stop when we reach destination\n\n # pluck the node in remaining with lowest path weight. this will always be the start node to begin\n while remaining.length > 0\n min_index = nil\n lowest_score = Float::INFINITY\n remaining.each_with_index do |remaining_node, i|\n if path_weights[remaining_node] < lowest_score\n min_index = i\n lowest_score = path_weights[remaining_node]\n end\n end\n node = remaining.delete_at(min_index)\n\n # Update path_weight/previous of neighboring nodes based on shortest path\n # Also notice how we consider there may be no connections for the min_node.\n (node.connections || []).each do |neighbor, weight|\n if path_weights[neighbor] > (path_weights[node] + weight)\n path_weights[neighbor] = path_weights[node] + weight\n previous_shortest_path[neighbor] = node\n end\n end\n end\n\n node = end_node\n shortest_path = []\n\n while node\n shortest_path.unshift(node)\n node = previous_shortest_path[node]\n end\n\n puts path_weights[end_node]\n shortest_path.map{|node| node.value}\nend",
"def bfs(start, goal = :goalNode?)\n require 'set'\n visited = Set.new\n frontier = []\n frontier << start\n\n until frontier.empty?\n current = frontier.shift\n\n next if visited.include? current\n visited << current\n\n found = false\n found = if block_given?\n yield(current)\n else\n send(goal, current)\n end\n\n if !found\n current.connections.each do |node|\n frontier << node\n end\n else\n return current\n end\n end\n :goal_node_not_found\nend",
"def shortest_paths(dest)\n position = dest\n final = {}\n analisados = {}\n route = []\n route << dest\n @previous['a'] = -1\n\n @nodes.each do |n|\n analisados[n] = false\n end\n analisados[position] = true\n\n while analisados(analisados)\n adyacentes(position, analisados).each do |n|\n if @distance[n] == (@distance[position] - graph[n][position])\n @previous[position] = n\n position = n\n route << n\n end\n analisados[n] = true\n end\n\n end\n route << 'a'\n route\n end",
"def plan(s1, s2)\r\n if s1 == s2\r\n return []\r\n end\r\n\r\n condensed_path = Array.new\r\n full_path = Array.new\r\n temp = BFS.new(graph, find_node(s1)).shortest_path_to(find_node(s2))\r\n\r\n temp.each {|x| full_path.push(x.to_s)}\r\n condensed_path.push(full_path.first)\r\n condensed_path = condensed_path + transfer_stations(full_path)\r\n \r\n if condensed_path.last != full_path.last #need to test this more\r\n condensed_path << full_path.last\r\n end\r\n\r\n return condensed_path\r\n end",
"def best_path(start, target)\n queue = []\n path = []\n targetX = target[0]\n targetY = target[1] \n update_possible_moves(start)\n path << [@x, @y]\n until @x == targetX && @y == targetY\n @moves.each do |valid_move|\n queue << valid_move unless out_of_bounds?(valid_move) \n end\n #shift because we want bread-first search\n next_move = queue.shift\n update_possible_moves(next_move)\n path << [@x, @y] \n end\n # Filter out the best path and present it\n best_possible_path = filter_path(path)\n puts \"You made it in #{best_possible_path.length} moves! The path is:\\n#{best_possible_path}\"\n end",
"def shortest_path(v,w)\n raise ArgumentError unless path?(v,w) \n to_edge = []\n bfs(w) { |v1,v2| to_edge[v2] = v1 }\n result = []\n x = v\n while x != w\n result << x\n x = to_edge[x]\n end\n result << x\n end",
"def shortest_path_to(node)\n return nil if @previous_nodes[node].nil?\n\n nodes = [node]\n while previous_node = @previous_nodes[nodes[0]] do\n nodes.unshift(previous_node)\n end\n\n nodes\n end",
"def dijkstra\n # Intialise the algorithom if first run\n init_dijkstra if empty_path?\n\n # Stop the execution if all the nides have been reached\n return path if completed_path?\n\n # Make sure that all the weights are updated\n current_node[:node].adjacent_nodes.values.each do |node|\n @pool << node.merge(\n from: current_node[:node],\n weight: node[:weight] + current_node[:weight]\n )\n end\n\n # Sort the pool of nodes/edges by weight so to be able to grab the smallest\n # weight.\n pool.sort_by! { |edge| edge[:weight] }\n\n # Pick the next untouched node by shifting the nodes in the pool starting\n # from the smallest to the greatest.\n next_node = nil\n loop do\n next_node = pool.shift\n break unless values_in_path.include?(next_node[:node].value)\n end\n\n # Push the next step (from -> to) in the path\n @path << \"#{next_node[:from].value} ==> #{next_node[:node].value}\"\n\n # Track the node as seen\n @values_in_path += [next_node[:node].value, current_node[:node].value]\n\n # Update the current node\n @current_node = next_node\n\n # Keep the execution going\n dijkstra\n end",
"def search(start, goal)\n openset = Set.new\n closedset = Set.new\n current = start\n\n if @maximize_cost # serves to invert the comparison\n openset_min_max = openset.method(:max_by)\n flip = -1\n else\n openset_min_max = openset.method(:min_by)\n flip = 1\n end\n\n openset.add(current)\n while not openset.empty?\n current = openset_min_max.call{|o| o.g + o.h }\n if current == goal\n path = []\n while current.parent\n path << current\n current = current.parent\n end\n path << current\n return path.reverse\n end\n openset.delete(current)\n closedset.add(current)\n @graph[current].each do |node|\n next if closedset.include? node\n\n if openset.include? node\n new_g = current.g + current.move_cost(node)\n if (node.g - new_g) * flip > 0\n node.g = new_g\n node.parent = current\n end\n else\n node.g = current.g + current.move_cost(node)\n node.h = heuristic(node, start, goal)\n node.parent = current\n openset.add(node)\n end\n end\n end\n return nil\n end",
"def shortest_path(src, dst = nil)\n distances = {}\n previouses = {}\n self.each do |node|\n distances[node] = nil\n previouses[node] = nil\n end\n distances[src] = 0\n nodes = self.clone\n until nodes.empty?\n nearest_node = nodes.inject do |a, b|\n next b unless distances[a]\n next a unless distances[b]\n next a if distances[a] < distances[b]\n b\n end\n break unless distances[nearest_node] # Infinity\n if dst and nearest_node == dst\n return distances[dst]\n end\n neighbors = nodes.neighbors_from(nearest_node)\n neighbors.each do |node|\n alt = distances[nearest_node] + nodes.distance(nearest_node, node)\n if distances[node].nil? or alt < distances[node]\n distances[node] = alt\n previouses[node] = nearest_node\n # decrease-key v in Q # ???\n end\n end\n nodes.delete nearest_node\n end\n if dst\n return nil\n else\n return distances\n end\n end",
"def dijkstra(source)\n\t\t@distances = {}\n\t\t@predecessor_node = {}\n\t\t@nodes.each do |node|\n\t\t\t@distances[node] = @infinity\n\t\t\t@predecessor_node[node] = -1\n\t\tend\t\n\t\t@distances[source] = 0\n\t\tnodes_compressed = @nodes.compact\n\t\twhile (nodes_compressed.size > 0)\n\t\t\tnode_near = nil;\n\t\t\tnodes_compressed.each do |node_compressed|\n\t\t\t\tif (not node_near) or (@distances[node_compressed] and @distances[node_compressed] < @distances[node_near])\n\t\t\t\t\tnode_near = node_compressed\n\t\t\t\tend\n\t\t\tend\n\t\t\tif (@distances[node_near] == @infinity)\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tnodes_compressed = nodes_compressed - [node_near]\n\t\t\t@graph[node_near].keys.each do |neighbor_node|\n\t\t\t\ttotal_distance = @distances[node_near] + @graph[node_near][neighbor_node]\n\t\t\t\tif (total_distance < @distances[neighbor_node])\n\t\t\t\t\t@distances[neighbor_node] = total_distance\n\t\t\t\t\t@predecessor_node[neighbor_node] = node_near\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def bfs(target)\n visited = {}\n @graph.keys.each { |key| visited[key] = false }\n node = @graph.keys[0]\n queue = Queue.new\n queue << node\n while !(queue.length == 0)\n visited[node] = true\n puts \"node is #{node}\"\n return node if node == target\n @graph[node].each do |nabe|\n queue << nabe unless visited[nabe] == true\n end\n node = queue.pop\n end\n end",
"def shortest_paths(source)\n level = 0\n nextlevel = [source]\n seen = { source => level }\n pred = { source => [] }\n until nextlevel.empty?\n level += 1\n thislevel = nextlevel\n nextlevel = []\n thislevel.each do |v|\n neighbors_of(v).each do |w|\n next if (seen.keys.include? w) && (seen[w] != level)\n unless seen.keys.include? w\n pred[w] = []\n seen[w] = level\n nextlevel << w\n end\n pred[w] << v\n end\n end\n end\n [pred, seen]\n end",
"def dijkstras(start=@vertices.keys.sort[0],goal=nil)\n\t\t# Set of visited nodes\n\t\tvisited = []\n\n\t\t# Step 1 \n\t\t# - Start node weighs 0\n\t\t# - Set all other to infinity its done in constructor already\n\t\t@vertices[start] = 0\n\n\t\t# Step 2 \n\t\t# - Set initial node as current\n\t\t# - Mark all nodes unvisited except start node\n\t\tunvisited = @vertices.keys - [start]\n\t\tcurrent = start\n\n\t\twhile(!unvisited.empty?)\n\t\t\t# Step 3\n\t\t\t# - Consider all neighbors of current node\n\t\t\t# - Calculate distance cost: current path weight + edge weight\n\t\t\t# - Update distance if this distance is less than recorded distance\n\t\t\t\n\t\t\t@map[current].each do |neighbor|\n\t\t\t\tnext if visited.include?(neighbor.to)\n\t\t\t\tweight = @vertices[current] + neighbor.weight.to_i\n\t\t\t\tif weight < @vertices[neighbor.to]\n\t\t\t\t\t@vertices[neighbor.to] = weight\n\t\t\t\t\t@prev[neighbor.to] = current\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Step 4\n\t\t\t# - Add current node to visited\n\t\t\t# - Remove current node from unvisited\n\t\t\tvisited << current\n\t\t\tunvisited -= [current]\n\n\t\t\t# Find the smallest weighted node, could use a PQueue instead\n\t\t\tsmallest = @infinity\n\t\t\tcurrent = @infinity\n\t\t\tunvisited.each do |node|\n\t\t\t\tif @vertices[node] < smallest\n\t\t\t\t\tsmallest = @vertices[node]\n\t\t\t\t\t# Step 6\n\t\t\t\t\t# - Set smallest weighted node as current node, continue\n\t\t\t\t\tcurrent = node\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Step 5\n\t\t\t# - If goal is in visited, stop\n\t\t\t# - If full traversal without a goal? \n\t\t\t# \tCheck for infinity weighted node\n\t\t\tif visited.include? goal\t\t\n\t\t\t\tpath(goal)\n\t\t\t\treturn\n\t\t\tend\n\t\t\tbreak if current == @infinity\n\t\tend\n\t\t\n\t\t# Print all shortest paths\n\t\tputs \"Initial Node: #{start}\"\n\t\tvisited.each do |x|\n\t\t\tpath(x)\n\t\t\tputs\n\t\tend\n\tend",
"def bfs(starting_node, target_value)\n queue = [starting_node]\n visited = Set.new()\n\n starting_node.neighbors.each do |neighb_nodes|\n\n return queue.first.value if queue.first.value == target_value\n\n visited.add(queue.shift) \n\n queue.push(neighb_nodes) unless visited.include?(neighb_nodes)\n \n end\n nil\nend",
"def bfs(graph, s)\n queue = [s]\n @visited[s] = true\n @dist[s] = 0\n w = nil\n while not queue.empty?\n w = queue.delete_at(0)\n graph.adj(v).each do |edge|\n w = edge.to\n if not @visited[w]\n @path[w] = v\n @dist[w] = @dist[v] + 1\n @visited[w] = true\n queue << w\n end\n end\n end\n end",
"def shortest_route visit_path, dst, condition=nil\n return route(visit_path, dst).first.cost\n end",
"def dijkstra(graph, source)\n # number of vertices in graph\n n = graph.vertices.count\n # O(V)\n # a hash of vertex_states for each vertex in graph\n vertex_states = Hash.new{ |hash,key| hash[key] = VertexState.new(key)}\n graph.each_vertex do |vertex|\n vertex_states[vertex]\n end\n \n # init rules for priority queue\n pqueue = PQueue.new(){|u,v| vertex_states[u].shortest_distance < vertex_states[v].shortest_distance }\n # handle the source node\n vertex_states[source].shortest_distance = 0\n vertex_states[source].visited = true\n pqueue.push(source)\n \n # O(VlogV + E)\n # main loop of algo\n while pqueue.size != 0\n # O(logV)\n u = pqueue.pop\n # set vertex state to visited\n vertex_states[u].visited = true\n # check adjacent vertices\n # O(E)\n graph.each_adjacent(u) do |v|\n relax(graph,u,v,vertex_states) {pqueue.push(v)}\n end\n end\n vertex_states\n end",
"def path_from_src_to_dest(graph, src=0, dest=0)\n\t\t# Update source and destination\n\t\t@source, @destination = src, dest\n\n\t\t# Check if source is undefined, if so return empty path\n\t\tif @source == 0\n\t\t\treturn []\n\t\tend\n\n\t\t# Generate a connections hash based on graph edges\n\t\toutgoing = Hash.new()\n\t\tnodes = graph.nodes.keys\n\t\tresult = Array.new()\n\n\t\tgraph.nodes.keys.each {|key| outgoing[key] = Hash.new() }\n\t\tgraph.edges.values.each do |edge|\n\t\t\t# Is it possible for any two issues to have multiple links\n\t\t\t# between them?\n\t\t\toutgoing[edge.a.id][edge.b.id] = edge\t\t\n\t\tend\n\n\t\t# If an edge already exists in the graph from source to destination\n\t\tif outgoing[@source].has_key?(@destination)\n\t\t\tresult.push(outgoing[@source][@destination].id)\n\t\t\treturn result\n\t\tend\n\t\t\t\n\t\t# Compute all paths from source\n\t\tpaths_tracer, paths_distances, relationships_on_paths = compute_paths_from_source(outgoing, nodes)\n\t\t\n\t\t# Find the shortest path through the graph between source and destination\n\t\tif destination != 0\n\t\t\treturn trace_path_src_to_dest(outgoing, paths_tracer)\n\t\tend\n\n\t\t# This happens only if the destination is 0, as it would have returned otherwise.\n\t\t# Return available relationships, distances, \n\t\treturn important_relationships_from_source(paths_tracer, paths_distances, relationships_on_paths)\n\tend",
"def bfs(graph, s)\n queue = [s]\n @visited[s] = true\n @dist[s] = 0\n w = nil\n while not queue.empty?\n w = queue.delete_at(0)\n graph.adj(v).each do |edge|\n w = edge.other(v)\n if not @visited[w]\n @path[w] = v\n @dist[w] = @dist[v] + 1\n @visited[w] = true\n queue << w\n end\n end\n end\n end",
"def shortest_distance_between_nodes(initial, destination)\n shortest_path_between_nodes(initial, destination).last.distance\n end",
"def dijkstras(start=@vertices.keys.sort[0],goal=nil)\n\t\t# Set of visited nodes\n\t\tvisited = []\n\n\t\t# Step 1 \n\t\t# - Start node weighs 0\n\t\t# - Set all other to infinity its done in constructor already\n\t\t@vertices[start] = 0\n\n\t\t# Step 2 \n\t\t# - Set initial node as current\n\t\t# - Mark all nodes unvisited except start node\n\t\tunvisited = @vertices.keys - [start]\n\t\tcurrent = start\n\n\t\twhile(!unvisited.empty?)\n\t\t\t# Step 3\n\t\t\t# - Consider all neighbors of current node\n\t\t\t# - Calculate distance cost: current path weight + edge weight\n\t\t\t# - Update distance if this distance is less than recorded distance\n\t\t\t\n\t\t\t@map[current].each do |neighbor|\n\t\t\t\tnext if visited.include?(neighbor.to)\n\t\t\t\tweight = @vertices[current] + neighbor.weight.to_i\n\t\t\t\tif weight < @vertices[neighbor.to]\n\t\t\t\t\t@vertices[neighbor.to] = weight\n\t\t\t\t\t@prev[neighbor.to] = current\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Step 4\n\t\t\t# - Add current node to visited\n\t\t\t# - Remove current node from unvisited\n\t\t\tvisited << current\n\t\t\tunvisited -= [current]\n\n\t\t\t# Find the smallest weighted node\n\t\t\tcurrent = unvisited.collect { |node| [@vertices[node],node] }\n\t\t\tcurrent.empty? ? current = @infinity : current = current.min[1]\n\n\t\t\t# Step 5\n\t\t\t# - If goal is in visited, stop\n\t\t\t# - If full traversal without a goal? \n\t\t\t# \tCheck for infinity weighted node\n\t\t\tif visited.include? goal\t\t\n\t\t\t\tpath(goal)\n\t\t\t\treturn\n\t\t\tend\n\t\t\tbreak if current == @infinity\n\t\tend\n\t\t\n\t\t# Print all shortest paths\n\t\tputs \"Initial Node: #{start}\"\n\t\tvisited.each do |x|\n\t\t\tpath(x)\n\t\t\tputs\n\t\tend\n\tend",
"def shortest_path_to(other, options = {:method => :djikstra})\n latch = options[:method] == :breadth_first ? 2 : 1\n self.class.shortest_path(latch, id, other.id)\n end",
"def djikstra(world, from_x, from_y, to_x, to_y)\n key = [world.join, from_x, from_y].join(',')\n cached_prev = DJ_GRAPH_MEMO[key]\n\n prev = cached_prev\n\n unless cached_prev\n nodes = map_each_cell(world) {|cell, x, y| cell == '.' ? [x, y] : nil }.\n flatten(1).\n reject(&:nil?)\n\n source = [from_x, from_y]\n dist = Hash[nodes.zip([INFINITY].cycle)]\n queue = nodes.dup\n queue.push(source) unless queue.include?(source)\n dist[source] = 0\n prev = {}\n\n while !queue.empty?\n queue.sort_by! {|node| dist[node]}\n u = queue.shift\n\n neighbors = DIRECTIONS.values.map {|d| [u[0] + d[:x], u[1] + d[:y]] }\n neighbors = neighbors & nodes\n\n neighbors.each do |v|\n alt = dist[u] + 1\n\n if alt < dist[v]\n dist[v] = alt\n prev[v] = u\n end\n end\n end\n\n DJ_GRAPH_MEMO[key] ||= prev\n end\n\n path = []\n target = [to_x, to_y]\n\n return [source] if target == source\n\n # cannot reach target:\n return nil if prev[target].nil?\n\n while target\n path.push(target)\n target = prev[target]\n end\n\n path = path.reverse\n path\nend",
"def bfs(starting_node, target_value)\n visited = Set.new()\n queue = [starting_node]\n until queue.empty?\n dequeued = queue.shift\n return dequeued if dequeued.val == target_value\n visited.add(dequeued)\n dequeued.neighbors.each do |neighbor|\n queue << neighbor unless visited.include?(neighbor)\n end\n end\n nil\nend",
"def bfs(starting_node, target_value)\n return starting_node if starting_node.value == target_value\n queue = [starting_node]\n until queue.empty?\n queue += starting_node.neighbors\n queue.each { |neighbor| bfs(neighbor, tar) }\n end\n nil\nend",
"def find_path(start, goal)\n raise \"loc1 must not be the same as loc2\" if start == goal\n\n # Using A* path-finding algorithm\n # See pseudocode here: https://en.wikipedia.org/wiki/A*_search_algorithm\n # https://www.redblobgames.com/pathfinding/a-star/introduction.html\n # NOTE that this is overkill for this problem...\n open_set = Set.new([start])\n came_from = {}\n\n # Default value of \"Infinity\", but we can just use nil\n g_score = {}\n g_score[start] = 0\n\n # f_score = g_score[node] + h_score[node]\n # This uses both current best path (g score) aka similar to Djikstra's algorithm,\n # plus the heuristic score.\n f_score = {}\n # g_score[start] is 0, so not included here\n f_score[start] = h_score(start, goal)\n\n # Note that we add d_score as the weight of the edge, but in our\n # case, we consider all edges equally, so hardcode 1\n d_score = 1\n\n until open_set.empty? do\n # Node in open set with lowest f score (would ideally use PriorityQueue)\n current = open_set.min_by { |node| f_score[node] }\n\n if current == goal\n return reconstruct_path(came_from, current)\n end\n\n open_set.delete(current)\n\n valid_neighbours(current).each do |neighbour_loc|\n tentative_g_score = g_score[current] + d_score\n if g_score[neighbour_loc].nil? || tentative_g_score < g_score[neighbour_loc]\n # This path to neighbor is better than any previous one. Record it!\n came_from[neighbour_loc] = current\n g_score[neighbour_loc] = tentative_g_score\n f_score[neighbour_loc] = g_score[neighbour_loc] + h_score(neighbour_loc, goal)\n if !open_set.include?(neighbour_loc)\n open_set << neighbour_loc\n end\n end\n end\n end\n\n raise \"error, no path found!\"\n end",
"def dijkstra(src, dest)\n\t\tdistances = {}\n\t\tprevious = {}\n\n\t\t# set all values to infinity\n\t\tself.each do |vertex|\n\t\t\tdistances[vertex] = $inf\n\t\t\tprevious[vertex] = $inf\n\t\tend\n\n\t\t# set the source vertice to 0\n\t\tdistances[src] = 0\n\t\tq = self.clone\n\n\t\twhile !q.empty?\n\t\t\t# get the nearest vertice\n\t\t\tu = smallest_key(q, distances)\n\t\t\tbreak if distances[u] == $inf\n\n\t\t\t# if smallest is destination, return \n\t\t\tif u == dest\n\t\t\t\treturn distances[dest] \n\t\t\tend\n\t\t\t\n\t\t\t# iterate all neighbours of the nearest vertice\t\t\t\t\n\t\t\tneighbours(u).each do |v|\n\t\t\t\t# calculate distances from neighbour nodes\n\t\t\t\t# and add cumulated distance\n\t\t\t\talt = distances[u] + length_between(u, v)\n\t\t\t\t# update vertice distances accordingly\n\t\t\t\tif alt < distances[v]\n\t\t\t\t\tdistances[v] = alt\n\t\t\t\t\tprevious[q] = u\n\t\t\t\tend\n\t\t\tend\n\t\t\t# delete vertice from array\n\t\t\tq.delete(u)\n\t\tend\n\t\tdistances\n\tend",
"def find_shortest_path(initial_node, final_node)\n\t\tunless @nodes.include?(initial_node) && @nodes.include?(final_node)\n\t\t raise(\"Either of the nodes not found in the Graph\") \n\t\tend\n\t\tdistance = {}\n\t previous = {}\n\t\tdistance[initial_node] = 0 # Distance from initial_node to initial_node\n\t previous[initial_node] = nil\n\t\tnodes_counted = @nodes\n\t\t\t\n\t\tnodes_counted.each do |n|\n\t\t if n != initial_node \n\t\t\t distance[n] = Float::INFINITY # Unknown distance function from initial_node to final_node\n\t\t\t previous[n] = nil \t # Previous node in optimal path from initial_node\n\t\t\tend\n\t\tend\n\n\t\tuntil nodes_counted.empty? \n\t\t\n\t\t\tu = distance.select{|k,v| nodes_counted.include?(k)}.min_by{|k,v| v}.first # Source node in first case\n\t\t\tbreak if (distance[u] == Float::INFINITY)\n\t\t\tnodes_counted.delete(u)\n\t\t\t\n\t\t\t@paths[u].keys.each do |v|\n\t\t\t\talt = distance[u] + @paths[u][v]\n\t\t\t\tif alt < distance[v] # A shorter path to v has been found\n\t\t\t\t\tdistance[v] = alt\n\t\t\t\t\tprevious[v] = u\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t \n\t\tpath = []\n\t\tcurrent = final_node\n\t\twhile current\n\t\t\tpath.unshift(current)\n\t\t\tcurrent = previous[current]\n\t\tend\n \n\t\treturn distance[final_node], path\n\n\tend",
"def next_step_to_shortest_path(from_x, from_y, to_x, to_y)\n move = shortest_path(from_x, from_y, to_x, to_y)&.first\n return nil unless move\n if move[0] == from_x && move[1] == from_y + 1\n return 'S'\n elsif move[0] == from_x && move[1] == from_y - 1\n return 'N'\n elsif move[0] == from_x + 1 && move[1] == from_y\n return 'E'\n elsif move[0] == from_x - 1 && move[1] == from_y\n return 'W'\n end\n raise 'This should not happen'\n end",
"def breadth_first\n return do_breadth_first( [Node.new(@start)], Set.new, @dest)\n end",
"def dijkstra_shortest_path(start, finish)\n visited, unvisited = Array.new, Array.new\n distances = Hash.new\n\n distances[start] = 0\n unvisited << start\n\n # find the distance\n while not unvisited.empty?\n curr_node = unvisited.pop\n visited << curr_node\n get_edges(curr_node).each do |edge| \n if visited.find_index(edge.out_vertex) == nil\n unvisited.unshift(edge.out_vertex) if unvisited.find_index(edge.out_vertex) == nil\n curr_distance, min_distance = distances[curr_node], distances[edge.out_vertex] || 1.0 / 0.0\n if curr_distance + edge.distance < min_distance\n distances[edge.out_vertex] = curr_distance + edge.distance\n end\n end\n end\n end\n\n # figure out the path\n previous = finish\n path = Array.new() \n path << previous\n while distances[previous] != 0\n get_edges(previous).each do |edge|\n if previous != edge.in_vertex && distances[edge.in_vertex] + edge.distance == distances[previous]\n previous = edge.in_vertex\n path << previous\n break\n end\n end\n end\n \n return distances[finish], path.reverse\n end",
"def bfs(starting_node, target_value)\n queue = [starting_node]\n checked_nodes = Set.new\n\n until queue.empty?\n current = queue.shift\n unless checked_nodes.include?(current)\n checked_nodes.add(current)\n return current if current.value == target_value\n queue += current.neighbors\n end\n end\n nil\nend",
"def bfs(source)\n color = {}\n prev = {}\n dist = {}\n @vertices.each do |v|\n color[v] = \"white\"\n prev[v] = nil\n dist[v] = -1\n end\n color[source] = \"grey\"\n dist[source] = 0\n queue = []\n queue.push source\n while !queue.empty?\n v = queue.pop\n (@edges[v] || []).each do |edge|\n adj = edge.to\n if color[adj] == \"white\"\n color[adj] = \"grey\"\n dist[adj] = dist[v] + 1\n prev[adj] = v\n queue.push adj\n end\n end\n color[v] = \"black\"\n end\n [prev, dist]\n end",
"def find_shortest_path(rolling_node)\n\n @backtrack = []\n @backtrack << @goal_node\n\n # iterate until we arrive at the start node\n while rolling_node[:prev] != nil do\n temp_node = @node_list.find { |hash| hash[:id] == rolling_node[:prev] }\n @backtrack << temp_node[:id]\n rolling_node = temp_node\n end\n\n # create a table with the 1d and the 2d array node values\n @shortest_path = []\n\n @backtrack.each do |p|\n @shortest_path << [p, @table_convert[p]]\n @shortest_path_coords << @table_convert[p][1]\n end\n end",
"def dijkstra(g, source)\n\tdistances, parents = initialize_table(g, source)\n\tqueue = PriorityQueue.new(distances.slice(source))\n\n\t# Queue will have all nodes O(V)\n\twhile queue.size > 0 \n\t\t# potentially have as many nodes as there are in the graph\n\t\t# pop the min O(log V)\n\t\tparent = queue.pop_min.keys.first # { book: 0 }.keys.first\n\t\t# do we need to worry about cycles?\n\t\t# Will go through every single O(E)\n\t\tg[parent].each do |name, distance|\n\t\t\t# Do we care about nodes being seen already?\n\t\t\t# does this ever happend if there are not cycles?\n\t\t\tnew_distance = distances[parent] + distance\n\n\t\t\tif new_distance < distances[name]\n\t\t\t\tdistances[name] = new_distance\n\t\t\t\tparents[name] = parent\n\t\t\tend\n\n\t\t\t# O(logV)\n\t\t\tqueue.add(distances.slice(name)) \n\t\tend\n\tend\n\n\t[distances, parents]\n\t# O(V * logV + E * logV) => logV*(V + E)\nend",
"def shortest_length(start, finish)\n infinity = (2**(0.size * 8 - 2) - 1) # max Fixnum integer value\n distances = {} # smallest distance from starting vertex to this one\n previous = {}\n cyclic = start == finish # true if starting vertex = ending vertex\n loops = 0 # useful for cyclic path\n vertex_pq = PriorityQueue.new\n\n adj_lists.each do |vertex|\n vname = vertex.name\n if vname == start\n distances[vname] = 0\n vertex_pq.enq(vname, 0)\n else\n distances[vname] = infinity\n vertex_pq.enq(vname, infinity)\n end\n previous[vname] = nil\n end\n\n while vertex_pq\n loops += 1\n # if cyclic, pretend starting vertex is unvisited. put it back in queue.\n if cyclic && loops == 2\n vertex_pq.enq(start, infinity)\n distances[start] = infinity\n end\n # vertex currently being checked. picks closest one first.\n current = vertex_pq.deq\n vname = current.keys.first\n\n # if we've arrived at final vertex, return shortest distance\n # if cyclic, skip this code during first loop\n if vname == finish && loops > 1\n shortest_path = []\n vname2 = vname\n while previous[vname2]\n shortest_path << vname2\n vname2 = previous[vname2]\n previous[start] = nil if cyclic # pretend starting vertex is unvisited\n end\n shortest_path = [start] + shortest_path.reverse\n print \"Shortest path: #{shortest_path}, Length = #{path_length(shortest_path)}\\n\"\n return distances[finish]\n end\n\n # leave if we never get to final vertex\n break if vname == nil || distances[vname] == infinity\n\n adj_vertices(vname, adj_lists).each do |vertex|\n alt_distance = distances[vname] + dist(vname, vertex)\n # if total distance to neighbor < last minimum total distance\n # to neighbor, replace it with this new distance\n if alt_distance < distances[vertex]\n distances[vertex] = alt_distance\n previous[vertex] = vname\n vertex_pq.enq(vertex, alt_distance)\n end\n end\n end\n\n end",
"def shortest_path_with_topsort(graph, source)\n n = graph.vertices.count\n # an iterator that helps us go through vertices\n # in topo order\n #O(V+E)\n topsort_iter = RGL::TopsortIterator.new(graph)\n \n #O(V)\n # init vertex states for each vertex\n vertex_states = Hash.new{ |hash,key| hash[key] = VertexState.new(key)}\n graph.each_vertex do |vertex|\n vertex_states[vertex]\n end\n \n # handle the source node\n vertex_states[source].shortest_distance = 0\n vertex_states[source].visited = true\n \n #O(V + E)\n topsort_iter.each do |u|\n vertex_states[u].visited = true\n graph.each_adjacent(u) do |v|\n relax(graph,u,v,vertex_states)\n end\n end\n vertex_states\n end",
"def solve(from_word, to_word)\n return @word_graph.shortest_path(from_word, to_word)\n end",
"def findShortest(graph_nodes, graph_from, graph_to, ids, val)\n return -1 if ids.count(val)<=1 # no two nodes with color val\n dmin = graph_nodes\n num_edges = graph_from.length\n neighbors = {}\n 0.upto(num_edges-1) do |i|\n if neighbors[graph_from[i]]\n neighbors[graph_from[i]] << graph_to[i]\n else\n neighbors[graph_from[i]] = [graph_to[i]]\n end\n if neighbors[graph_to[i]]\n neighbors[graph_to[i]] << graph_from[i]\n else\n neighbors[graph_to[i]] = [graph_from[i]]\n end\n end\n p neighbors\n ids.each_with_index do |v,i|\n if v == val\n # zero-base index to one-base index \n source_node = i+1\n # look for others using bfs (stop looking if distance > dmin)\n queue = []\n visited = []\n backtrace = {}\n queue << source_node\n while !(queue.empty?)\n current_node = queue.shift\n visited << current_node\n if (current_node!=source_node) && (ids[current_node-1]==val)\n puts \"we are here!\"\n # how did I get here? backtrace\n hops = 0\n trace_node = current_node\n while (trace_node!=source_node)\n trace_node = backtrace[trace_node]\n hops +=1\n end\n if hops < dmin\n dmin = hops\n end\n break\n end\n neighbors[current_node].each do |xnode|\n if !(visited.include?(xnode))\n queue << xnode\n backtrace[xnode] = current_node\n end\n end\n end\n p visited\n end\n end\n if dmin == graph_nodes\n return -1\n else\n return dmin\n end\nend",
"def shortest_path_from(from, check=nil)\n dirs = [ [1,0], [0,1], [0,-1], [-1,0] ]\n \n #return [1,0]\n \n unless @cache and @cached_for == towers.keys+[check]\n\tmarked = {}\n\tmarked.default = false\n\n\tq = [Config.monsters_end_at]\n\tfirst = 0\n\t\n\tmarked[Config.monsters_end_at] = true\n\t\n\twhile first < q.size\n\t v = q[first]\n\t first += 1\n\t for i in dirs\n\t w = [v[0]+i[0], v[1]+i[1]]\n\t next if w != Config.monsters_start_at and w != Config.monsters_end_at and\n\t\t (w[0] < 0 or w[1] < 0 or w[0] >= Config.map_size[0] or w[1] >= Config.map_size[1])\n\t next if marked[w] or w == check or towers[w]\n\t marked[w] = [-i[0], -i[1] ]\n\t q << w\n\t end\n\tend\n\t\n\t@cached_for = towers.keys+[check]\n\t@cache = marked\n end\n \n return @cache[from]\n end",
"def path(from, to)\n prev = bfs(from)[0]\n return nil unless prev[to]\n rev_path = []\n current_vertex = to\n while current_vertex\n rev_path << current_vertex\n current_vertex = prev[current_vertex]\n end\n rev_path.reverse\n end",
"def breadth_first_search(start, target)\n queue = [ @vertices[start] ]\n visited = []\n until queue.empty?\n vertex = queue.shift\n break if vertex.key == target\n visited << vertex\n vertex.neighbors.each { |key| queue << @vertices[key] unless visited.include?(@vertices[key])}\n end\n visited\n end",
"def shortest_path\n pa = AI::AStarAlgorithm.new($map.grid, $map.gen_coordinates)\n pa.astar\n end",
"def bfs(graph, starting_point)\n q = Queue.new()\n q.enq(starting_point)\n visited = [] \n loop do \n node = q.deq\n visited.push(node) unless visited.include?(node) \n graph.values[node].each{ |x| q.enq(x) }\n break if visited.length == graph.length\n end \n visited\n end",
"def shortest_path_to_all_nodes(initial)\n initial.distance = 0\n\n current = initial\n loop do\n unvisited.delete(current)\n\n calculate_neighbor_shortest_distances(current)\n\n return graph.vertices if no_reachable_nodes\n\n current = unvisited.min_by(&:distance)\n end\n end",
"def find_path(source, target, map)\n @main_loop_count = 0\n\n max_y = map.size - 1\n max_x = map[0].size - 1\n target_x = target[0]\n target_y = target[1]\n # target heuristic is 0\n target = [target_x, target_y, 0]\n\n # Sets up the search to begin from the source\n source = source.dup.push((target_x - source[0]).abs + (target_y - source[1]).abs)\n came_from = {}\n came_from[source] = nil\n frontier = [source]\n\n # Until the target is found or there are no more cells to explore from\n until came_from.has_key?(target) || frontier.empty?\n @main_loop_count += 1\n\n # Take the next frontier cell\n new_frontier = frontier.shift\n\n # Find the adjacent neighbors\n adjacent_neighbors = []\n\n # Gets all the valid adjacent_neighbors into the array\n # From southern neighbor, clockwise\n nfx = new_frontier[0]\n nfy = new_frontier[1]\n adjacent_neighbors << [nfx , nfy - 1, (target_x - nfx).abs + (target_y - nfy + 1).abs] unless nfy == 0\n adjacent_neighbors << [nfx - 1, nfy - 1, (target_x - nfx + 1).abs + (target_y - nfy + 1).abs] unless nfx == 0 || nfy == 0\n adjacent_neighbors << [nfx - 1, nfy , (target_x - nfx + 1).abs + (target_y - nfy).abs] unless nfx == 0\n adjacent_neighbors << [nfx - 1, nfy + 1, (target_x - nfx + 1).abs + (target_y - nfy - 1).abs] unless nfx == 0 || nfy == max_y\n adjacent_neighbors << [nfx , nfy + 1, (target_x - nfx).abs + (target_y - nfy - 1).abs] unless nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy + 1, (target_x - nfx - 1).abs + (target_y - nfy - 1).abs] unless nfx == max_x || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy , (target_x - nfx - 1).abs + (target_y - nfy).abs] unless nfx == max_x\n adjacent_neighbors << [nfx + 1, nfy - 1, (target_x - nfx - 1).abs + (target_y - nfy + 1).abs] unless nfx == max_x || nfy == 0\n\n new_neighbors = adjacent_neighbors.select do |neighbor|\n # That have not been visited and are not walls\n unless came_from.has_key?(neighbor) || map[neighbor[1]][neighbor[0]] != '.'\n # Add them to the frontier and mark them as visited\n # frontier << neighbor\n came_from[neighbor] = new_frontier\n end\n end\n\n # Sort the frontier so cells that are close to the target are then prioritized\n if new_neighbors.length > 0\n new_neighbors = merge_sort(new_neighbors)\n if frontier.length > 0 && new_neighbors[0][2] >= frontier[0][2]\n frontier = merge_sort(new_neighbors.concat(frontier))\n else\n frontier = new_neighbors.concat(frontier)\n end\n end\n end\n\n # If the search found the target\n if came_from.has_key?(target)\n # Calculates the path between the target and star for the greedy search\n # Only called when the greedy search finds the target\n path = []\n next_endpoint = came_from[target]\n while next_endpoint\n path << [next_endpoint[0], next_endpoint[1]]\n next_endpoint = came_from[next_endpoint]\n end\n path\n else\n return nil\n end\n end",
"def get_allpaths(source, dest, visited, path)\n # mark visited\n visited[source] = 1\n path << source\n\n if source.eql? dest\n @paths << path.dup\n else\n # recurse for all neighboring nodes\n @nnmap[source].each do |n|\n get_allpaths(n, dest, visited, path) if visited[n].eql? 0\n end\n end\n\n path.pop\n visited[source] = 0\n end",
"def dijkstra(source, destination, calcweight)\n\tvisited = Hash.new\t\t\t\t#hash of airports and booleans\n\tshortest_distances = Hash.new\t#hash of airports and the cost of reaching that airport from source\n\tprevious = Hash.new\t\t\t\t#hash of airports and their predecessor in the dijkstra algorithm -- the values are tuples of airports and flights\n\t@airports.each do |a|\n\t\tvisited[a] = false\t\t\t#initially no airports are visited\n\t\tshortest_distances[a]=@INFINITY\t\t#the cost to reach every airport is infinite\n\t\tprevious[a]= [nil,nil]\t\t\t#no airport has been reached yet\n\tend\n\n\t#info about priority queue: http://www.math.kobe-u.ac.jp/~kodama/tips-ruby-pqueue.html\n\tpq = PQueue.new(proc {|x,y| shortest_distances[x[0]] < shortest_distances[y[0]]})\n\n\tpq.push([source,@date]) \t\t#the priority queue contains a tuple of airports and the arrival time in that airport\n\tvisited[source] = true\n\tshortest_distances[source] = 0\n\n\n\n\twhile pq.size!=0\t\t\t#If the priority queue is empty, the algorithm is finished\n\t\tnode = pq.pop\n\t\tvisited[node[0]] = true\t\t#(node[0] contains the airport code)\n\n\t\t#if edges[v]\n\t\t\tnode[0].connections.each do |w|\t\n\n\t\t\t\tif visited[w]==false\n\t\t\t\t\tf = getFlights(node[0],w,node[1])\t#for each connection from that airport\n\t\t\t\t\tif(not f.nil? and f.length!=0)\t\t#get the suitable flights\n\t\t\t\t\t\tweight = @INFINITY\t\t#and find the most optimal of this array of flights\n\t\t\t\t\t\tflight = nil\n\n\t\t\t\t\t\tf.each do |fl|\t\t\t\n\t\t\t\t\t\t\tt = calcweight.call(fl,shortest_distances[node[0]])\n\t\t\t\t\t\t\tif t<weight then \n\t\t\t\t\t\t\t\tweight = t \n\t\t\t\t\t\t\t\tflight = fl\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t#continue regular dijkstra algorithm\n\t\t\t\t\t\tif shortest_distances[w] > weight\n\t\t\t\t\t\t\tshortest_distances[w] = weight\n\t\t\t\t\t\t\tprevious[w] = [node[0],flight]\n\t\t\t\t\t\t\tarrdate = Date.new(flight.date.to_s,flight.departureTime.to_s) #calculate the arrival time/date \n\t\t\t\t\t\t\tarrdate.addTimeToDate(flight.flightDuration)\t\t\t#of this flight\n\t\t\t\t\t\t\tpq.push([w,arrdate])\t\t\t\t#and put it with the airport in the priority queue\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\tend\n\n\tret = []\n\t#get the list of flights form the 'previous' hash\n\twhile destination != source\n\t\tif destination.nil? then \n\t\tp \"No flights available, try an other day...\"\n\t\treturn nil\n\t\tend\n\t\tf = previous[destination][1]\n\n\t\tret.push(f)\n\t\tdestination = previous[destination][0]\n\n\n\tend\n\t#ret now holds the flights in reversed order, so we need to reverse the array before returning it.\n\treturn ret.reverse\nend",
"def select_possible_path(possible_paths)\n vertex, data = possible_paths.min_by do |vertex, data|\n data[:cost]\n end\n vertex\nend",
"def dfs_traversal(source_vertex)\n\n @visited[source_vertex] = true;\n\n @adjacent_list[source_vertex].each do |i|\n dfs_traversal(i) if !@visited[i]\n end\n\n end",
"def dijkstra(start_vertex)\n # 1. Start empty result map and fringe with just the start\n # vertex. Yield initialization message.\n\n # 2. Each time, extract the minimum cost entry from the fringe. Add\n # it to the result. Yield extraction message.\n\n # 3. Process all outgoing edges from the vertex by using\n # add_vertex_edges.\n\n # 4. When done processing edges for the extracted entry, yield\n # competion message.\n\n # 5. When entirely all done, *return* (not yield) the result map.\nend",
"def shortest_path( dest, exclusions = [] )\n exclusions ||= []\n previous = shortest_paths( exclusions )\n s = []\n u = dest.hex\n while previous[ u ]\n s.unshift u\n u = previous[ u ]\n end\n s\n end",
"def call\n return nil unless on_the_graph? # Prevents a stack overflow in the gem\n return shortest_path[1..-1] if shortest_path.length > 1\n end",
"def has_path_bfs?(source_id, dest_id)\n visited = Set.new\n source = get_node(source_id)\n dest = get_node(dest_id)\n\n to_visit = [source].concat(source.adjacent)\n\n to_visit.each do |node|\n unless visited.include?(node.id)\n return true if node.id == dest.id\n visited << node.id\n to_visit.concat(node.adjacent)\n end\n end\n\n return false\n end",
"def bradth_first_search(start_vertex, stop_vertex)\n queue = Array.new()\n queue << search_vertex(start_vertex)\n until queue.empty?\n temp_vertex = queue.shift()\n break if temp_vertex.value == stop_vertex\n vertex_edges = temp_vertex.edges.head\n until vertex_edges == nil\n current = search_vertex(vertex_edges.value)\n if current.visited == false\n current.visited = true\n current.parent = temp_vertex.value\n queue << current\n end\n vertex_edges = vertex_edges.link\n end\n temp_vertex.visited = true\n end\n graph_traversal(start_vertex, stop_vertex)\n end",
"def shortest_distances( src )\n \n raise ArgumentError if (not @graph.has_key? src)\n\n # keep a priority queue of nodes, ordered by known distances\n distances = CPriorityQueue.new\n @nodes.each { |node|\n distances[node] = INFINITY\n }\n distances[src] = 0;\n\n # results accumulator\n results = {}\n\n while( not distances.empty? ) do\n \n # get the shortest known\n pair = distances.delete_min\n node = pair[0]\n node_dist = pair[1]\n \n # record\n results[node] = node_dist \n\n # traverse all neighbors\n neighbors = @graph[node] || {}\n neighbors.each { |neighbor, dist|\n # if it's nearer to go by me, update\n neighbor_d = distances[neighbor] || -1 # neighbor may have been found already\n if (node_dist + dist < neighbor_d)\n distances[neighbor] = node_dist + dist\n end\n }\n\n end\n\n return results\n\n end",
"def all_paths_source_target(graph)\n current_path = []\n results = []\n\n dfs(graph, results, 0, current_path)\n return results\nend",
"def get_paths(source, target, iterate_only_if=nil, &result_filter)\n iterate_only_if = result_filter if iterate_only_if.nil?\n queue=[[0, source]]\n result=[]\n while queue.any?\n node = queue.shift\n @graph.each_adjacent(node.last) do |edge, weight|\n nnode = node.dup\n nnode[0]= node[0] + weight\n nnode << edge\n nlevel = nnode.length - 2\n if edge == target\n if result_filter.call(nnode[0], nlevel)\n result << nnode\n end\n end\n\n if iterate_only_if.call(nnode[0], nlevel)\n queue << nnode\n end\n end\n end\n result\n end",
"def bfs_graph(graph, target, visited = Set.new)\n graph.graph.each do |g|\n val = bfs_helper(g, target, visited)\n if (!val.nil?)\n return val\n end\n end\n nil\nend",
"def find_path()\n visited = Array.new(8) {Array.new(8)}\n return [] if @destination == @currentPosition\n paths = [[@currentPosition]]\n visited[@currentPosition[0]][@currentPosition[1]] = true\n\n until paths.empty?\n new_paths = []\n paths.each do |path|\n next_positions = possibleMoves(path.last, visited)\n next_positions.each do |move|\n newpath = path.dup << move\n if move == @destination #if we reached our destination stop and return the path\n return newpath\n end\n visited[move[0]][move[1]] = true\n new_paths.push(newpath)\n end\n end\n paths = new_paths\n end\n end",
"def find_moves(start, target)\n visited = breadth_first_search(start, target)\n moves = []\n find_coordinate = target\n visited.reverse.each do |vertex|\n vertex.neighbors.each do |coordinate|\n if coordinate == find_coordinate\n moves << vertex.key\n find_coordinate = vertex.key\n end\n end\n end\n moves.reverse << target\n end",
"def bfs(target)\n queue = [self]\n until queue.empty?\n return queue.first if queue.first.position == target\n queue += queue.first.children\n queue.shift\n end \n end",
"def shortest_single_flight\n\n min_distance = @largest_integer\n flight = \"\"\n @query.get_graph.each_key do |city|\n route_dict = get_outgoing_routes(city)\n route_dict.each do |dest, dist|\n if dist < min_distance\n min_distance = dist\n flight = \"#{get_city_info(city,\"name\")}-#{dest}\"\n end\n end\n end\n\n return flight\n\n end",
"def shortest_circuit()\n shortest_cir = Array.new\n shortest_weight = 99999\n\n vert = vertex_list()\n start_point = vert[0]\n vert.delete_at(0)\n\n vert_perm = vert.permutation.to_a()\n\n vert_perm.each{ |x|\n x.insert(0,start_point)\n x.insert(x.length,start_point)\n weight = path_weight(x)\n \n if weight == nil\n weight = 99999\n end\n\n if weight < shortest_weight\n shortest_weight = path_weight(x)\n shortest_cir = x\n end\n }\n return \"Shortest Circuit = \",shortest_cir.inspect, \"\\nWeight = \", shortest_weight\n\n end",
"def build_path(start, end_pos)\n node = Node.new(start[0], start[1])\n target = Node.new(end_pos[0], end_pos[1])\n visited_nodes = []\n next_moves = [node]\n until next_moves.empty? do\n node = next_moves.shift\n puts \"Current node: #{node.x}, #{node.y}\"\n if node.x == target.x && node.y == target.y \n return node\n end\n visited_nodes.push(node)\n node.moves = get_moves(node)\n node.moves.reject do |square|\n visited_nodes.include?(square)\n end\n node.moves.each do |move| \n next_moves.push(move)\n end\n end\n return node\nend",
"def shortest_distance()\n min = 1000000\n s = \"\"\n @edges.each do |city, dests|\n dests.each do |dest|\n if min > dest.distance\n min = dest.distance\n s = \"#{city} to #{dest.name}\"\n end\n end\n end\n \"Shortest distance is #{min} from #{s}\"\n end",
"def dijkstra(root)\n distance, predecessor = initialize_single_source(root)\n @graph[root].each do |k, v|\n distance[k] = v\n predecessor[k] = root\n end\n queue = distance.dup\n queue.delete(root)\n\n while queue.size != 0\n min = queue.min {|a, b| a[1] <=> b[1]}\n u = min[0]\t\t# extranct a node having minimal distance\n @graph[u].each do |k, v|\n # relaxing procedure of root -> 'u' -> 'k'\n if distance[k] > distance[u] + v\n distance[k] = distance[u] + v\n predecessor[k] = u\n end\n end\n queue.delete(u)\n end\n return distance, predecessor\n end",
"def dijkstra(root)\n distance, predecessor = initialize_single_source(root)\n @graph[root].each do |k, v|\n distance[k] = v\n predecessor[k] = root\n end\n queue = distance.dup\n queue.delete(root)\n\n while queue.size != 0\n\tmin = queue.min {|a, b| a[1] <=> b[1]}\n\tu = min[0]\t\t# extranct a node having minimal distance\n @graph[u].each do |k, v|\n\t # relaxing procedure of root -> 'u' -> 'k'\n if distance[k] > distance[u] + v\n distance[k] = distance[u] + v\n predecessor[k] = u\n end\n end\n\tqueue.delete(u)\n end\n return distance, predecessor\n end",
"def possible_moves(start_node, destination)\n\t\n\t\tif start_node.value == destination\n\t\t\treturn start_node\n\t\telse\n\t\t\tgame.visited << start_node\n\t\t\tgame.unvisited = game.unvisited + (set_parent(start_node, possible_positions(start_node.value)) - game.visited)\n\t\t\tgame.unvisited.each do |position_node|\n\t\t\t\tif position_node.value == destination\n\t\t\t\t\treturn position_node\n\t\t\t\tend\n\t\t\t\tgame.visited << position_node\n\t\t\tend\n\t\t\tpossible_moves(game.unvisited.shift,destination) if game.unvisited.first != nil \n\t\tend\n\tend",
"def breadth_first_search(start_node, target_value)\n\t\tvisited = [start_node]\t\t\t\n\t\tqueue = [start_node]\n\t\n\t\twhile ( queue.length > 0 )\t\n\n\t\t\t# dequeue\n\t\t\tvertex = queue.shift\n\t\t\treturn vertex if target_value.name == vertex.name\n\t\n\t\t\t# visit all adjacent unvisited vertexes, mark visited, enqueue\n\t\t\tNode.childPointers.each do |child|\n\t\t\t\tif !eval(\"vertex.#{child}.nil?\")\n\t\t\t\t\tif !eval(\"visited.include?vertex.#{child}\")\n\t\t\t\t\t\tvisited << eval(\"vertex.#{child}\")\n\t\t\t\t\t\teval(\"vertex.#{child}.prev = vertex\")\n\t\t\t\t\t\tqueue << eval(\"vertex.#{child}\")\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tnil\n\tend",
"def compute(source, num_nodes)\n x = [source]\n source.length = 0\n until x.length == num_nodes\n min_edge = nil\n min_distance = Float::INFINITY\n x.each do |xnode|\n xnode.outgoing_edges.each do |xedge|\n next if xedge.visited?\n curr_distance = xnode.length + xedge.distance\n if curr_distance <= min_distance\n min_distance = curr_distance\n min_edge = xedge\n end\n end\n end\n min_edge.head.length = min_distance\n x << min_edge.head\n end\n x\nend",
"def find_any_path_between_vertices(source_vertex, destination_vertex)\n validate_integer(source_vertex, destination_vertex)\n return nil if @vertices[source_vertex].nil? || @vertices[destination_vertex].nil?\n return path_between_vertices(source_vertex, destination_vertex)\n end",
"def knight_path(from, to)\n\topen_queue = [PositionPath.new( from, [copy(from)] )]\n\tdiscovered = [from]\n\n\tuntil open_queue.empty?\n\t\tcurrent = open_queue.shift\n\n\t\treturn current.path if current.position == to\n\t\tvalid_moves(current.position).each do |move|\n\t\t\tunless discovered.include?(move)\n\t\t\t\tdiscovered << move\n\t\t\t\topen_queue.push(make_position_path(current, move)) \n\t\t\tend\n\t\tend\n\tend\n\t\nend"
] | [
"0.7995144",
"0.7745324",
"0.7636586",
"0.7586582",
"0.75549906",
"0.7545491",
"0.75307226",
"0.74935955",
"0.7445026",
"0.7368284",
"0.73522717",
"0.7333823",
"0.7222897",
"0.7208352",
"0.7200845",
"0.71549547",
"0.7150209",
"0.714395",
"0.7122513",
"0.70829666",
"0.7069968",
"0.7019274",
"0.70016724",
"0.69967616",
"0.69891477",
"0.6944743",
"0.6922833",
"0.6879243",
"0.6838351",
"0.6822756",
"0.68197405",
"0.68024623",
"0.6794815",
"0.6743413",
"0.672835",
"0.6725972",
"0.6684776",
"0.66547406",
"0.66470605",
"0.66397935",
"0.66260165",
"0.66172683",
"0.65803975",
"0.657374",
"0.65608734",
"0.65588295",
"0.6556141",
"0.6550285",
"0.65337914",
"0.65330654",
"0.65249157",
"0.6506557",
"0.6500025",
"0.64962554",
"0.6493231",
"0.6484734",
"0.64835227",
"0.64647764",
"0.64459836",
"0.64446336",
"0.6420578",
"0.6420262",
"0.63990116",
"0.6390374",
"0.6382191",
"0.63654464",
"0.6361166",
"0.63252395",
"0.6318575",
"0.6302968",
"0.6284996",
"0.6250877",
"0.62479436",
"0.62406474",
"0.6233542",
"0.61735654",
"0.6159116",
"0.61257786",
"0.6120318",
"0.61047137",
"0.61040044",
"0.6102862",
"0.6100755",
"0.60925406",
"0.60797375",
"0.60729015",
"0.60481596",
"0.60470724",
"0.60344785",
"0.6030346",
"0.6027031",
"0.60268086",
"0.6022531",
"0.6015351",
"0.60140514",
"0.60016775",
"0.5995053",
"0.59702957",
"0.59695876",
"0.5959309"
] | 0.79216474 | 1 |
Gets all next possible unvisited destinations | def possible_destinations(position)
possible_moves = possible_moves_in_board(position)
possible_destinations = possible_moves.map do |move|
[move[0] + position[0], move[1] + position[1]]
end.uniq
possible_destinations - visited_destinations
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_paths(start)\n step = 0\n visited = []\n unvisited = [[board_node_by_location(start),step]]\n \n while !unvisited.empty?\n node = unvisited[0][0]\n step = unvisited[0][1] + 1\n \n node.neighbors.each do |x|\n if not_visited(board_node_by_location(x),visited, unvisited)\n unvisited << [board_node_by_location(x),step]\n end\n end\n visited << unvisited.shift\n end\n return visited\nend",
"def destinations\n @destinations ||= []\n end",
"def countries_visited\n if !self.destinations_visited.nil?\n self.destinations_visited.map do |dest|\n dest.country\n end.compact.uniq\n end\n end",
"def get_allpaths(source, dest, visited, path)\n # mark visited\n visited[source] = 1\n path << source\n\n if source.eql? dest\n @paths << path.dup\n else\n # recurse for all neighboring nodes\n @nnmap[source].each do |n|\n get_allpaths(n, dest, visited, path) if visited[n].eql? 0\n end\n end\n\n path.pop\n visited[source] = 0\n end",
"def reachable_states\n visited_states = Set.new()\n unvisited_states = Set[@start_state]\n begin\n outbound_transitions = @transitions.select { |t| unvisited_states.include?(t.from) }\n destination_states = outbound_transitions.map(&:to).to_set\n visited_states.merge(unvisited_states) # add the unvisited states to the visited_states\n unvisited_states = destination_states - visited_states\n end until unvisited_states.empty?\n visited_states\n end",
"def shortest_paths(src, destinations)\n return [] if destinations.empty?\n\n paths = []\n visited = Set.new([src])\n queue = Containers::MinHeap.new\n queue.push([1, [src]])\n\n until queue.empty?\n _, path = queue.pop\n\n # Not going to find shorter paths than current best, return.\n break if paths.any? && paths[0].size < path.size\n\n cur = path.last\n paths << path if destinations.include?(cur)\n\n neighbors(cur).each do |pos|\n next if visited.include?(pos) || occupied?(pos)\n\n visited.add(pos)\n new_path = Array.new(path.size) { |i| path[i].dup }\n new_path << pos\n queue.push([new_path.size, new_path])\n end\n end\n\n paths\n end",
"def enum_moves\n @scratch = dup_maze(@maze)\n @locs.each_with_index do |loc, robot|\n @cost = 1\n leading_edge = [loc]\n loop do\n next_edge = []\n leading_edge.each do |x, y|\n next_edge.concat search_from(x, y, robot)\n end\n break if next_edge.empty?\n leading_edge = next_edge\n @cost += 1\n end\n end\n\n @moves\n end",
"def shortest_paths(dest)\n position = dest\n final = {}\n analisados = {}\n route = []\n route << dest\n @previous['a'] = -1\n\n @nodes.each do |n|\n analisados[n] = false\n end\n analisados[position] = true\n\n while analisados(analisados)\n adyacentes(position, analisados).each do |n|\n if @distance[n] == (@distance[position] - graph[n][position])\n @previous[position] = n\n position = n\n route << n\n end\n analisados[n] = true\n end\n\n end\n route << 'a'\n route\n end",
"def traverse (from, to, points_visited_so_far = [])\n \n return points_visited_so_far if from.eql?(to)\n\n # Select those adjacent points that that has not been already traversed\n # and that do not represent walls\n possible_steps = adjacent_traversible_points(from).select { |point| \n (not points_visited_so_far.include?(point))\n }\n\n # For each possible step, take that step, and find out the list of points\n # that need to be traversed to reach \"to\" point. In case there were more\n # than one possible steps, pick the one that has smaller number of steps\n # to destination\n points_to_destination_from_here = []\n possible_steps.each do |point|\n traversal_result = traverse(point, to, points_visited_so_far + [point])\n if not traversal_result.empty?\n points_to_destination_from_here = traversal_result if \n (points_to_destination_from_here.empty? or\n traversal_result.size < points_to_destination_from_here.size)\n end\n end\n \n return points_to_destination_from_here\n\n end",
"def shortest_path_to_all_nodes(initial)\n initial.distance = 0\n\n current = initial\n loop do\n unvisited.delete(current)\n\n calculate_neighbor_shortest_distances(current)\n\n return graph.vertices if no_reachable_nodes\n\n current = unvisited.min_by(&:distance)\n end\n end",
"def find_reachable_adjacents\n\t\tfind_all_adjacents.select { |p| (is_free?(p) && !@closed.include?(p)) }\n\tend",
"def missed_destinations(chosen_road)\n # An array of all the roads left behind\n roads_left_behind = roads_available.reject {|road| road == chosen_road }\n # collect the destination left behind with those roads \n roads_left_behind.map { |road| road.the_city_opposite(@current_city)}\n\n end",
"def possible_moves(start_node, destination)\n\t\n\t\tif start_node.value == destination\n\t\t\treturn start_node\n\t\telse\n\t\t\tgame.visited << start_node\n\t\t\tgame.unvisited = game.unvisited + (set_parent(start_node, possible_positions(start_node.value)) - game.visited)\n\t\t\tgame.unvisited.each do |position_node|\n\t\t\t\tif position_node.value == destination\n\t\t\t\t\treturn position_node\n\t\t\t\tend\n\t\t\t\tgame.visited << position_node\n\t\t\tend\n\t\t\tpossible_moves(game.unvisited.shift,destination) if game.unvisited.first != nil \n\t\tend\n\tend",
"def next_step_from(paths)\n paths.map do |path|\n possible_neighbours(path.most_recent_step.coordinate, @max_x, @max_y) \n .map { |c| coord_to_step_on_path(c, path) }\n .reject { |p| p == nil }\n end\n .flatten\n end",
"def compute_unreachable_states\n queue = [starting_state].to_set\n transitions = self.each_transition.to_a.dup\n\n done_something = true\n while done_something\n done_something = false\n transitions.delete_if do |from, _, to|\n if queue.include?(from)\n queue << to\n done_something = true\n end\n end\n end\n\n transitions.map(&:first).to_set\n end",
"def shortest_path\n initial_position_obj = { position: start_position, source: {} }\n\n knights_path = [initial_position_obj]\n\n while knights_path.present?\n current_position = knights_path.shift\n\n position = current_position[:position]\n\n if position == end_position\n return path_to_destination(current_position, initial_position_obj)\n end\n\n add_possible_destination(position, current_position, knights_path)\n end\n end",
"def extract_target_nodes_from_path(visited_nodes)\n connected_to(visited_nodes.last).select do |node|\n i = visited_nodes.index(node) \n i && (unvisited_neighbours_of(visited_nodes[i + 1], visited_nodes).length > 0)\n end\n end",
"def find_path()\n visited = Array.new(8) {Array.new(8)}\n return [] if @destination == @currentPosition\n paths = [[@currentPosition]]\n visited[@currentPosition[0]][@currentPosition[1]] = true\n\n until paths.empty?\n new_paths = []\n paths.each do |path|\n next_positions = possibleMoves(path.last, visited)\n next_positions.each do |move|\n newpath = path.dup << move\n if move == @destination #if we reached our destination stop and return the path\n return newpath\n end\n visited[move[0]][move[1]] = true\n new_paths.push(newpath)\n end\n end\n paths = new_paths\n end\n end",
"def destinations(board)\n #selects destinations that are on the board\n dest_array = @moves.select do |move|\n move = [move[0] + @pos[0], move[1] + @pos[1]]\n move.all? {|i| (0..7).include?(i)}\n end\n\n #selects only destinations that are empty or have the opponents piece on it\n dest_array = dest_array.select do |pos|\n piece = board[pos[0]][pos[1]]\n piece.nil? || piece.player != @player\n end \n end",
"def lesstrips_dfs(start, finish, max_distance, distance, visited, path, paths, cycles)\n adj_vertices(visited.last, adj_lists).each do |vertex|\n print \"Visited stack: #{visited}, Next vertex: #{vertex}\\n\"\n totald = distance + dist(visited.last, vertex)\n\n if visited.last == finish && cycles != \"NO CYCLES EXIST\"\n\n # try adding cycles\n\n visited_before_cycles = visited\n # picks expanded cycles that begin with finish vertex\n ec = expanded_cycles(cycles).select{|c| c.first == finish}\n\n # keep adding cycles till we reach max distance\n ec.each do |cycle1|\n visited, paths, break_loop = try_cycles(visited, cycle1, paths, 0, max_distance)\n visited1 = visited\n\n ec.each do |cycle2|\n begin\n visited, paths, break_loop = try_cycles(visited, cycle2, paths, 0, max_distance)\n end until break_loop\n visited = visited1\n end\n\n visited = visited_before_cycles\n end\n\n elsif !visited.include?(vertex) && totald != \"NO SUCH ROUTE\" && totald < max_distance\n visited << vertex\n path = visited\n distance = totald\n\n if vertex == finish\n paths << path\n print \"\\n*** Path: #{path}, Length: #{path_length(path)}\\n\\n\"\n visited.pop\n break\n end\n\n lesstrips_dfs(start, finish, max_distance, distance, visited, path, paths, cycles)\n visited.pop\n visited.pop if visited.size.between?(2, 3)\n visited = [start] if visited == []\n end\n end\n paths.size\n end",
"def path_finder \n until queue.empty? \n current_node = queue.shift()\n generate_neighbours(current_node)\n current_node.neighbour_nodes.each do |neighbour|\n track_visited(current_node, neighbour)\n correct_node?(neighbour) ? (return neighbour.visited) : (queue << neighbour)\n end\n end\n end",
"def all_hops_adjacent_to_dst_as\n adjacent_hops = []\n return adjacent_hops unless valid?\n\n dst_as = @hops[0].asn\n\n return adjacent_hops if dst_as.nil?\n\n @hops.each do |hop| \n adjacent_hops << hop\n break if hop.asn != dst_as \n end\n\n adjacent_hops\n end",
"def lesstrips(start, finish, max_distance)\n total_paths, distance = 0, 0\n path, paths = [], []\n visited = [start]\n cycles = all_cycles # all cycles in graph\n puts \"MAX DISTANCE = #{max_distance}\\n\"\n total_paths += lesstrips_dfs(start, finish, max_distance, distance, visited, path, paths, cycles)\n puts \"\\n==> Total paths from #{start} to #{finish}, with distance < #{max_distance}: #{total_paths}\\n\"\n total_paths\n end",
"def find_possible_trips(starting_route, starting_time, max_stops, stops_visited=[])\n self.class.possible_trips.clear\n traverse_stops(starting_route, starting_time, max_stops, stops_visited=[])\n self.class.possible_trips.dup #.uniq\n end",
"def explore(start)\n visited = Hash.new(false)\n visited[start] = true \n start.out_edges.each do |edge|\n explore(edge.dest) if !visited[edge.dest]\n end\n return visited\n end",
"def transitions_from(station)\n stations.select do |destination| \n has_edge?(station.to_sym, destination)\n end\n end",
"def destinations\n [to_addrs, cc_addrs, bcc_addrs].compact.flatten\n end",
"def calculate_moves(destination)\n path = []\n queue = [@current_position]\n # thanks to https://github.com/thomasjnoe/knight-moves for help with this visited concept\n visited = []\n\n return \"You're already there\" if @current_position.square == destination\n\n until queue.empty? \n current_move = queue.shift\n visited << current_move\n\n if current_move.square == destination\n path_move = current_move\n until path_move == @current_position\n path.unshift(path_move.square)\n path_move = path_move.parent\n end\n path.unshift(@current_position.square)\n puts \"You made it in #{(path.length - 1).to_s} moves. Here's your path: \"\n path.each do |s|\n p s\n end\n return path\n end\n\n current_move.next_placements = get_possible_moves_for(current_move).select { |move| !visited.include?(move) } \n\n current_move.next_placements.each do |placement|\n queue << placement\n visited << placement\n end\n end\n end",
"def towns_to_destination(matrix:, start: 0, destination:)\n visited = {}\n visited[start] = true\n queue = [[start]]\n\n return 0 if start == destination\n\n # towns after start\n until visited.key?(destination)\n last = queue[-1]\n queue << []\n last.each do |p|\n matrix[p].each_with_index do |ele, index|\n if ele != start && !visited.key?(index)\n queue[-1] << index\n visited[index] = true\n end\n end\n end\n end\n queue.length - 1\nend",
"def find_destinations(unit)\n @units\n .select { |u| u.alive? && u.type != unit.type }\n .flat_map { |u| neighbors(u.pos).to_a }\n .reject { |p| occupied?(p) }\n end",
"def build_path(start, finish)\n path = [finish]\n loop do\n vertex = path.last\n d = graph[*vertex]\n neighbours = get_neighbours(*vertex)\n next_vertex = neighbours.select{|n_vert| graph[*n_vert] == d - 1}.first\n path << next_vertex if next_vertex\n break if vertex == start\n end\n path\n end",
"def next_states\n possible = []\n # possible states going up\n possible += next_states_in_dir(1) if @elevator != 3\n # possible states going down only make sense if there are actually some items available at lower floors\n items_lower = @floors[0...@elevator].map { |floor| floor.length }.sum\n possible += next_states_in_dir(-1) if (@elevator != 0) && (items_lower > 0)\n\n return possible\n end",
"def make_paths\n visited = {}\n path = []\n return path if @nmap.empty? || @nnmap.empty?\n\n # 0 is false\n @nmap.each do |k, _|\n visited[k] = 0\n end\n\n # for each node that is not an end node to an end node\n @nnmap.each do |s, _|\n # if s is an end node\n @paths << [s] if @ends.include? s\n\n # for each end node as desintation\n @ends.each do |d|\n get_allpaths(s, d, visited, path)\n end\n end\n @paths.sort_by(&:length).reverse\n end",
"def possible_directions(coordinates)\n previous_coordinate = coordinates.last\n DIRECTIONS.reject.with_index do |direction, index|\n coordinates.include?(next_coordinate(previous_coordinate, direction))\n end\n end",
"def next_nodes\n transitions.map(&:target)\n end",
"def shortest_path_between_nodes(initial, destination)\n initial.distance = 0\n\n current = initial\n loop do\n # at the destination node, stop calculating\n break if current == destination\n\n unvisited.delete(current)\n\n calculate_neighbor_shortest_distances(current)\n\n return nil if no_reachable_nodes\n\n current = unvisited.min_by(&:distance)\n end\n\n destination.path\n end",
"def greedy_salesman (cities)\n path = []\n not_visited = cities\n path.push(not_visited.shift)\n loop do\n current = path.last\n # for testing, only prints if PRINT_STEPS is set to true at the top of the file\n puts \"current: \" + current.name + \" (\" + current.x.round(2).to_s + \",\" + current.y.round(2).to_s + \")\" if PRINT_STEPS\n next_city = nearest_possible_neighbor(current,not_visited)\n path.push(not_visited.delete(next_city))\n break if not_visited.empty?\n end\n path\nend",
"def get_next_possible_edges(edges_history, current_node)\n possible_edges = []\n \n @edges.each do |edge|\n if edges_history == nil or edges_history.find {|old_edge| old_edge == edge } == nil\n if current_node == edge[0] or current_node == edge[1]\n possible_edges << edge\n end\n end\n end\n\n possible_edges\n end",
"def find_all_non_visited_cities\n all_cities = cities()\n non_visited = []\n for city in all_cities\n if city.visited == 0\n non_visited.push(city)\n end\n end\n return non_visited\n end",
"def selected_next_edges\n @next_summit = @edges_distances.select{ |edges| edges.include?(@next_summit.first.select{ |distance| distance > 0}.min)if edges != @next_summit && edges != @first_position }\n end",
"def reachable_cells(x, y, world)\n visited = []\n queue = [[x, y]]\n\n while !queue.empty?\n start = queue.pop\n neighbors = DIRECTIONS.values.\n map {|d| [start[0] + d[:x], start[1] + d[:y]]}.\n select {|x,y| world[y][x] == '.' }\n new_cells = neighbors - visited\n queue = queue + new_cells\n visited.push(start)\n end\n\n visited\nend",
"def all_following_transitions\n all = [] + available_transitions[:allow]\n following_transitions.each do |t|\n t = Restfulie::Server::Transition.new(t[0], t[1], t[2], nil) if t.kind_of? Array\n all << t\n end\n all\n end",
"def valid_neighbours(current)\n DIRECTION_VECTORS.values\n .map { |dir_vec| current + dir_vec }\n .select { |loc| OPEN_TILES.include?(@points[loc]) }\n end",
"def endpoints\n connectors = {\n :NW => [2, 2],\n :SE => [98, 98],\n :NE => [98, 2],\n :SW => [2, 98],\n :N => [50, 0],\n :S => [50, 100],\n :E => [100, 50],\n :W => [0, 50]\n }\n shortest_path = 1000000\n generated_endpoints = []\n connectors.each do |from_key, from_connector|\n ep_from = [from.x + from_connector[0], from.y + from_connector[1]]\n connectors.each do |to_key, to_connector|\n ep_to = [to.x + to_connector[0], to.y + to_connector[1]]\n path = Math.sqrt(((ep_from[0] - ep_to[0]).abs ** 2) + ((ep_from[1] - ep_to[1]).abs ** 2)).to_i\n if path < shortest_path + 25\n shortest_path = path\n generated_endpoints = [ep_from, ep_to]\n end\n end\n end\n return generated_endpoints\n end",
"def knight_moves(start, finish)\n tree = MoveTree.new(start)\n queue = [tree]\n result = nil\n visited_points = Set.new()\n while queue.length > 0\n current_node = queue.shift\n visited_points.add(current_node.point)\n if current_node.point == finish\n result = get_path(current_node)\n break\n else\n propagate_tree(current_node)\n queue += current_node.children.reject { |n| visited_points.include?(n.point) }\n end\n end\n result\nend",
"def next_steps\n @cell.neighbours.map do |cell|\n Step.new(cell:cell,number:@number+1,previous:self)\n end.reject { |step| (step.cell.status == :wall)}.reject do |step|\n step.cell == @previous.cell if @previous \n # we must add 'if @previous' since, if it's the starting cell,\n # @previous is nil.\n end\n end",
"def neighbours_off_end(node)\n # Find all arcs that include this node in the right place\n passable_nodes = []\n @arcs.get_arcs_by_node_id(node.node_id).each do |arc|\n if arc.begin_node_id == node.node_id and arc.begin_node_direction\n # The most intuitive case\n passable_nodes.push nodes[arc.end_node_id]\n elsif arc.end_node_id == node.node_id and !arc.end_node_direction\n passable_nodes.push nodes[arc.begin_node_id]\n end\n end\n return passable_nodes.uniq\n end",
"def dijkstras(start=@vertices.keys.sort[0],goal=nil)\n\t\t# Set of visited nodes\n\t\tvisited = []\n\n\t\t# Step 1 \n\t\t# - Start node weighs 0\n\t\t# - Set all other to infinity its done in constructor already\n\t\t@vertices[start] = 0\n\n\t\t# Step 2 \n\t\t# - Set initial node as current\n\t\t# - Mark all nodes unvisited except start node\n\t\tunvisited = @vertices.keys - [start]\n\t\tcurrent = start\n\n\t\twhile(!unvisited.empty?)\n\t\t\t# Step 3\n\t\t\t# - Consider all neighbors of current node\n\t\t\t# - Calculate distance cost: current path weight + edge weight\n\t\t\t# - Update distance if this distance is less than recorded distance\n\t\t\t\n\t\t\t@map[current].each do |neighbor|\n\t\t\t\tnext if visited.include?(neighbor.to)\n\t\t\t\tweight = @vertices[current] + neighbor.weight.to_i\n\t\t\t\tif weight < @vertices[neighbor.to]\n\t\t\t\t\t@vertices[neighbor.to] = weight\n\t\t\t\t\t@prev[neighbor.to] = current\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Step 4\n\t\t\t# - Add current node to visited\n\t\t\t# - Remove current node from unvisited\n\t\t\tvisited << current\n\t\t\tunvisited -= [current]\n\n\t\t\t# Find the smallest weighted node\n\t\t\tcurrent = unvisited.collect { |node| [@vertices[node],node] }\n\t\t\tcurrent.empty? ? current = @infinity : current = current.min[1]\n\n\t\t\t# Step 5\n\t\t\t# - If goal is in visited, stop\n\t\t\t# - If full traversal without a goal? \n\t\t\t# \tCheck for infinity weighted node\n\t\t\tif visited.include? goal\t\t\n\t\t\t\tpath(goal)\n\t\t\t\treturn\n\t\t\tend\n\t\t\tbreak if current == @infinity\n\t\tend\n\t\t\n\t\t# Print all shortest paths\n\t\tputs \"Initial Node: #{start}\"\n\t\tvisited.each do |x|\n\t\t\tpath(x)\n\t\t\tputs\n\t\tend\n\tend",
"def dijkstras(start=@vertices.keys.sort[0],goal=nil)\n\t\t# Set of visited nodes\n\t\tvisited = []\n\n\t\t# Step 1 \n\t\t# - Start node weighs 0\n\t\t# - Set all other to infinity its done in constructor already\n\t\t@vertices[start] = 0\n\n\t\t# Step 2 \n\t\t# - Set initial node as current\n\t\t# - Mark all nodes unvisited except start node\n\t\tunvisited = @vertices.keys - [start]\n\t\tcurrent = start\n\n\t\twhile(!unvisited.empty?)\n\t\t\t# Step 3\n\t\t\t# - Consider all neighbors of current node\n\t\t\t# - Calculate distance cost: current path weight + edge weight\n\t\t\t# - Update distance if this distance is less than recorded distance\n\t\t\t\n\t\t\t@map[current].each do |neighbor|\n\t\t\t\tnext if visited.include?(neighbor.to)\n\t\t\t\tweight = @vertices[current] + neighbor.weight.to_i\n\t\t\t\tif weight < @vertices[neighbor.to]\n\t\t\t\t\t@vertices[neighbor.to] = weight\n\t\t\t\t\t@prev[neighbor.to] = current\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Step 4\n\t\t\t# - Add current node to visited\n\t\t\t# - Remove current node from unvisited\n\t\t\tvisited << current\n\t\t\tunvisited -= [current]\n\n\t\t\t# Find the smallest weighted node, could use a PQueue instead\n\t\t\tsmallest = @infinity\n\t\t\tcurrent = @infinity\n\t\t\tunvisited.each do |node|\n\t\t\t\tif @vertices[node] < smallest\n\t\t\t\t\tsmallest = @vertices[node]\n\t\t\t\t\t# Step 6\n\t\t\t\t\t# - Set smallest weighted node as current node, continue\n\t\t\t\t\tcurrent = node\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Step 5\n\t\t\t# - If goal is in visited, stop\n\t\t\t# - If full traversal without a goal? \n\t\t\t# \tCheck for infinity weighted node\n\t\t\tif visited.include? goal\t\t\n\t\t\t\tpath(goal)\n\t\t\t\treturn\n\t\t\tend\n\t\t\tbreak if current == @infinity\n\t\tend\n\t\t\n\t\t# Print all shortest paths\n\t\tputs \"Initial Node: #{start}\"\n\t\tvisited.each do |x|\n\t\t\tpath(x)\n\t\t\tputs\n\t\tend\n\tend",
"def traverse_road(next_field,vt=Set.new,solution)\n @visited_tiles = vt\n avail_pos = available_ways_to_go_to(next_field,solution).to_set - @visited_tiles\n\n @visited_tiles << next_field\n avail_pos.each do |nf|\n if ((solution[nf[0],nf[1]] == 0) && (!@visited_tiles.include? nf))\n # print_board create_solution_board @visited_tiles\n traverse_road(nf,@visited_tiles,solution)\n end\n end\n @visited_tiles\n end",
"def reachable(c)\n\t\t@reachable[c] ||= DIRECTIONS.inject([]) { |r, d|\n\t\t\tnext(r) if self[p = c + d] == :wall\n\t\t\tr << p\n\t\t}.freeze\n\tend",
"def getRoutesTo(station)\n routeList = @toNodeMap[station]\n \n return routeList == nil ? [] : routeList\n end",
"def possibleMoves(arr,visited)\n moves = []\n VALID_MOVES.each do |x,y|\n if valid?([arr[0]+x,arr[1]+y],visited)\n moves.push([arr[0]+x,arr[1]+y])\n end\n end\n return moves\n end",
"def adjacent\r\n arr = @locs.flat_map { |x| x.each_link.to_a }.flat_map { |x| @nav.map[x] }\r\n NavLocationLens.new @nav, arr.to_a\r\n end",
"def unused_paths(start_node, end_node, graph)\n graph - shortest_path(start_node, end_node, graph)\n end",
"def get_outgoing_routes(city)\n\n route_dict = {}\n\n # edges_dict will be a Hash of destinations (keys) and route data (values)\n edges_dict = @query.json_graph_api.get_outgoing_edges(city)\n edges_dict.each { |dest, data| route_dict.store(get_city_info(dest,\"name\"), data[\"distance\"]) }\n\n return route_dict\n\n end",
"def next_states(already_seen)\n # If there are no more available states to analyze,\n # {BfsBruteForce::Solver#solve} will throw a {BfsBruteForce::NoSolution}\n # exception.\n return if @value > @final\n\n # already_seen is a set passed to every call of next_states.\n # You can use this set to record which states you have previously\n # visited, from a shorter path, avoiding having to visit that\n # same state again.\n #\n # Set#add?(x) will return nil if x is already in the set\n if already_seen.add?(@value + 10)\n yield \"Add 10\", AdditionPuzzleState.new(@value + 10, @final)\n end\n\n if already_seen.add?(@value + 1)\n yield \"Add 1\", AdditionPuzzleState.new(@value + 1, @final)\n end\n end",
"def all_paths_source_target(graph)\n current_path = []\n results = []\n\n dfs(graph, results, 0, current_path)\n return results\nend",
"def neighbours(e)\n\t\tneighbours = []\n\t\t@e.each do |edge|\n\t\t\tneighbours << edge.dest if edge.src == e\n\t\tend\n\t\tneighbours\n\tend",
"def reachable_nodes\n recursive_set(@start) { |n| n.out }\n end",
"def get_paths(source, target, iterate_only_if=nil, &result_filter)\n iterate_only_if = result_filter if iterate_only_if.nil?\n queue=[[0, source]]\n result=[]\n while queue.any?\n node = queue.shift\n @graph.each_adjacent(node.last) do |edge, weight|\n nnode = node.dup\n nnode[0]= node[0] + weight\n nnode << edge\n nlevel = nnode.length - 2\n if edge == target\n if result_filter.call(nnode[0], nlevel)\n result << nnode\n end\n end\n\n if iterate_only_if.call(nnode[0], nlevel)\n queue << nnode\n end\n end\n end\n result\n end",
"def get_destination_ids\n destination_ids = []\n get_choices.each do |choice|\n destination_ids << choice.destination_id\n end\n destination_ids\n end",
"def neighbors(node,destination)\n nodes = []\n roads = roads(node)\n roads.each { |r| nodes << (r.end1 == node ? r.end2 : r.end1) }\n\n nodes.sort! { |a,b| distance(a,destination) <=> distance(b,destination) }\n end",
"def possible_moves\n return []\n end",
"def get_moves(start)\n x = start.x\n y = start.y\n moves = []\n moves << Node.new(x+2, y+1)\n moves << Node.new(x+2, y-1)\n moves << Node.new(x+1, y+2)\n moves << Node.new(x+1, y-2)\n moves << Node.new(x-1, y+2)\n moves << Node.new(x-1, y-2)\n moves << Node.new(x-2, y+1)\n moves << Node.new(x-2, y-1)\n moves = moves.reject do |node|\n node.x < 0 || node.x > 8\n end\n moves = moves.reject do |node|\n node.y < 0 || node.y > 8\n end\n moves.each { |move| move.next_node = start }\nend",
"def index\n @relay_destinations = @relay.relay_destinations.order(base_url: :asc).all\n end",
"def infinite_loops\n reachable_sets = @nodes.group_by(&:forward)\n reachable_sets.each do |reachable,nodes|\n yield reachable if reachable == nodes.to_set\n end\n end",
"def solve_dijkstra\n\n unvisited_set = @unvisited_set.dup\n\n # create a queue for nodes to check\n @queue = []\n current_node = @start_node\n @queue << current_node\n\n # Stop If there are no unvisited nodes or the queue is empty\n while unvisited_set.size > 0 && @queue.size > 0 do\n\n # set the current node as visited and remove it from the unvisited set\n current_node = @queue.shift\n\n # remove visited node from the list of unvisited nodes\n unvisited_set.delete(current_node)\n\n # find the current node's neighbours and add them to the queue\n rolling_node = @node_list.find { |hash| hash[:id] == current_node }\n rolling_node[:neighs].each do |p|\n # only add them if they are unvisited and they are not in the queue\n if unvisited_set.index(p) && !@queue.include?(p)\n @queue << p\n # set the previous node as the current for its neighbours\n change_node = @node_list.find { |hash| hash[:id] == p }\n change_node[:prev] = current_node\n # increase the distance of each node visited\n change_node[:dist] = rolling_node[:dist] + @step\n end\n end\n\n if current_node == @goal_node\n find_shortest_path(rolling_node)\n break\n end\n end\n return @shortest_path_coords\n end",
"def _all_gp_dest_src\n (0..7).each do |dest_reg|\n (0..7).each do |src_reg|\n if src_reg != dest_reg\n yield \"r#{dest_reg}\", \"r#{src_reg}\"\n end\n end\n end\n end",
"def shortest_path( dest, exclusions = [] )\n exclusions ||= []\n previous = shortest_paths( exclusions )\n s = []\n u = dest.hex\n while previous[ u ]\n s.unshift u\n u = previous[ u ]\n end\n s\n end",
"def get_redundant_resistors(nw)\n#\n# Get a unique list of path names.\n# Get the list of paths in the shortest route.\n# Get the difference - this is the redundant set of paths (bi-directional).\n# Remove the duplicates to get the required result (see below)\n#\n all_paths = (nw.path_list.collect {|p| [p.from, p.to]})\n min_paths = nw.min_cost_routes.first.path_list.collect {|p| [p.from, p.to]}\n #\n # The difference (all_paths - min_paths) is the true list of redundant paths\n # taking into account that the network is implemented as bidirectional, so\n # that each path exists twice, once in each direction, from one node to the\n # other.\n # The reverse paths are therefore removed to arrive at the required output\n # list of redundant resistors.\n #\n redundant_resistors = (all_paths.collect {|p| p.sort.join('_')}).uniq - (min_paths.collect {|p| p.join('_')})\n redundant_resistors.collect {|r| nw.path(r).to_a}\nend",
"def find_path(source, target, map)\n @main_loop_count = 0\n\n max_y = map.size - 1\n max_x = map[0].size - 1\n target_x = target[0]\n target_y = target[1]\n # target heuristic is 0\n target = [target_x, target_y, 0]\n\n # Sets up the search to begin from the source\n source = source.dup.push((target_x - source[0]).abs + (target_y - source[1]).abs)\n came_from = {}\n came_from[source] = nil\n frontier = [source]\n\n # Until the target is found or there are no more cells to explore from\n until came_from.has_key?(target) || frontier.empty?\n @main_loop_count += 1\n\n # Take the next frontier cell\n new_frontier = frontier.shift\n\n # Find the adjacent neighbors\n adjacent_neighbors = []\n\n # Gets all the valid adjacent_neighbors into the array\n # From southern neighbor, clockwise\n nfx = new_frontier[0]\n nfy = new_frontier[1]\n adjacent_neighbors << [nfx , nfy - 1, (target_x - nfx).abs + (target_y - nfy + 1).abs] unless nfy == 0\n adjacent_neighbors << [nfx - 1, nfy - 1, (target_x - nfx + 1).abs + (target_y - nfy + 1).abs] unless nfx == 0 || nfy == 0\n adjacent_neighbors << [nfx - 1, nfy , (target_x - nfx + 1).abs + (target_y - nfy).abs] unless nfx == 0\n adjacent_neighbors << [nfx - 1, nfy + 1, (target_x - nfx + 1).abs + (target_y - nfy - 1).abs] unless nfx == 0 || nfy == max_y\n adjacent_neighbors << [nfx , nfy + 1, (target_x - nfx).abs + (target_y - nfy - 1).abs] unless nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy + 1, (target_x - nfx - 1).abs + (target_y - nfy - 1).abs] unless nfx == max_x || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy , (target_x - nfx - 1).abs + (target_y - nfy).abs] unless nfx == max_x\n adjacent_neighbors << [nfx + 1, nfy - 1, (target_x - nfx - 1).abs + (target_y - nfy + 1).abs] unless nfx == max_x || nfy == 0\n\n new_neighbors = adjacent_neighbors.select do |neighbor|\n # That have not been visited and are not walls\n unless came_from.has_key?(neighbor) || map[neighbor[1]][neighbor[0]] != '.'\n # Add them to the frontier and mark them as visited\n # frontier << neighbor\n came_from[neighbor] = new_frontier\n end\n end\n\n # Sort the frontier so cells that are close to the target are then prioritized\n if new_neighbors.length > 0\n new_neighbors = merge_sort(new_neighbors)\n if frontier.length > 0 && new_neighbors[0][2] >= frontier[0][2]\n frontier = merge_sort(new_neighbors.concat(frontier))\n else\n frontier = new_neighbors.concat(frontier)\n end\n end\n end\n\n # If the search found the target\n if came_from.has_key?(target)\n # Calculates the path between the target and star for the greedy search\n # Only called when the greedy search finds the target\n path = []\n next_endpoint = came_from[target]\n while next_endpoint\n path << [next_endpoint[0], next_endpoint[1]]\n next_endpoint = came_from[next_endpoint]\n end\n path\n else\n return nil\n end\n end",
"def indirects\n chains.map{|c| (c.slice(2,c.length-2) || [])}.flatten.uniq\n end",
"def generate_neighbours(current_node)\n moves = [[ 1, 2], [-1, 2], [ 1,-2], [-1,-2], [ 2, 1], [-2, 1], [ 2,-1], [-2,-1]]\n moves.each do |move|\n neigbour_helper(current_node, move[0], move[1])\n end\n end",
"def destinations\n bookmarks = @medium.manuscript.metadata['bookmarks'] || []\n bookmarks.map { |b| b['destination'] }\n end",
"def find_path(goal = @maze.find_end)\n path = [goal]\n spot = goal\n until @branching_paths[spot] == nil\n path << @branching_paths[spot]\n spot = @branching_paths[spot]\n end\n path\n end",
"def moves\n possible_moves = []\n\n self.move_dirs.each do |dir|\n num_steps = 1\n blocked = false\n\n until blocked\n next_step = [dir[0]*num_steps, dir[1]*num_steps]\n next_pos = [self.pos[0] + next_step[0], self.pos[1] + next_step[1]]\n\n break unless next_pos.all? { |i| i.between?(0,7) }\n\n if self.board[next_pos]\n blocked = true\n possible_moves << next_pos unless self.color == self.board[next_pos].color\n else\n possible_moves << next_pos\n num_steps += 1\n end\n end\n end\n\n possible_moves\n end",
"def routes\n @logger.info \"#{__method__}\"\n fill_in \"JourneyPlanner$txtNumberOfPassengers\", with: \"1\"\n country_routes = list_countries.inject([]) do |country_result, country|\n @logger.info \"routes for #{country}\"\n select(country, :from => \"JourneyPlanner_ddlLeavingFromState\")\n sleep 3\n to_from = list_leaving_from.inject([]) do |from_result, from|\n @logger.info \"routes from #{from}\"\n sleep 2\n select(from, :from => \"JourneyPlanner$ddlLeavingFrom\")\n from_result << {from => list_travelling_to}\n from_result\n end\n country_result << {country => to_from}\n country_result\n end\n end",
"def available_moves\n adjacent_tiles(*@hole)\n end",
"def shortest_path(start, finish)\n queue << [start, 0]\n loop do\n break if queue.empty?\n vertex, d = queue.pop\n graph[*vertex] = d\n break if vertex == finish\n enqueue_neighbours(*vertex, d + 1)\n end\n queue.clear\n !blank?(finish) ? build_path(start, finish) : []\n end",
"def connectedRoutes(city)\r\n results = @edge.select{ |code, cname| code.include?(city)}\r\n end",
"def shortest_paths( exclusions = [] )\n # Initialization\n exclusions ||= []\n source = hex\n dist = Hash.new\n previous = Hash.new\n q = []\n @game.map.each do |h|\n if not exclusions.include? h\n dist[ h ] = INFINITY\n q << h\n end\n end\n dist[ source ] = 0\n \n # Work\n while not q.empty?\n u = q.inject { |best,h| dist[ h ] < dist[ best ] ? h : best }\n q.delete u\n @game.map.hex_neighbours( u ).each do |v|\n next if exclusions.include? v\n alt = dist[ u ] + entrance_cost( v )\n if alt < dist[ v ]\n dist[ v ] = alt\n previous[ v ] = u\n end\n end\n end\n \n # Results\n previous\n end",
"def choose_next_waypoint(current_waypoint, destination, min_search_radius, max_search_radius)\n current_waypoint.find_potential_next_waypoints(destination, min_search_radius, max_search_radius).sample\n end",
"def find_journey(city1, city2, graph_instance)\n distance, previous = find_shortest_journey(city1, city2, graph_instance)\n puts \"Shortest distance is #{distance} with stopovers at\"\n c = city2\n while(true)\n if(c == city1)\n break\n end\n puts \"#{previous[c]}\"\n c = previous[c]\n end\nend",
"def knight_path(from, to)\r\n\topen_queue = [PositionPath.new( from, [copy(from)] )]\r\n\tputs open_queue.inspect\r\n\tputs open_queue.empty?\r\n\tdiscovered = [from]\r\n\r\n\tuntil open_queue.empty?\r\n\t\tcurrent = open_queue.shift\r\n\t\tputs current.inspect\r\n\r\n\t\treturn current.path if current.position == to\r\n\t\tvalid_moves(current.position).each do |move|\r\n\t\t\tputs \"ruch #{move} jest ok\"\r\n\t\t\tunless discovered.include?(move)\r\n\t\t\t\tputs \"tego ruchu jeszce nie bylo = #{move}\"\r\n\t\t\t\tdiscovered << move\r\n\t\t\t\topen_queue.push(make_position_path(current, move)) \r\n\t\t\t\tputs \"open_queue = #{open_queue.size}\"\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\t\r\nend",
"def knight_moves(start, destination)\n\t\tnode = possible_moves(Node.new(start), destination)\n\t\tpath = []\n\t\twhile node.parent != nil\n\t\t\tpath.push(node.value)\n\t\t\tnode = node.parent\n\t\tend\n\t\tpath.push(start)\n\t\tprint_path(path.reverse)\n\tend",
"def get_paths_visited\n redis.smembers paths_visited_key\n end",
"def just_visited()\n all_visited_cities = Country.visited_cities\n all_visited_cities.each {|city| City.new(city) }\n end",
"def generate_possible_moves(state)\n end",
"def get_connected_locations( name_code )\n @data[name_code][:destinations].map{ |e| e[:dest] }\n end",
"def get_flight_destinations\n @flights = Flight.all.map(&:destination)\n end",
"def shortest_paths!(root)\n root = URI(root) if root.is_a?(String)\n raise \"Root node not found\" if !has_key?(root)\n\n q = Queue.new\n\n q.enq root\n root_page = Page[root]\n root_page.depth = 0\n root_page.visited = true\n root_page.save\n\n while !q.empty?\n page = Page[q.deq]\n page.links.each do |u|\n begin\n link = Page[u]\n next if link.nil? || !link.fetched? || link.visited\n\n q << u unless link.redirect?\n link.visited = true\n link.depth = page.depth + 1\n link.save\n\n if link.redirect?\n u = link.redirect_to\n redo\n end\n end\n end\n end\n\n self\n end",
"def find_all_visited_cities()\n all_cities = cities()\n visited_cities = []\n for city in all_cities\n if city.visited == 1\n visited_cities.push(city)\n end\n end\n return visited_cities\nend",
"def shortest_path(start_coord, destination_coord)\n queue = Queue.new\n queue << [start_coord]\n seen = Set.new([start_coord])\n while queue\n begin\n path = queue.pop(non_block = true)\n rescue ThreadError\n return nil\n end\n x, y = path[-1]\n if [x, y] == destination_coord\n return path\n end\n for x2, y2 in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]\n if (0 <= x2 && x2 < @map[0].length) && (0 <= y2 && y2 < @map.length) && (@map[y2][x2] != @WALL && @map[y2][x2] != @PERMANENT_WALL) && !seen.include?([x2, y2])\n queue << (path + [[x2, y2]])\n seen.add([x2, y2])\n end\n end\n end\n end",
"def build_path(start, end_pos)\n node = Node.new(start[0], start[1])\n target = Node.new(end_pos[0], end_pos[1])\n visited_nodes = []\n next_moves = [node]\n until next_moves.empty? do\n node = next_moves.shift\n puts \"Current node: #{node.x}, #{node.y}\"\n if node.x == target.x && node.y == target.y \n return node\n end\n visited_nodes.push(node)\n node.moves = get_moves(node)\n node.moves.reject do |square|\n visited_nodes.include?(square)\n end\n node.moves.each do |move| \n next_moves.push(move)\n end\n end\n return node\nend",
"def all_moves(start, directed_moves)\n # Array of valid moves\n all_moves = []\n\n directed_moves.each do |ele|\n ele[0] = ele[0] + start[0]\n ele[1] = ele[1] + start[1]\n all_moves << ele\n end\n all_moves\n end",
"def neighbours_into_start(node)\n # Find all arcs that include this node in the right place\n passable_nodes = []\n @arcs.get_arcs_by_node_id(node.node_id).each do |arc|\n if arc.end_node_id == node.node_id and arc.end_node_direction\n passable_nodes.push nodes[arc.begin_node_id]\n elsif arc.begin_node_id == node.node_id and !arc.begin_node_direction\n passable_nodes.push nodes[arc.end_node_id]\n end\n end\n return passable_nodes.uniq\n end",
"def transitions(curr_state = nil, **)\n curr_state = state_value(curr_state)\n next_states = state_table.dig(curr_state, :next)\n Array.wrap(next_states).compact_blank\n end",
"def adjacent\n (inputs.map(&:from) + outputs.map(&:to)).uniq\n end",
"def trips_dfs(start, finish, stops, visited, path, paths, cycles)\n adj_vertices(visited.last, adj_lists).each do |vertex|\n print \"Visited stack: #{visited}, Next vertex: #{vertex}\\n\"\n s = visited.size # stops, including added vertex\n\n if visited.last == finish && cycles != \"NO CYCLES EXIST\"\n\n # try adding cycles if we hit finish vertex too early\n\n visited_before_cycles = visited\n # picks expanded cycles that begin with finish vertex\n ec = expanded_cycles(cycles).select{|c| c.first == finish}\n\n # keep adding cycles till we reach stops\n ec.each do |cycle1|\n visited, paths, break_loop = try_cycles(visited, cycle1, paths, stops, 0)\n visited1 = visited\n\n ec.each do |cycle2|\n begin\n visited, paths, break_loop = try_cycles(visited, cycle2, paths, stops, 0)\n end until break_loop\n visited = visited1\n end\n\n visited = visited_before_cycles\n end\n\n elsif !visited.include?(vertex) && dist(visited.last, vertex) != \"NO SUCH ROUTE\" && s <= stops\n visited << vertex\n path = visited\n\n if vertex == finish && s == stops\n paths << path\n print \"\\n*** Path: #{path}, Stops: #{s}, Length: #{path_length(path)}\\n\\n\"\n visited.pop\n break\n end\n\n trips_dfs(start, finish, stops, visited, path, paths, cycles)\n visited.pop\n visited.pop if visited.size.between?(2, 3) && stops <= 1\n visited = [start] if visited == []\n end\n end\n paths.size\n end"
] | [
"0.64335024",
"0.62808055",
"0.6268387",
"0.62412333",
"0.6168641",
"0.6123594",
"0.59832114",
"0.59664327",
"0.5945113",
"0.5941099",
"0.59141713",
"0.5910497",
"0.5900156",
"0.58388394",
"0.58341783",
"0.5826197",
"0.5787011",
"0.5773083",
"0.5744208",
"0.57255304",
"0.5683023",
"0.56759363",
"0.56681806",
"0.5642202",
"0.56128573",
"0.56104004",
"0.55952495",
"0.55951077",
"0.55784434",
"0.557658",
"0.5573463",
"0.55497754",
"0.55451673",
"0.5536872",
"0.5533896",
"0.553272",
"0.5531288",
"0.5521745",
"0.55147463",
"0.5481805",
"0.5450554",
"0.5450356",
"0.5447534",
"0.5436588",
"0.54305303",
"0.54264694",
"0.5424691",
"0.53878146",
"0.53755164",
"0.5368784",
"0.5358182",
"0.5355282",
"0.5352639",
"0.53439796",
"0.53355736",
"0.533165",
"0.5331015",
"0.53275865",
"0.5321823",
"0.5317145",
"0.53111255",
"0.5294424",
"0.5292771",
"0.52925384",
"0.5289775",
"0.52860373",
"0.5284558",
"0.5275227",
"0.5272104",
"0.52696866",
"0.5265407",
"0.52645534",
"0.5253097",
"0.525195",
"0.52477354",
"0.5232563",
"0.52268887",
"0.5222387",
"0.52154845",
"0.5214635",
"0.5211538",
"0.5208504",
"0.5199568",
"0.5196393",
"0.51888776",
"0.5182929",
"0.5180795",
"0.5175107",
"0.51710045",
"0.51707834",
"0.515479",
"0.5152833",
"0.5145277",
"0.51434",
"0.5141905",
"0.51372313",
"0.51328",
"0.51306784",
"0.51291746",
"0.51256096"
] | 0.56812966 | 21 |
Gets next possible moves constrained to board size | def possible_moves_in_board(position)
POSSIBLE_MOVES.select do |move|
x = position[0] + move[0]
y = position[1] + move[1]
within_board?(x, y)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def moves\n available_moves = []\n\n deltas.each do |delta|\n next_move = self.position.zip_sum(delta)\n break unless on_board?(next_move)\n break unless empty_square?(next_move)\n available_moves << next_move\n end\n\n available_moves + capture_moves\n end",
"def moves\n available_moves = []\n\n deltas.each do |delta|\n next_move = self.position.zip_sum(delta)\n break unless empty_square?(next_move)\n if on_board?(next_move)\n available_moves << next_move\n end\n end\n\n available_moves + capture_moves\n end",
"def find_best_move(brd)\n\n # Shortcircuit first move so 5 is always choosen\n return 5 if empty_squares(brd).count == 9\n\n\n best_val = -INFINITY\n best_move = nil\n\n brd.each do |cell, status|\n if status == INITIAL_MARKER\n brd[cell] = COMPUTER_MARKER\n move_val = minimax(brd, 0, 'player')\n brd[cell] = INITIAL_MARKER\n if move_val > best_val\n best_val = move_val\n best_move = cell\n end\n end\n end\n return best_move\n end",
"def get_possible_moves\n moves = \n\t @@offsets.collect do |move| \n\t row = @position[:row] + move[0]\n\t col = @position[:col] + move[1]\n\t\t[row, col] if row.between?(0, 7) && col.between?(0, 7)\n\t end\n\tmoves.compact\n end",
"def find_winning_moves(board)\n winning_moves = []\n winning_moves.concat(winning_rows(board))\n winning_moves.concat(winning_cols(board))\n winning_moves.concat(winning_diags(board))\n return winning_moves\n end",
"def next_move gameboard\n @counter += 1\n @counter = 0 if @counter == gameboard.valid_moves.count\n gameboard.valid_moves[@counter]\n end",
"def possible_moves\n possible_moves = []\n\n # move up\n up_right = [start[X] + 1, start[Y] + 2]\n possible_moves << up_right\n\n up_left = [start[X] - 1, start[Y] + 2]\n possible_moves << up_left\n\n # move right\n right_up = [start[X] + 2, start[Y] + 1]\n possible_moves << right_up\n\n right_down = [start[X] + 2, start[Y] - 1]\n possible_moves << right_down\n\n # move down\n down_right = [start[X] + 1, start[Y] - 2]\n possible_moves << down_right\n\n down_left = [start[X] - 1, start[Y] - 2]\n possible_moves << down_left\n\n # move left\n left_up = [start[X] - 2, start[Y] + 1]\n possible_moves << left_up\n\n left_down = [start[X] - 2, start[Y] - 1]\n possible_moves << left_down\n\n possible_moves.select { |move| @board.valid_position?(move) }\n\n end",
"def next_move gameboard\n result_pairs = []\n\n gameboard.valid_moves.each do |move|\n new_gameboard = gameboard.move move\n result_pairs << { score: new_gameboard.score, move: move } unless gameboard.equal_tile_layout? new_gameboard\n end\n\n result_pairs.sort_by{ |s| s[:score] }.reverse.first[:move]\n end",
"def find_possible_moves\n @possible_moves = []\n\n @moveset.each do |move, value|\n x = @x + value[0]\n y = @y + value[1]\n\n next unless ChessBoard.check_boundaries(x, y) && !visited_coordinates.include?([x, y])\n\n @possible_moves << move\n end\n end",
"def moves\n possible_moves = []\n\n self.move_dirs.each do |dir|\n num_steps = 1\n blocked = false\n\n until blocked\n next_step = [dir[0]*num_steps, dir[1]*num_steps]\n next_pos = [self.pos[0] + next_step[0], self.pos[1] + next_step[1]]\n\n break unless next_pos.all? { |i| i.between?(0,7) }\n\n if self.board[next_pos]\n blocked = true\n possible_moves << next_pos unless self.color == self.board[next_pos].color\n else\n possible_moves << next_pos\n num_steps += 1\n end\n end\n end\n\n possible_moves\n end",
"def possible_moves\r\n return [] if won?\r\n (0..8).select {|i| board.cells[i] == \" \"}\r\n end",
"def generate_possible_moves(start_board)\n possible_moves = []\n\n # possible row moves\n start_board.row_count.times { |x|\n (start_board.col_count-1).times { |y|\n possible_moves << [x, y+1]\n }\n }\n\n # possible column moves\n start_board.col_count.times { |x|\n (start_board.row_count-1).times { |y|\n possible_moves << [start_board.row_count+x, y+1]\n }\n }\n\n return possible_moves\n end",
"def available_moves\n @available_moves = []\n first_row = [35, 36, 37, 38, 39, 40, 41]\n first_row.each do |position|\n until UI.game.board.cells[position].empty? || position < 0\n position -= 7\n end\n @available_moves << position unless position < 0\n end\n return @available_moves\n end",
"def next_possible_moves\n positions_array = []\n x = @position[0]\n y = @position[1]\n next_position = [x+1,y+2]\n positions_array << next_position if position_check(next_position)\n next_position = [x+1,y-2]\n positions_array << next_position if position_check(next_position)\n next_position = [x-1,y+2]\n positions_array << next_position if position_check(next_position)\n next_position = [x-1,y-2]\n positions_array << next_position if position_check(next_position)\n next_position = [x+2,y+1]\n positions_array << next_position if position_check(next_position)\n next_position = [x+2,y-1]\n positions_array << next_position if position_check(next_position)\n next_position = [x-2,y+1]\n positions_array << next_position if position_check(next_position)\n next_position = [x-2,y-1]\n positions_array << next_position if position_check(next_position)\n positions_array\n end",
"def find_best_move\n return 5 if @board.unmarked_keys.count == 9\n\n bests = { val: -INFINITY, move: nil }\n\n board.squares.each do |cell, square|\n if square.unmarked?\n move_val = simulate_computer_move(cell)\n if move_val > bests[:val]\n bests[:val] = move_val\n bests[:move] = cell\n end\n end\n end\n bests[:move]\n end",
"def possible_moves\n all_moves = []\n x, y = @position\n moves = [[x, y-1], [x-1, y-1], [x-1, y], [x-1, y+1], [x, y+1], [x+1, y+1], [x+1, y], [x+1, y-1]]\n moves.each do |position|\n all_moves << [position] if position.all? { |number| number.between?(0,7) }\n end\n all_moves\n end",
"def find_possible_moves(board)\n possibilities = []\n move_set.each do |move|\n rank = @location[0] + move[0]\n file = @location[1] + move[1]\n next unless valid_location?(rank, file)\n\n possibilities << [rank, file] unless board.data[rank][file]\n end\n possibilities\n end",
"def available_moves\n adjacent_tiles(*@hole)\n end",
"def getPossibleMoves(move)\n board = move.board\n possibleMoves = []\n if move.from.nil?\n possibleFrom = getPossibleFrom(move)\n possibleFrom.each do |from|\n possibleMove = Move.new(board, move.board.getSquare(from).occupancy, move.to, from)\n possibleMoves << possibleMove\n end\n else\n # Make sure the piece trying to be moved exists\n if(board.getSquare(move.from).occupied? &&\n board.getSquare(move.from).occupancy.class == move.piece.class &&\n board.getSquare(move.from).occupancy.colour == move.piece.colour)\n move.piece = move.board.getSquare(move.from).occupancy\n possibleMoves << move\n end\n end\n possibleMoves\n end",
"def get_moves(piece, board)\n valid_col = case piece.name\n when ?A then 3\n when ?B then 5\n when ?C then 7\n when ?D then 9\n else 11\n end\n moves = []\n\n # If in hallway\n if piece.row == 1\n cols = valid_col < piece.col ? (valid_col...piece.col).to_a : (piece.col+1..valid_col).to_a\n if cols.count{|c| board[[1, c]] == ?.} == cols.length\n if board[[2, valid_col]] == ?.\n if board[[3, valid_col]] == ?.\n moves << [[3, valid_col], (cols.count + 2) * piece.cost]\n elsif board[[3, valid_col]] == piece.name\n moves << [[2, valid_col], (cols.count + 1) * piece.cost]\n end\n end\n end\n # If not in its column (can never stand in hallway anf column at same time)\n elsif (piece.col == valid_col && piece.row == 2 && board[[piece.row + 1, piece.col]] != piece.name) || (piece.col != valid_col && piece.row == 2)\n 2.times do |t|\n dir = t == 0 ? -1 : 1\n curr = piece.col\n steps = 1\n while board[[1, curr]] == ?.\n moves << [[1, curr], steps * piece.cost] if ![3, 5, 7, 9].include?(curr)\n steps += 1\n curr += dir\n end\n end\n elsif piece.row == 3 && piece.col != valid_col && board[[2, piece.col]] == ?.\n 2.times do |t|\n dir = t == 0 ? -1 : 1\n curr = piece.col\n steps = 2\n while board[[1, curr]] == ?.\n moves << [[1, curr], steps * piece.cost] if ![3, 5, 7, 9].include?(curr)\n steps += 1\n curr += dir\n end\n end\n end\n moves\nend",
"def moves!\n total_possible_moves = []\n total_possible_moves.concat(diag_moves(diag_initializer))\n total_possible_moves.concat(straight_moves(move_initializer))\n total_possible_moves.select { |move| self.valid_move?(move) }\n end",
"def possible_moves(pos, board)\n moves = @moves.reduce([]) { |all_moves, move| all_moves.push(move.valid_moves(pos, board, @owner)) }\n moves.flatten(1)\n end",
"def find_possible_moves(board)\n possible_moves = []\n move_mechanics.each do |move|\n rank = @location[0] + move[0]\n file = @location[1] + move[1]\n next unless valid_location?(rank, file)\n\n possible_moves << [rank, file] unless board.data[rank][file]\n end\n possible_moves\n end",
"def enum_moves\n @scratch = dup_maze(@maze)\n @locs.each_with_index do |loc, robot|\n @cost = 1\n leading_edge = [loc]\n loop do\n next_edge = []\n leading_edge.each do |x, y|\n next_edge.concat search_from(x, y, robot)\n end\n break if next_edge.empty?\n leading_edge = next_edge\n @cost += 1\n end\n end\n\n @moves\n end",
"def find_available_moves(board)\n board.cells.each_with_index.collect {|v,i| i if v == \" \"}.compact\n end",
"def getPossibleFrom move\n possibleFrom = []\n move.board.pieces[move.piece.colour][move.piece.class.to_s.to_sym].each do |coord, piece|\n possibleFrom << coord\n end\n possibleFrom\n end",
"def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @board[new_pos]\n else\n break\n end\n end\n end\n end",
"def possible_moves(board)\n poss_move_array = []\n current_square = @history.last\n current_coords = parse_coord(current_square)\n\n poss_move_array.push(single_march(current_coords, board)) if single_march(current_coords, board)\n\n poss_move_array.push(double_march(current_coords, board)) if first_move? && double_march(current_coords, board)\n\n valid_diagonals(current_coords, board).each { |move| poss_move_array.push(move) }\n\n # en passant only allowed opportunity first created\n poss_move_array.push(en_passant?(current_coords, board)) if en_passant?(current_coords, board)\n\n poss_move_array\n end",
"def possible_moves(position, board, color)\n out_array = []\n\n x = position[0]-1\n y = position[1]-1\n\n (x..x+2).each do |row|\n break if row > 7\n (y..y+2).each do |column|\n break if column > 7\n if !board[row][column] || board[row][column].color != color\n out_array.push([row, column])\n end\n end\n end\n\n out_array\n end",
"def minmax_moves(board, player)\n possible_moves = board.cells.each.with_index(1).reduce({}) do |hash, (cell, index)|\n if cell == \" \"\n board_clone = board.clone\n board_clone.update(index.to_s, player)\n hash[index.to_s] = board_clone\n end\n hash\n end\n possible_moves\n end",
"def moves\n output = []\n move_one = false\n @directions = @directions.take(3) if position != @initial_position\n directions.each_index do |index|\n possible_position = [position[0] + directions[index][0],position[1] + directions[index][1]]\n if index.even?\n if board.in_bounds?(possible_position) && occupied?(possible_position)\n output << possible_position unless board[possible_position].color == board[position].color\n end\n elsif index == 1\n if board.in_bounds?(possible_position) && !occupied?(possible_position)\n output << possible_position\n move_one = true\n end\n elsif board.in_bounds?(possible_position) && !occupied?(possible_position)\n output << possible_position if move_one\n end\n end\n output\n end",
"def get_moves\n reset_moves\n jump_moves\n base_moves if @valid_moves.empty?\n end",
"def get_possible_moves_for(position)\n possible = []\n x = position.square[0]\n y = position.square[1]\n moves = [\n Placement.new([x-1,y-2], position), \n Placement.new([x-1,y+2], position), \n Placement.new([x-2,y-1], position), \n Placement.new([x-2,y+1], position), \n Placement.new([x+1,y+2], position), \n Placement.new([x+1,y-2], position), \n Placement.new([x+2,y-1], position), \n Placement.new([x+2,y+1], position)\n ]\n moves.each do |move|\n possible << move unless Chess.not_on_board?(move)\n end\n possible\n end",
"def get_poss_moves\n x = @location[0] #x is row\n y = @location[1] #y is column\n\n move_list = [] #quarter circle forward punch\n\n if @colour == \"white\"\n move_list = white_pawn_moves(x,y)\n else\n move_list = black_pawn_moves(x,y)\n end\n\n possible_moves = move_list.select { |e|\n (e[0] >= 0) && (e[0] <= 7) && (e[1] >= 0) && (e[1] <= 7)\n }\n possible_moves\n end",
"def get_next_neighbors(board,x,y,char)\n res=[]\n res<< [x,y-1] if 0<y and board[x][y-1] == char\n res<< [x-1,y] if 0<x and board[x-1][y] == char\n res<< [x+1,y] if x+1<board.length and board[x+1][y] == char\n res<< [x,y+1] if y+1<board.first.length and board[x][y+1] == char \n res\nend",
"def possible_moves\n possibles = []\n @state.each_with_index do |column, i|\n possibles << i if column[5] == :e\n end\n possibles\n end",
"def possible_moves \n row = @current_row\n column = @current_column\n values = Hash.new \n if (row + 1) <= @matrix.length \n values[@matrix[row + 1][column]] = [(row + 1),column]\n end \n if (row - 1) >= 0\n values[@matrix[row - 1][column]] = [(row - 1),column]\n end \n if (column + 1) <= @matrix[0].length \n values[@matrix[row][column + 1]] = [row,(column + 1)]\n end\n if (column - 1) >= 0 \n values[@matrix[row][column - 1]] = [row,(column - 1)]\n end \n highest_value_square(values)\nend",
"def generate_possible_moves(state)\n end",
"def get_moves_2(piece, board)\n valid_col = case piece.name\n when ?A then 3\n when ?B then 5\n when ?C then 7\n when ?D then 9\n else 11\n end\n moves = []\n\n # If in hallway\n if piece.row == 1\n cols = valid_col < piece.col ? (valid_col...piece.col).to_a : (piece.col+1..valid_col).to_a\n if cols.count{|c| board[[1, c]] == ?.} == cols.length\n if board[[2, valid_col]] == ?. && board[[3, valid_col]] == piece.name && board[[4, valid_col]] == piece.name && board[[5, valid_col]] == piece.name\n moves << [[2, valid_col], (cols.count + 1) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == piece.name && board[[5, valid_col]] == piece.name\n moves << [[3, valid_col], (cols.count + 2) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == ?. && board[[5, valid_col]] == piece.name\n moves << [[4, valid_col], (cols.count + 3) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == ?. && board[[5, valid_col]] == ?.\n moves << [[5, valid_col], (cols.count + 4) * piece.cost]\n end\n end\n # If right column and something is underneath and nothing above\n # If in wrong column completely and nothing above\n elsif piece.row >= 2\n below = (piece.row+1..5).to_a\n above = (2..piece.row-1).to_a\n if ((piece.col == valid_col && below.count{|c| board[[c, piece.col]] != piece.name} != 0 && below.length != 0) || (piece.col != valid_col)) && (above.count{|c| board[[c, piece.col]] == ?.} == above.length)\n 2.times do |t|\n dir = t == 0 ? -1 : 1\n curr = piece.col\n steps = 1 + above.length\n while board[[1, curr]] == ?.\n moves << [[1, curr], steps * piece.cost] if ![3, 5, 7, 9].include?(curr)\n steps += 1\n curr += dir\n end\n end\n end\n end\n moves\nend",
"def possible_moves\n return []\n end",
"def best_move\n\t\tpossible_moves.send(@turn == \"x\" ? :max_by: :min_by) { |idx| minimax(idx) }\n\tend",
"def jump_moves\n moves = [] # initializes empty move array\n\n # choses \"forward\" y direction based on piece team\n if @team == \"l\"\n dir = 1\n else\n dir = -1\n end\n\n # looks at the two forward far diagonal positions and adds them to moves array if there are no pieces there and an opponent piece in between\n pos1 = [@x_pos + 2, @y_pos + 2*dir]\n moves << pos1 if Piece.all.find{|p| p.x_pos == @x_pos + 1 && p.y_pos == @y_pos + dir && p.team != @team} && Piece.all.none?{|p| [p.x_pos, p.y_pos] == pos1}\n pos2 = [@x_pos - 2, @y_pos + 2*dir]\n moves << pos2 if Piece.all.find{|p| p.x_pos == @x_pos - 1 && p.y_pos == @y_pos + dir && p.team != @team} && Piece.all.none?{|p| [p.x_pos, p.y_pos] == pos2}\n \n\n # deletes any moves with coordinates that aren't on the board\n moves.delete_if{|move| move.find{|n| n < 0 || n > 7}}\n return moves\n end",
"def moves\n @board.compact.count\n # calling .compact reduces the number of objects to anything that has a true value (eliminates nil)\n # and .count will return the number of objects\n # e.x. if @board = [\"x\", \"x\", \"o\", \"o\", \"o\", \"x\", \"o\", nil, \"x\"] , moves would return 8\n end",
"def next_move\n moves.max{ |a, b| a.rank <=> b.rank }\n end",
"def scan_moves\n @white_moves = []\n @black_moves = []\n\n r = 0\n while r <= 7\n c = 1\n while c <= 8\n if selected_piece_type(r, c) != 'Piece' && selected_piece_type(r, c) != 'King'\n if selected_piece_colour(r, c) == Board::B\n @black_moves << possible_moves(r, c)\n elsif selected_piece_colour(r, c) == Board::W\n @white_moves << possible_moves(r, c)\n end\n end\n c += 1\n end\n r += 1\n end\n end",
"def moves\n poss_moves = []\n determine_moves.each do |diff| #array of directions\n poss_moves += grow_unblocked_moves_in_dir(diff[0],diff[1])\n end\n poss_moves\n end",
"def possible_moves(side)\n possible_moves = []\n # initialize an 8x8 array of coordinates 1-8\n coords = Array.new(8) { [*1..8] }\n coords.each_with_index do |i, j|\n i.each do |t|\n # t is the x, i[j] is the y\n side.each do |test_piece|\n # Run move validation tests on every piece\n next unless test_piece.move_tests(to_x: t, to_y: i[j])\n # if a move passes validations, push the pieces ID and the\n # coordinates of a successful move to the possible_moves array\n possible_moves << [test_piece.id, t, i[j]]\n end\n end\n end\n possible_moves\n end",
"def possible_king_moves(start_arr)\n\t\tx = start_arr[0]\n\t\ty = start_arr[1]\n\t\tcandidates = []\n\t\tcandidates << [x+1,y]\n\t\tcandidates << [x-1,y]\t\t\n\t\tcandidates << [x,y+1]\t\t\t\t\n\t\tcandidates << [x,y-1]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tcandidates << [x+1,y+1]\n\t\tcandidates << [x-1,y-1]\t\n\t\tcandidates << [x-1,y+1]\t\t\t\t\n\t\tcandidates << [x+1,y-1]\t\t\t\t\n\t\tchildren = candidates.select { |pos| pos[0] >= 0 && pos[1] >= 0 && pos[0] <= 7 && pos[1] <= 7}\n\t\tchildren.delete_if do |child|\n\t\t\tif !(@board[child] == \"*\")\n\t\t\t\t# If pieces not same color\n\t\t\t\tif @board[child].color == @board[start_arr].color\n\t\t\t\t\tif occupied(child)\n\t\t\t\t\t\tcan_do = true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tchildren\n\tend",
"def calculate_next_board\n next_board = Array.new(size) { Array.new(size) }\n\n current_board.each_with_index do |row_items, row|\n row_items.each_with_index do |_col_items, col|\n next_board[row][col] = calculate_next_cell_state(row, col)\n end\n end\n @current_board = next_board\n end",
"def move board\n free_pieces = board.free_pieces\n piece = free_pieces.random\n moves = board.possible_moves(piece)\n return [piece.x, piece.y], moves.random \n end",
"def next_positions(pos)\n\tresult = []\n\tmoves = [[1, 2], [-1, 2], [1, -2], [-1, -2], [2, 1], [2, -1], [-2, 1], [-2, -1]]\n\tmoves.each do |move|\n\t\tpossibility = [pos[0] + move[0], pos[1] + move[1]]\n\t\tif possibility[0].between?(0, 7) && possibility[1].between?(0, 7)\n\t\t\tresult << possibility\n\t\tend\n\tend\n\treturn result\nend",
"def possible_moves(y_pos, x_pos, moves_list=[[y_pos,x_pos]])\n\t\t\n\t\treturn moves_list if moves_list.length > 64\n\n\t\tmove_square = y_pos+2, x_pos+1\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1]) \n\n\t\tmove_square = y_pos+2, x_pos-1\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1])\n\n\t\tmove_square = y_pos-2, x_pos+1\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1])\n\n\t\tmove_square = y_pos-2, x_pos-1\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1])\n\n\t\tmove_square = y_pos+1, x_pos+2\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1])\n\n\t\tmove_square = y_pos+1, x_pos-2\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1])\n\n\t\tmove_square = y_pos-1, x_pos+2\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1])\n\n\t\tmove_square = y_pos-1, x_pos-2\n\t\tmoves_list << move_square if check_legal_move(move_square[0],move_square[1])\n\n\t\tmoves_list.each { |move| possible_moves(move[0], move[1], moves_list) }\n\t\treturn moves_list\n\tend",
"def get_moves(start)\n x = start.x\n y = start.y\n moves = []\n moves << Node.new(x+2, y+1)\n moves << Node.new(x+2, y-1)\n moves << Node.new(x+1, y+2)\n moves << Node.new(x+1, y-2)\n moves << Node.new(x-1, y+2)\n moves << Node.new(x-1, y-2)\n moves << Node.new(x-2, y+1)\n moves << Node.new(x-2, y-1)\n moves = moves.reject do |node|\n node.x < 0 || node.x > 8\n end\n moves = moves.reject do |node|\n node.y < 0 || node.y > 8\n end\n moves.each { |move| move.next_node = start }\nend",
"def move_knight\n #there is no more than eight moves\nend",
"def regular_moves\n moves = [] # initializes empty move array\n\n # choses \"forward\" y direction based on piece team\n if @team == \"l\"\n dir = 1\n else\n dir = -1\n end\n \n # looks at the two forward diagonal positions and adds them to moves array if there are no pieces there\n pos1 = [@x_pos + 1, @y_pos + dir]\n moves << pos1 if Piece.all.none?{|p| [p.x_pos, p.y_pos] == pos1}\n pos2 = [@x_pos - 1, @y_pos + dir]\n moves << pos2 if Piece.all.none?{|p| [p.x_pos, p.y_pos] == pos2}\n \n # deletes any moves with coordinates that aren't on the board\n moves.delete_if{|move| move.find{|n| n < 0 || n > 7}}\n return moves \n end",
"def next_move\n minimax(self.id)\n\n @board.board[@choice] = id\n @board.free.delete(@choice)\n p self\n puts \"player #{id + 1} chooses #{@choice}\"\n puts @board\n\n @board.winner || @board.free.empty?\n end",
"def moves\n to_return = []\n board_iterate do |i|\n if(i.is_a? Numeric)\n to_return.push(i)\n end\n end\n to_return.empty? ? nil : to_return\n end",
"def find_move(board)\n\t\tcell_found = nil\n\t\t\tWIN_COMBINATIONS.each do |combo|\n\t\t\t\thash = Hash.new\n\t\t\t\thash[combo[0]] = board.cells[combo[0]]\n\t\t\t\thash[combo[1]] = board.cells[combo[1]]\n\t\t\t\thash[combo[2]] = board.cells[combo[2]]\n\t\t\t\t# finds a possible win move\n\t\t\tif(hash.values.count(\"O\") == 1 && hash.values.count(\" \") == 2)\n\t\t\t\tcell_found = hash.key(\" \")+1\n\t\t\tend\n\t\tend\n\t\tcell_found\n\tend",
"def possible_rook_moves(start_arr)\n\t\tx = start_arr[1]\n\t\ty = start_arr[0]\n\t\tcandidates = []\n\t\t# Checks how many spaces rook can move up\n\t\tmove_up = true\n\t\ti = 1\t\t\n\t\twhile move_up && i < 8\n\t\t\tpos = [y+i, x]\n\t\t\tif pos[0] >= 8\t\n\t\t\t\tmove_up = false\n\t\t\telse\t\n\t\t\t\tif !(@board[pos] == \"*\")\n\t\t\t\t\tif @board[pos].color == @board[start_arr].color\n\t\t\t\t\t\tmove_up = false\n\t\t\t\t\telsif !( @board[pos].color == @board[start_arr].color )\n\t\t\t\t\t\tcandidates << pos\n\t\t\t\t\t\tmove_up = false\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tcandidates << pos\n\t\t\t\tend\n\t\t\t\ti += 1\n\t\t\tend\n\t\tend\n\n\t\t# Checks how many spaces rook can move down\n\t\tmove_down = true\t\t\n\t\ti = 1\t\n\t\twhile move_down && i < 8\n\t\t\tpos = [y-i, x]\n\t\t\tif pos[0] < 0\t\n\t\t\t\tmove_down = false\n\t\t\telse\t\n\t\t\t\tif !(@board[pos] == \"*\")\n\t\t\t\t\tif @board[pos].color == @board[start_arr].color\n\t\t\t\t\t\tmove_down = false\n\t\t\t\t\telsif !( @board[pos].color == @board[start_arr].color )\n\t\t\t\t\t\tcandidates << pos\n\t\t\t\t\t\tmove_down = false\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tcandidates << pos\n\t\t\t\tend\n\t\t\t\ti += 1\n\t\t\tend\n\t\tend\n\n\t\t# Checks how many spaces rook can move right\n\t\tmove_right = true\t\t\n\t\ti = 1\t\n\t\twhile move_right && i < 8\n\t\t\tpos = [y, x+1]\n\t\t\tif pos[1] > 7\t\n\t\t\t\tmove_right = false\n\t\t\telse\t\n\t\t\t\tif !(@board[pos] == \"*\")\n\t\t\t\t\tif @board[pos].color == @board[start_arr].color\n\t\t\t\t\t\tmove_right = false\n\t\t\t\t\telsif !( @board[pos].color == @board[start_arr].color )\n\t\t\t\t\t\tcandidates << pos\n\t\t\t\t\t\tmove_right = false\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tcandidates << pos\n\t\t\t\tend\n\t\t\t\ti += 1\n\t\t\tend\n\t\tend\n\n\t\t# Checks how many spaces rook can move left\n\t\tmove_left = true\t\t\n\t\ti = 1\t\n\t\twhile move_left && i < 8\n\t\t\tpos = [y, x+1]\n\t\t\tif pos[1] > 7\t\n\t\t\t\tmove_left = false\n\t\t\telse\t\n\t\t\t\tif !(@board[pos] == \"*\")\n\t\t\t\t\tif @board[pos].color == @board[start_arr].color\n\t\t\t\t\t\tmove_left = false\n\t\t\t\t\telsif !( @board[pos].color == @board[start_arr].color )\n\t\t\t\t\t\tcandidates << pos\n\t\t\t\t\t\tmove_left = false\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tcandidates << pos\n\t\t\t\tend\n\t\t\t\ti += 1\n\t\t\tend\n\t\tend\t\t\n\t\tcandidates\n\tend",
"def moves\n moves = []\n\n x, y = self.position\n sign = self.color == :white ? 1 : -1\n init_row = self.color == :white ? 1 : 6\n\n one_up = [x + (1 * sign), y]\n two_up = [x + (2 * sign), y]\n\n moves << one_up if self.board[one_up].nil?\n\n if (self.board[one_up].nil? && self.board[two_up].nil? && self.position.first == init_row)\n moves << two_up\n end\n\n diag_left = [x + (1 * sign), y + 1]\n diag_right = [x + (1 * sign), y - 1]\n\n if self.board[diag_left] && self.board[diag_left].color != self.color\n moves << diag_left\n end\n\n if self.board[diag_right] && self.board[diag_right].color != self.color\n moves << diag_right\n end\n\n moves.select { |move| on_board?(move) }\n end",
"def get_next_moves\n children = Array.new()\n new_move = @moves + 1\n @code.length.times do |i|\n move_up = Combination.new(next_code(i, :up), self, new_move)\n move_down = Combination.new(next_code(i, :down), self, new_move)\n children.push(move_down, move_up)\n end\n children\n end",
"def generate_slide_moves(current_pos, board, owner)\n return if out_of_bounds?(current_pos)\n\n next_piece = board.locate_piece(current_pos)\n return if next_piece&.owner == owner\n\n return [current_pos] if next_piece\n\n next_pos = [current_pos[0] + @move[0], current_pos[1] + @move[1]]\n next_moves = generate_slide_moves(next_pos, board, owner)\n return [current_pos] unless next_moves\n\n next_moves.reduce([current_pos]) { |current_moves, deep_moves| current_moves.push(deep_moves) }\n end",
"def knight_moves\n\t\tnode = Square.new(@start)\n\t\t@queue << node\n\t\twhile @queue.empty? == false\n\t\t\tcurrent = @queue[0]\n\t\t\tif current.value == @final\n\t\t\t\tdisplay_result(current)\t\t\t\n\t\t\telse\n\n\t\t\t\t8.times do |num|\n\t\t\t\t\tx = current.value[0] + @row[num]\n\t\t\t\t\ty = current.value[1] + @col[num]\n\t\t\t\t\tif (x.between?(1,8) && y.between?(1,8)) && @revised.include?([x, y]) == false\n\t\t\t\t\t\tnode = Square.new([x, y])\n\t\t\t\t\t\tnode.parent = current\n\t\t\t\t\t\tnode.count = current.count + 1\n\t\t\t\t\t\t@queue << node\n\t\t\t\t\telse\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t@revised << current.value\n\t\t\t\t@queue.shift\n\t\t\tend\n\t\tend\n\t\tputs \"NOT FOUND !!!\"\n\t\tputs \"This program presumes a 8x8 Chess Board\"\n\t\tputs \"Therefore your coordinates must be between (1, 1) and (8, 8).\"\n\tend",
"def choose_random_move(board, list_of_moves)\n possible_moves = []\n list_of_moves.each do |move|\n if space_available?(board, move)\n possible_moves << move\n end\n end\n \n if possible_moves.count != 0\n possible_moves.sample\n else\n nil\n end\n end",
"def possibleMoves(position)\n moves = []\n for x in 0..2\n for y in 0..2\n if position[x][y]==0\n moves << 3*x + y + 1 #board labeled 1 - 9\n end\n end\n end\n return moves\n end",
"def get_diagonal_moves\n northwest_moves = []\n northeast_moves = []\n southwest_moves = []\n southeast_moves = []\n (1...ChessBoardConstants::BOARD_DIMENSIONS).each do |step|\n northwest_moves << { row: @row + step, col: @col - step }\n northeast_moves << { row: @row + step, col: @col + step }\n southwest_moves << { row: @row - step, col: @col - step }\n southeast_moves << { row: @row - step, col: @col + step }\n end\n return select_legal_moves(northwest_moves) +\n select_legal_moves(northeast_moves) +\n select_legal_moves(southwest_moves) +\n select_legal_moves(southeast_moves)\n end",
"def move_lateral(index, limit = 8)\n row = get_row_from_index(index)\n col = get_col_from_index(index)\n left, right = [col-1, limit].min, [8-col, limit].min\n up, down = [row-1, limit].min, [8-row, limit].min\n valid = []\n\n # Move down N places until board limit, piece in the way, or specified limit\n down.times do |i|\n next_pos = index + (i+1)*8\n # Valid move if position is unoccupied\n if unoccupied?(next_pos)\n valid << next_pos\n else\n # Valid move is piece is an enemy, but then no subsequent tiles are attackable\n # if the piece is not an enemy, it's not added as a valid move, and no subsequent tiles are attackable\n # This function doesn't filter out the king from a valid enemy, but the Board class will drop King indexes\n if piece_color(next_pos) == @@enemy_color\n valid << next_pos\n end\n break\n end\n end\n\n # Move up N places until board limit, piece in the way, or specified limit\n up.times do |i|\n next_pos = index - (i+1)*8\n if unoccupied?(next_pos)\n valid << next_pos\n else\n #puts \"PC #{piece_color(next_pos)} #{enemy_color}\" #INCOMEPSDFJDSLFJDKLFJDASKLF\n if piece_color(next_pos) == @@enemy_color\n valid << next_pos\n end\n break\n end\n end\n\n # Move right N places until board limit, piece in the way, or specified limit\n right.times do |i|\n next_pos = index + (i+1)\n if unoccupied?(next_pos)\n valid << next_pos\n else\n if piece_color(next_pos) == @@enemy_color\n valid << next_pos\n end\n break\n end\n end\n\n # Move left N places until board limit, piece in the way, or specified limit\n left.times do |i|\n next_pos = index - (i+1)\n if unoccupied?(next_pos)\n valid << next_pos\n else\n if piece_color(next_pos) == @@enemy_color\n valid << next_pos\n end\n break\n end\n end\n return valid\n end",
"def moves\n pos = self.current_position\n moves = []\n move_dirs.each do |arr|\n @current_position = pos\n loop do\n @current_position = [@current_position[0] + arr[0], @current_position[1] + arr[1]]\n break if [@current_position[0], @current_position[1]].any? { |val| val < 0 || val > 7 }\n if board.pos_occupied?(@current_position)\n if @board[@current_position].color == self.color\n break\n else\n moves << @current_position\n break\n end\n moves << @current_position\n end\n moves << @current_position\n end\n end\n moves\n end",
"def valid_moves_recursive(from)\n piece = @board.at(from)\n piece.moves.inject([]) do |valid_moves, move|\n valid_moves.push(*repeated_move(from, move))\n end\n end",
"def get_moves\n [\n { row: @row + 1, col: @col + 2 },\n { row: @row + 1, col: @col - 2 },\n { row: @row + 2, col: @col + 1 },\n { row: @row + 2, col: @col - 1 },\n { row: @row - 1, col: @col + 2 },\n { row: @row - 1, col: @col - 2 },\n { row: @row - 2, col: @col + 1 },\n { row: @row - 2, col: @col - 1 }\n ].select do |move|\n [:blank_space, :enemy_piece].include? describe_location(move[:row], move[:col])\n end\n end",
"def possible_moves(spaces)\n possible_moves = []\n if ((@position + 1) % 8 == 0)\n @moves = [8,7,-1,-9,-8]\n elsif (@position % 8 == 0)\n @moves = [-8,-7,1,9,8]\n end\n @moves.each do |move|\n possible_moves << (@position + move)\n end\n possible_moves.select! { |move| (0..63).include?(move) }\n possible_moves.select! do |move| \n spaces[move].class == Fixnum or spaces[move].side_id != @side_id ? true : false\n end\n possible_moves\n end",
"def next_move(game_state: nil)\n #We add only what is new, just in case the state_delta contains less info...\n new_moves = []\n if @board_state.length < game_state.length\n (@board_state.length...game_state.length).each do |i| \n @board_state << game_state[i] \n new_moves << game_state[i]\n end\n end\n moves = translate_acn(new_moves, board)\n update_board(@board, moves, @score)\n return decide_best_move @board, @score, @depth\n end",
"def potential_diagonal_moves is_king=false\n moves = []\n\n # Possible moves\n # - all possible combination of increment/decrement of r_idx/c_idx\n\n r_min = is_king ? (r_idx - 1 >= 0 ? r_idx - 1 : r_idx) : 0\n c_min = is_king ? (c_idx - 1 >= 0 ? c_idx - 1 : c_idx) : 0\n r_max = is_king ? (r_idx + 1 <= 7 ? r_idx + 1 : r_idx) : Board::WIDTH - 1\n c_max = is_king ? (c_idx + 1 <= 7 ? c_idx + 1 : c_idx) : Board::WIDTH - 1\n\n # top-right: row-decrement, column-increment [4, 5] [3, 6]\n r = r_idx - 1\n c = c_idx + 1\n while (r >= r_min) && (c <= c_max)\n moves << [r, c]\n r -= 1\n c += 1\n end\n\n # bottom-right: row-increment, column-increment [4, 5] [5, 6]\n r = r_idx + 1\n c = c_idx + 1\n while (r <= r_max) && (c <= c_max)\n moves << [r, c]\n r += 1\n c += 1\n end\n\n # bottom-left: row-increment, column-decrement [4, 5] [5, 4]\n r = r_idx + 1\n c = c_idx - 1\n while (r <= r_max) && (c >= c_min)\n moves << [r, c]\n r += 1\n c -= 1\n end\n\n # top-left: row-decrement, column-decrement [4, 5] [3, 4]\n r = r_idx - 1\n c = c_idx - 1\n while (r >= r_min) && (c >= c_min)\n moves << [r, c]\n r -= 1\n c -= 1\n end\n\n # TODO\n # - refactor to avoid repeated pattern of code without compromising with runtime\n\n moves\n end",
"def total_all_possible_moves(color, n = 0)\n result = []\n board.each do |line|\n line.each do |p|\n unless p == ' ' || p.color != color\n if p.type == 'pawn' && n == 0\n result << p.possible_next_moves(all_occupied_spaces)[0]\n else\n result << p.possible_next_moves(all_occupied_spaces)\n end\n end\n end\n end\n result = result.flatten(1).uniq.delete_if do |p|\n occupied_spaces(color).include?(p)\n end\n result\n end",
"def get_cpu_move(board, player)\n # for the first move, the cpu will pick one of the four corners randomly.\n if board.is_empty then\n if rand(2) == 1 then\n row = 0\n else \n row = 2\n end\n\n if rand(2) == 1 then\n col = 0\n else\n col = 2\n end\n return row, col \n else\n # otherwise, it will find the best move to play that eliminates\n # its chances of losing\n return minimax(board, player)[1]\n end\nend",
"def valid_moves\n moves = []\n\n # go in all directions\n (-1..1).each do |_x_step|\n (-1..1).each do |_y_step|\n # start walking in that direction\n (1..7).each do |steps|\n x = x_coordinate + steps * x_direction\n y = y_coordinate + steps * y_direction\n\n # stop walking if you hit a wall\n break unless valid_move?(x, y)\n\n # remember the valid moves\n moves.push(Move.new(x, y))\n end\n end\n end\n moves\n end",
"def possible_moves\n\t\t@board.map.with_index { |piece, idx| piece == \"-\" ? idx : nil }.compact\n\tend",
"def get_valid_moves\n possible_moves.select do |dir, moves| \n moves.select! { |mov| check_bounds(mov[0], mov[1]) }\n !moves.empty? && move_directions.include?(dir)\n end\n end",
"def winning_move(player)\n count_squares_and_moves(player) do |squares, moves| \n return moves.first if squares == 2 and !moves.empty? \n end\n nil\n end",
"def ai_best_moves(board)\n\t\tbest_move = []\n\t\tgood_moves = [\"1\", \"3\", \"5\", \"7\", \"9\"] # Best moves to win a game\n\t\tbest_move = good_moves.select { |a| board.valid_move?(a)} # Check which best moves are available\n\t\tbest_move = best_move.sample # Take a random move from the best moves available\n\t\tif best_move != nil # If a best move is available\n\t\t\tbest_move\n\t\telse\n\t\t\tnil\n\t\tend\n\tend",
"def get_move\n cols = %w(a b c d e f g h)\n rows = %w(8 7 6 5 4 3 2 1)\n\n from_pos, to_pos = nil, nil\n until from_pos && to_pos\n @display.draw\n if from_pos\n row, col = from_pos\n piece = @display.board[from_pos].class\n puts \"#{piece} at #{cols[col]}#{rows[row]} selected. Where to move to?\"\n to_pos = @display.get_keyboard_input\n else\n @display.reset_errors_notification\n puts \"#{@color.capitalize}'s move\"\n puts 'What piece do you want to move?'\n selection = @display.get_keyboard_input\n from_pos = selection if selection && valid_selection?(selection)\n end\n end\n [from_pos, to_pos]\n end",
"def get_all_possible_moves\n possible_moves = []\n @MOVES.each do |arr|\n possible_moves += get_possible_moves(arr)\n end\n possible_moves\n end",
"def _lookAhead(board,nMoreTimes)\n\n validMoves = AI.getValidMoves(board)\n\n if nMoreTimes == 0\n return [false,validMoves[0],0]\n end\n\n # an even number means it is the opponent's turn, an odd number means it is\n # this user's turn\n if nMoreTimes % 2 == 0\n\n end\n\n # see how each of the possible moves fairs\n possibilities = validMoves.collect { |i|\n nextBoard = board.clone\n row = nextBoard.put(@playerId,i)\n win = @winCondition.win(board,row,i)\n if win\n [true,i]\n else\n [false,i,_lookAhead(nextBoard,nMoreTimes-1)[2]]\n end\n }\n\n # see if there were any winning moves\n winningMove = possibilities.index { |i| i[0] }\n if winningMove != nil\n return [true, possibilities[winningMove]]\n end\n # otherwise, give the best move, and how good it is\n\n return [false, ]\n\n end",
"def move_origins(moves = nil)\n moves ||= MOVES[move.piece.downcase]\n possibilities = []\n file, rank = destination_coords\n\n moves.each do |i, j|\n f = file + i\n r = rank + j\n\n possibilities << [f, r] if valid_square?(f, r) && board.at(f, r) == move.piece\n end\n\n possibilities\n end",
"def move_lateral(index, limit = 8)\n row = get_row_from_index(index)\n col = get_col_from_index(index)\n\n left = [col - 1, limit].min\n right = [8 - col, limit].min\n up = [row - 1, limit].min\n down = [8 - row, limit].min\n\n valid = []\n\n # Move down N places until board limit, piece in the way, or specified limit\n down.times do |i|\n next_pos = index + (i + 1) * 8\n # Valid move if position is unoccupied\n if unoccupied?(next_pos)\n valid << next_pos\n else\n # Valid move is piece is an enemy, but then no subsequent tiles are attackable\n # if the piece is not an enemy, it's not added as a valid move, and no subsequent tiles are attackable\n # This function doesn't filter out the king from a valid enemy, but the Board class will drop King indexes\n valid << next_pos if piece_color(next_pos) == Move.enemy_color\n\n break\n end\n end\n\n # Move up N places until board limit, piece in the way, or specified limit\n up.times do |i|\n next_pos = index - (i + 1) * 8\n if unoccupied?(next_pos)\n valid << next_pos\n else\n valid << next_pos if piece_color(next_pos) == Move.enemy_color\n break\n end\n end\n\n # Move right N places until board limit, piece in the way, or specified limit\n right.times do |i|\n next_pos = index + (i + 1)\n if unoccupied?(next_pos)\n valid << next_pos\n else\n valid << next_pos if piece_color(next_pos) == Move.enemy_color\n break\n end\n end\n\n # Move left N places until board limit, piece in the way, or specified limit\n left.times do |i|\n next_pos = index - (i + 1)\n if unoccupied?(next_pos)\n valid << next_pos\n else\n valid << next_pos if piece_color(next_pos) == Move.enemy_color\n break\n end\n end\n\n valid\n end",
"def available_moves(board)\n\t\tmoves = []\n\t\tboard.each_with_index{|cell, index| moves << index.to_s if cell == \" \"}\n\t\tmoves\n\tend",
"def best_move(good_moves)\n best_move = good_moves.sample\n good_moves.each do |move|\n if @board.piece_at(move.last).value >\n @board.piece_at(best_move.last).value\n best_move = move\n end\n end\n best_move\n end",
"def possible_moves(position, board, color)\n out_array = []\n\n x = position[0]\n y = position[1]\n\n #going right\n while y < 7\n y += 1\n if board[x][y] && board[x][y].color != color\n out_array.push([x, y])\n break\n elsif board[x][y] && board[x][y].color == color\n break\n end\n out_array.push([x, y])\n end\n\n y = position[1]\n while y > 0\n y -= 1\n if board[x][y] && board[x][y].color != color\n out_array.push([x, y])\n break\n elsif board[x][y] && board[x][y].color == color\n break\n end\n out_array.push([x, y])\n end\n\n y = position[1]\n while x > 0\n x -= 1\n if board[x][y] && board[x][y].color != color\n out_array.push([x, y])\n break\n elsif board[x][y] && board[x][y].color == color\n break\n end\n out_array.push([x, y])\n end\n\n x = position[0]\n while x < 7\n x += 1\n if board[x][y] && board[x][y].color != color\n out_array.push([x, y])\n break\n elsif board[x][y] && board[x][y].color == color\n break\n end\n out_array.push([x, y])\n end\n\n\n out_array\n end",
"def available_moves(from_cell, chessboard)\n map_chess_move_array(from_cell, available_cells(from_cell, chessboard))\n end",
"def moves_for(player_color)\n moves = Array.new\n board.each_with_keys do |x, y, value|\n if value.eql?(player_color)\n moves.concat generate_for(x,y)\n end\n end\n moves\n end",
"def grow_unblocked_moves_in_dir(dx,dy)\n start_x, start_y = self.pos\n #start for rook white === [7,0]\n # [6,0]\n # [5,0]\n # [4,0]\n # [3,0]\n # [2,0]\n\n dx = -1 #first iteration UP\n dy = 0\n\n\n 1.step do |i|\n start_x += dx\n start_y += dy\n if self.board.rows[start_x][start_y].empty? #[6,0]\n\n end\n # create an array to collect moves\n\n # get the piece's current row and current column\n\n\n # in a loop:\n # continually increment the piece's current row and current column to \n # generate a new position\n # stop looping if the new position is invalid (not on the board); the piece \n # can't move in this direction\n # if the new position is empty, the piece can move here, so add the new \n # position to the moves array\n # if the new position is occupied with a piece of the opposite color, the \n # piece can move here (to capture the opposing piece), so add the new \n # position to the moves array\n # but, the piece cannot continue to move past this piece, so stop looping\n # if the new position is occupied with a piece of the same color, stop looping\n\n # return the final moves array\n end\n \nend",
"def possible_moves(x, y)\n @moves = [[x+1,y+2], [x+1,y-2],\n [x-1,y+2], [x-1,y-2],\n [x+2,y+1], [x+2,y-1],\n [x-2,y+1], [x-2,y-1]]\n\n end",
"def retard_minimax(future_board, player_hand)\n available_cards = player_hand.values.compact\n available_spaces = future_board.open_spaces\n possible_moves = available_cards.product(available_spaces)\n value_of_best_move = -10\n\n possible_moves.each do |card, space|\n x, y = space\n value = future_board.next_state(card, x, y).score\n if value > value_of_best_move\n value_of_best_move = value\n end\n end\n\n return value_of_best_move\n end",
"def gen_rook_moves(color, piece=:rook)\n moves = []\n if color == :white\n position = @position.white \n comrades = @position.white_pieces\n enemy = @position.black_pieces\n else\n position = @position.black\n comrades = @position.black_pieces\n enemy = @position.white_pieces\n end\n\n # no work to do when there are no pieces\n return moves if position[piece].nil?\n \n # for each piece\n position[piece].set_bits.each do |from| \n # [i,j] = current position\n i = from / 8\n j = from % 8\n\n #dirs flags which directions the piece is blocked\n dirs = 0\n for k in 1..7\n break if dirs == 0xf\n \n # try moving north\n if (dirs & 0x1) != 0x1\n to = from+k*8\n if i+k>7 || comrades.set?(to)\n # no further north moves possible\n dirs = dirs | 0x1\n else\n moves.push [Square.index(from), Square.index(to)]\n # if it's occupied by the enemy, no further north moves possible\n dirs = dirs | 0x1 if enemy.set?(to) \n end\n end\n \n # try moving south\n if (dirs & 0x2) != 0x2\n to = from-k*8\n if i<k || comrades.set?(to)\n # no further south moves possible\n dirs = dirs | 0x2\n else\n moves.push [Square.index(from), Square.index(to)]\n # if it's occupied by the enemy, no further north moves possible\n dirs = dirs | 0x2 if enemy.set?(to) \n end\n end\n \n # try moving east\n if (dirs & 0x4) != 0x4\n to = from+k\n if j+k>7 || comrades.set?(to)\n # no further east moves possible\n dirs = dirs | 0x4\n else\n moves.push [Square.index(from), Square.index(to)]\n # if it's occupied by the enemy, no further east moves possible\n dirs = dirs | 0x4 if enemy.set?(to) \n end\n end\n \n # try moving west\n if (dirs & 0x8) != 0x8\n to = from-k\n if j-k<0 || comrades.set?(to)\n # no further east moves possible\n dirs = dirs | 0x8\n else\n moves.push [Square.index(from), Square.index(to)]\n # if it's occupied by the enemy, no further west moves possible\n dirs = dirs | 0x8 if enemy.set?(to) \n end\n end \n end\n end \n moves\n end",
"def get_valid_moves(pos)\n piece = self[pos]\n color = piece.color\n potential_moves = piece.potential_moves\n valid_moves = []\n potential_moves.each do |to_pos|\n if self.valid_move?(pos, to_pos, color)\n valid_moves << to_pos\n end\n end\n valid_moves\n end",
"def get_random_next_move(arena)\n head = get_head_coords\n moves = []\n # N\n cell = arena.get(head[:x], head[:y] - 1)\n moves << 'N' if cell == 'empty' || cell[0..3] == 'tail'\n # S\n cell = arena.get(head[:x], head[:y] + 1)\n moves << 'S' if cell == 'empty' || cell[0..3] == 'tail'\n # E\n cell = arena.get(head[:x] + 1, head[:y])\n moves << 'E' if cell == 'empty' || cell[0..3] == 'tail'\n # W\n cell = arena.get(head[:x] - 1, head[:y])\n moves << 'W' if cell == 'empty' || cell[0..3] == 'tail'\n\n # Return any direction or nil\n moves.sample\n end",
"def minimum_moves(discs)\n 2 * discs + 1\nend",
"def knight_moves(starting_position,ending_position)\n return puts \"You didn't need to move at all!\" if starting_position == ending_position\n search_queue = []\n moves_array = [starting_position]\n knight = Knight.new(starting_position)\n possible_moves = knight.next_possible_moves\n if possible_moves.include?(ending_position)\n moves_array << ending_position\n number_of_moves = moves_array.size - 1\n else\n possible_moves.each do |position|\n search_queue << [position]\n end\n end\n until moves_array[-1] == ending_position\n next_moves = search_queue.shift\n knight.position = next_moves[-1]\n possible_moves = knight.next_possible_moves\n if possible_moves.include?(ending_position)\n next_moves.each { |move| moves_array << move }\n number_of_moves = moves_array.size\n moves_array << ending_position\n else\n possible_moves.each do |position|\n possibility = next_moves + [position]\n search_queue << possibility\n end\n end\n end\n if number_of_moves == 1\n puts \"You made it in #{number_of_moves} move! Here's your path:\"\n else\n puts \"You made it in #{number_of_moves} moves! Here's your path:\"\n end\n moves_array.each { |position| puts position.inspect }\nend",
"def each_move\n SQ.select { |i| @colors[i] == @mx }.each do |f|\n if @pieces[f] == PAWN\n t = f + UP[@mx]\n yield(f, t + 1) if @colors[t + 1] == @mn && SQ120[SQ64[t] + 1] != NULL\n yield(f, t - 1) if @colors[t - 1] == @mn && SQ120[SQ64[t] - 1] != NULL\n next unless @colors[t] == EMPTY\n yield(f, t)\n yield(f, t + UP[@mx]) if @colors[t + UP[@mx]] == EMPTY && (f >> 3) == (SIDE[@mx] - 1).abs\n next\n end\n STEPS[@pieces[f]].each do |s|\n t = SQ120[SQ64[f] + s]\n while t != NULL\n yield(f, t) if @colors[t] != @mx\n break if @pieces[f] == KING || @pieces[f] == KNIGHT || @colors[t] != EMPTY\n t = SQ120[SQ64[t] + s]\n end\n end\n end\n end",
"def possibleMoves(arr,visited)\n moves = []\n VALID_MOVES.each do |x,y|\n if valid?([arr[0]+x,arr[1]+y],visited)\n moves.push([arr[0]+x,arr[1]+y])\n end\n end\n return moves\n end"
] | [
"0.6923934",
"0.69164264",
"0.68595105",
"0.6798775",
"0.6798461",
"0.6728409",
"0.6715774",
"0.6693639",
"0.66842777",
"0.6676377",
"0.6672635",
"0.6667831",
"0.6663717",
"0.666013",
"0.66576385",
"0.6639141",
"0.66182566",
"0.6593605",
"0.65808606",
"0.6543156",
"0.6531702",
"0.6494611",
"0.64804554",
"0.6465044",
"0.6448038",
"0.6432544",
"0.64028627",
"0.63974625",
"0.6395044",
"0.6391869",
"0.63876307",
"0.6386645",
"0.63792974",
"0.637457",
"0.63589233",
"0.6352505",
"0.6322784",
"0.63067615",
"0.63060516",
"0.629104",
"0.62866855",
"0.62857807",
"0.6282746",
"0.62748367",
"0.6246447",
"0.62432736",
"0.6237033",
"0.62296265",
"0.6216516",
"0.62159115",
"0.6207698",
"0.61847687",
"0.6174792",
"0.61736965",
"0.61714965",
"0.61705744",
"0.61535376",
"0.61466515",
"0.6144646",
"0.6142365",
"0.6137435",
"0.61365086",
"0.61361593",
"0.6132043",
"0.6131584",
"0.612935",
"0.61281496",
"0.6125775",
"0.6120097",
"0.6094909",
"0.6092383",
"0.6082068",
"0.60653996",
"0.6046954",
"0.60413986",
"0.603683",
"0.6036726",
"0.6024146",
"0.6022195",
"0.601887",
"0.60186017",
"0.6014181",
"0.60135996",
"0.60029083",
"0.6001527",
"0.59959567",
"0.5994521",
"0.5988444",
"0.59858763",
"0.59818137",
"0.5970165",
"0.5959329",
"0.59572124",
"0.5955439",
"0.594934",
"0.59477586",
"0.5944769",
"0.592813",
"0.5925486",
"0.5923861"
] | 0.64069617 | 26 |
Returns the path taken to reach the destination | def path_to_destination(knights_path, inital_knight_position)
steps_taken = []
loop do
steps_taken << to_char(knights_path[:position][0], knights_path[:position][1])
if knights_path == inital_knight_position
return steps_taken.reverse.to_sentence
end
knights_path = knights_path[:source]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_path(dest,path)\n if @prev[dest] != -1\n path += get_path(@prev[dest],\"\")\n end\n path += \">#{dest}\"\n end",
"def destination_path\n @destination_path ||= Pathname.new(self.destination_root)\n end",
"def given_destination\n dir\n end",
"def find_path(goal) \n \n end",
"def destination\r\n @destination\r\n end",
"def destination\n @destination\n end",
"def destination\n @destination\n end",
"def destination_path\n @_destination_path ||= \"#{@rf['project_id']}/#{@rf['booking_id']}/\" end",
"def find_path(dest)\n if @previous[dest] != -1\n find_path @previous[dest]\n end\n @path << dest\n end",
"def dest_path\n @dest_path ||= remote_path.sub(/^~\\//, '').sub(/\\/$/, '')\n end",
"def destination_path\n File.expand_path File.join(options[:root], destination) unless destination.nil?\n end",
"def destination(dest)\n # The url needs to be unescaped in order to preserve the correct filename.\n path = File.join(dest, @dir, @name )\n# path = File.join(path, \"index.html\") if self.url =~ /\\/$/\n path\n end",
"def destination_rel_dir\n @_dest_dir\n end",
"def path_to(to)\n from = Pathname.new('/' + current_resource.destination_path).dirname\n rp = Pathname.new( Pathname.new(to).relative_path_from(from) ).cleanpath.to_s + '/'\n rp == './' ? '' : rp\n end",
"def relative_path(from, to); end",
"def calc_path\n endpoint = grid.target\n while endpoint\n search.path[endpoint] = true\n endpoint = search.came_from[endpoint]\n end\n end",
"def destination_path\n staged_path\n end",
"def find_path()\n visited = Array.new(8) {Array.new(8)}\n return [] if @destination == @currentPosition\n paths = [[@currentPosition]]\n visited[@currentPosition[0]][@currentPosition[1]] = true\n\n until paths.empty?\n new_paths = []\n paths.each do |path|\n next_positions = possibleMoves(path.last, visited)\n next_positions.each do |move|\n newpath = path.dup << move\n if move == @destination #if we reached our destination stop and return the path\n return newpath\n end\n visited[move[0]][move[1]] = true\n new_paths.push(newpath)\n end\n end\n paths = new_paths\n end\n end",
"def path\n @link.TargetPath\n end",
"def path_to(destination, options = {})\n Gdirections::Route.find(self, destination, options)\n end",
"def get_path_recursively(previouses, src, dest)\n return src if src == dest\n raise ArgumentError, \"No path from #{src} to #{dest}\" if previouses[dest].nil?\n [dest, get_path_recursively(previouses, src, previouses[dest])].flatten\n end",
"def path\n @location.path\n end",
"def destination(dest)\n # The url needs to be unescaped in order to preserve the correct filename.\n path = File.join(dest, @dest_dir, @dest_name )\n path = File.join(path, \"index.html\") if self.url =~ /\\/$/\n path\n end",
"def print_path(dest)\n if @prev[dest] != -1\n print_path @prev[dest]\n end\n print \">#{dest}\"\n end",
"def path\n location.path\n end",
"def relative_path_to(target)\n require 'pathname'\n\n # Find path\n if target.is_a?(String)\n path = target\n else\n path = target.path\n raise RuntimeError, \"Cannot get the relative path to #{target.inspect} because this target is not outputted (its routing rule returns nil)\" if path.nil?\n end\n\n # Get source and destination paths\n dst_path = Pathname.new(path)\n raise RuntimeError, \"Cannot get the relative path to #{path} because the current item representation, #{@item_rep.inspect}, is not outputted (its routing rule returns nil)\" if @item_rep.path.nil?\n src_path = Pathname.new(@item_rep.path)\n\n # Calculate the relative path (method depends on whether destination is\n # a directory or not).\n if src_path.to_s[-1,1] != '/'\n relative_path = dst_path.relative_path_from(src_path.dirname).to_s\n else\n relative_path = dst_path.relative_path_from(src_path).to_s\n end\n\n # Add trailing slash if necessary\n if dst_path.to_s[-1,1] == '/'\n relative_path << '/'\n end\n\n # Done\n relative_path\n end",
"def compute_path(source_x, source_y, destination_x, destination_y)\n build_structures(source_x, source_y)\n path([destination_x, destination_y])\n backtrace(source_x, source_y, destination_x, destination_y)\n end",
"def find_path(goal = @maze.find_end)\n path = [goal]\n spot = goal\n until @branching_paths[spot] == nil\n path << @branching_paths[spot]\n spot = @branching_paths[spot]\n end\n path\n end",
"def get_destination_for_path(path)\n route, resource_path = extract_path_info(path)\n destination_info = destination_map[route.to_sym]\n fail DestinationNotFound.new(route) if destination_info.nil?\n\n URI.join(\"#{destination_info[:host]}:#{destination_info[:port]}\", resource_path.to_s)\n end",
"def destination_path\n if @site.respond_to?(:in_dest_dir)\n @site.in_dest_dir(path)\n else\n Jekyll.sanitized_path(@site.dest, path)\n end\n end",
"def relative_to_output(dest)\n if dest =~ /^\\//\n Pathname.new(dest).relative_path_from(output)\n else\n dest\n end\n end",
"def destination_dir_pathname\n Pathname(ARGV[1])\n end",
"def path\n File.join(@base, @target)\n end",
"def destination\n @destination ||= shared_path + \"/#{@repository_cache}\"\n end",
"def destination\n @attributes[:destination]\n end",
"def print_path(dest)\n\t\tif @prev[dest] != -1\n\t\t\tprint_path @prev[dest]\n\t\tend\n\t\tprint \">#{dest}\"\n\tend",
"def path\n return @path\n end",
"def dest_path\n @dest_path ||= File.expand_path(path)\n end",
"def dest_path\n @dest_path ||= File.expand_path(path)\n end",
"def find_destination_position\n @d_pos = @to_be_pathed.find_index do |i|\n i[1] == @destination\n end\n end",
"def path(source, target)\n predecessor = target\n result_path = []\n\n # follow the leads from the back\n until predecessor == source\n result_path << predecessor.number\n predecessor = meta[predecessor]\n end\n\n # add the source, since now `predecessor == source` is true\n result_path << source.number\n result_path.reverse.join(\", \")\n end",
"def destination\n\t\treturn self.destinations.last\n\tend",
"def go(direction)\n return @paths[direction]\n end",
"def relative_to_output(dest)\n if dest =~ /^\\//\n Pathname.new(dest).relative_path_from(output)\n else\n dest\n end\n end",
"def relative_path_from(from); end",
"def path src, dest\n path = _path srcPaths: [[@nodes[src]]], dest: @nodes[dest]\n if !path.nil?\n path.map(&:value)\n end\n end",
"def find_path_to(final_position)\n @final_position = Position.new(final_position)\n find_path\n end",
"def destination_path\n File.join(test_path, name)\n end",
"def getDestination()\r\n\t\treturn @dnode\r\n\tend",
"def path(source, target, meta)\n # retrieve the path to the target node, using the meta hash\n # that was constructed at each iteration of the `each` iteration\n predecessor = target\n result_path = []\n\n # follow the leads from the back\n until predecessor == source\n result_path << predecessor.number\n predecessor = meta[predecessor]\n end\n\n # add the source, since now `predecessor == source` is true\n result_path << source.number\n result_path.reverse.join(\", \")\nend",
"def destination(base_directory); end",
"def dest_get\n db_select 'destination'\n end",
"def find_path(target) \n destination = @root_node.bfs(target) \n trace_path_back(destination)\n end",
"def target_url(target)\n File.join(\"/\", Pathname.new(target).relative_path_from(Pathname.new(DST_DIR)).to_s)\nend",
"def print_path(dest)\n\t\tif @predecessor_node[dest] != -1\n\t\t\tprint_path @predecessor_node[dest]\n\t\tend\n\t\tprint \">#{dest}\"\n\tend",
"def destination(dest)\n File.join(dest, @ddir, @name)\n end",
"def pathTo(name)\r\n\t\tif @paths.nil?\r\n\t\t\treturn nil\r\n\t\tend\r\n\t\t@paths.each do |path|\r\n\t\t\tif path.getDestination().getName() == name\r\n\t\t\t\treturn path\r\n\t\t\tend\r\n\t\tend\r\n\t\treturn nil\r\n\tend",
"def get_path(start, stop)\n @graph.dijkstra_shortest_path(@weight_map, start, stop)\n end",
"def knight_path(from, to)\n\topen_queue = [PositionPath.new( from, [copy(from)] )]\n\tdiscovered = [from]\n\n\tuntil open_queue.empty?\n\t\tcurrent = open_queue.shift\n\n\t\treturn current.path if current.position == to\n\t\tvalid_moves(current.position).each do |move|\n\t\t\tunless discovered.include?(move)\n\t\t\t\tdiscovered << move\n\t\t\t\topen_queue.push(make_position_path(current, move)) \n\t\t\tend\n\t\tend\n\tend\n\t\nend",
"def pathDistSource\n\tpathDist + \"source/\"\nend",
"def full_path\n path\n end",
"def path\n return @path\n end",
"def path\n return @path\n end",
"def path\n return @path\n end",
"def path\n return get_path self\n end",
"def destination_root\n File.expand_path(options[:dest])\n end",
"def destination(dest)\n @destination ||= {}\n @destination[dest] ||= begin\n path = site.in_dest_dir(dest, URL.unescape_path(url))\n path = File.join(path, \"index\") if url.end_with?(\"/\")\n path << output_ext unless path.end_with? output_ext\n path\n end\n end",
"def destination(dest); end",
"def destination(dest); end",
"def full_path_to_remote_dir\n (remote_dir[0] == ?/ ? remote_dir : \"$(pwd)/#{remote_dir}\").chomp('/')\n end",
"def to_path\n @path\n end",
"def to_www\n @path \n end",
"def destination; frame[:destination]; end",
"def get_dest_filepath(source)\n # If is a directory ending with a dot, we remove the dot\n source = source[0..-3] + '/' if source[-2..-1] == './'\n # We change the prefix from source to dest\n source.gsub!(@path_source, @path_destination)\n source\n end",
"def destination\n #configuration[:release_path]\n @destination ||= File.join(tmpdir, File.basename(configuration[:release_path]))\n\n end",
"def path\n @path\n end",
"def path\n @path\n end",
"def extractPath(goalPoint)\n # Set initial cost\n currCost = @visited[self.getXYIndex(goalPoint)];\n \n # Initialize final path and add the goal point\n finalPath = []\n finalPath.push(goalPoint)\n\n # Search until the cost reaches to 1 (start point)\n while (currCost > 1)\n # Get reverse neighbors\n succList = self.getNeighbors(finalPath[-1])\n for succ in succList\n # Check if it is the previous because the cost is -1\n if (@visited[self.getXYIndex(succ)] == currCost-1)\n finalPath.push(succ)\n currCost -= 1\n break\n end\n end\n end\n \n # Reverse path and return it\n return finalPath.reverse\n end",
"def destination(dest)\n # The url needs to be unescaped in order to preserve the correct filename\n File.join(dest, CGI.unescape(full_url))\n end",
"def output_path\n File.join(Musako.destination_path, @url)\n end",
"def get_path(start, finish) \n @retreat_algorithm.set_graph(memory.construct_grid) \n @retreat_algorithm.run(start, finish)\n end",
"def path\n @path\n end",
"def path\n @path\n end",
"def path\n @path\n end",
"def path\n @path\n end",
"def destination_path\n if @site.respond_to?(:in_dest_dir)\n @site.in_dest_dir(\"sitemap.xml\")\n else\n Jekyll.sanitized_path(@site.dest, \"sitemap.xml\")\n end\n end",
"def relative_dest_path\n @relative_dest_path ||= begin\n path = case ext\n when \".scss\", \".slim\"\n path_without_ext\n when \".md\"\n path_without_ext.join('index.html')\n else\n @path\n end\n\n Pathname.new(path.to_s.downcase)\n end\n end",
"def path\n File.join(@base, @dir.sub(@dst_dir, @src_dir), @name)\n end",
"def path\r\n url.gsub(/https?:\\/\\/[^\\/]+\\//i, '').scan(/([^&]+)/i).first().first()\r\n end",
"def shortest_path\n initial_position_obj = { position: start_position, source: {} }\n\n knights_path = [initial_position_obj]\n\n while knights_path.present?\n current_position = knights_path.shift\n\n position = current_position[:position]\n\n if position == end_position\n return path_to_destination(current_position, initial_position_obj)\n end\n\n add_possible_destination(position, current_position, knights_path)\n end\n end",
"def full_path; end",
"def determine_path\n if source_line.file == SourceLine::DEFAULT_FILE\n return source_line.file\n end\n\n full_path = File.expand_path(source_line.file)\n pwd = Dir.pwd\n\n if full_path.start_with?(pwd)\n from = Pathname.new(full_path)\n to = Pathname.new(pwd)\n\n return from.relative_path_from(to).to_s\n else\n return full_path\n end\n end",
"def fullDestPath(destPath)\n\t'generated/' + destPath\nend",
"def destination(dest)\n # The url needs to be unescaped in order to preserve the correct filename\n path = Jekyll.sanitized_path(dest, CGI.unescape(url))\n path = File.join(path, 'index.html') if path[/\\.html$/].nil?\n path\n end",
"def path\n # TODO: is this trip really necessary?!\n data.fetch(\"path\") { relative_path }\n end",
"def path\n location.nil? ? nil : location.path\n end",
"def origin\n\t\t# Split the full path of the video file by /\n\t\t# and then exclude the last part (whic is the filename)\n\t\t# and join the path back together\n\t\tpaths = self.fullpath.split('/')\n\t\tif paths.length > 1 then\n\t\t\tres = Helpers::trailingslash(Helpers::trailingslash($config[:origin_dir]) + paths.slice(0, paths.length - 1).join('/'))\n\t\telse\n\t\t\tres = Helpers::trailingslash($config[:origin_dir])\n\t\tend\n\t\treturn res\n\tend",
"def shortest_path_to(dest_node)\n return unless has_path_to?(dest_node)\n path = []\n while (dest_node != @node) do\n path.unshift(dest_node)\n dest_node = @edge_to[dest_node]\n end\n path.unshift(@node)\n end",
"def destination(dest)\n File.join(dest, CGI.unescape(self.url))\n end",
"def destination_file_name\n return @destination_file_name\n end"
] | [
"0.748106",
"0.7184996",
"0.71724826",
"0.7058811",
"0.7029395",
"0.69140947",
"0.69140947",
"0.6913661",
"0.6889298",
"0.6837211",
"0.6827346",
"0.6816735",
"0.67335624",
"0.6706399",
"0.6632025",
"0.66304296",
"0.6585009",
"0.65459114",
"0.65425324",
"0.6528802",
"0.6465385",
"0.6403307",
"0.6379167",
"0.63697237",
"0.6350649",
"0.6333917",
"0.6318185",
"0.6317552",
"0.6308971",
"0.630777",
"0.6307064",
"0.6271847",
"0.6268699",
"0.62667996",
"0.6262402",
"0.62580734",
"0.62347555",
"0.6218172",
"0.6218172",
"0.6207622",
"0.6201569",
"0.61959964",
"0.619486",
"0.6194048",
"0.61791396",
"0.61706364",
"0.6167256",
"0.6160714",
"0.6140095",
"0.61351526",
"0.6123754",
"0.6115568",
"0.6111256",
"0.60986584",
"0.6088756",
"0.6068133",
"0.6066068",
"0.6060585",
"0.60481465",
"0.6048013",
"0.60387236",
"0.6026998",
"0.6026998",
"0.6026998",
"0.60229075",
"0.60219765",
"0.601885",
"0.6016424",
"0.6016424",
"0.601363",
"0.6003719",
"0.600303",
"0.5997104",
"0.5984412",
"0.5983662",
"0.597076",
"0.597076",
"0.5961077",
"0.5959827",
"0.59482944",
"0.59467393",
"0.5925176",
"0.5925176",
"0.5925176",
"0.5925176",
"0.592063",
"0.5907035",
"0.59022504",
"0.5897091",
"0.58968514",
"0.5893869",
"0.5890683",
"0.58903533",
"0.5881286",
"0.58800024",
"0.58794665",
"0.5878547",
"0.5864486",
"0.58632874",
"0.5863162"
] | 0.6485802 | 20 |
Saves the given knight's position and returns the board id | def save
if self.class.valid_position?(knight_position)
unique_board_id = board_id
redis_conn.set(unique_board_id, knight_position)
{ status: :success, board_id: unique_board_id }
else
{ status: :failed, message: "Invalid knight's position" }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save\n\t\t[@board, @player1, @player2, @player_turn, @check]\n\tend",
"def export\n # Temporarily use first database entry for all saves\n s = ChessSave.first\n s.position = @current_state[:position].join\n s.human_to_move = @current_state[:player] == :human\n s.save\n end",
"def place_knights\r\n $board[1][0] = Knight.new('white')\r\n\t\t$board[6][0] = Knight.new('white')\r\n\t\t$board[1][7] = Knight.new('black')\r\n\t\t$board[6][7] = Knight.new('black')\r\n end",
"def place_piece piece_id, r, c\r\n puts \"Placing a #{piece_id} at #{r}, #{c}\"\r\n @board[r][c]= piece_id\r\n end",
"def winning_move(board)\n winning_spot = nil\n \n board.empty_position.each do |spot|\n board.place_mark(*spot, marker)\n winning_spot = spot if board.won?\n board[*spot] = nil\n end\n \n winning_spot\n end",
"def save_game\n @drawing= false\n puts \"Save game...\"\n db = Db.new\n score = @window.level.mouse.score\n lvl = @window.level.num\n name = Time.now.strftime(\"%d/%m/%Y %H:%M\")\n db.save_game name, score, lvl\n end",
"def save_game\n\t\tsaves = []\n\t\tsaves << @board\n\t\tsaves << @current_player\n\t\tsave_yaml = YAML.dump(saves)\n\n\t\tFile.open('saved_game.yaml', 'w') do |file|\n\t\t\tfile.puts save_yaml\n\t\tend\n\t\tputs \"Your game has been saved.\"\n\t\tputs \"Closing the game...\"\n\t\texit\n\tend",
"def save_moves\n\t\tFile.open(@filename, 'w') {|f| f.write(@past_moves.to_yaml)}\n\tend",
"def make_player_move!(player_move_position)\n self.game_data[player_move_position] = \"O\"\n self.player_move_count += 1\n self.save!\n end",
"def update_board(board, position, marker)\n\tboard[position] = marker\n\tboard\nend",
"def set_move move\n@board[move] = @player\nend",
"def move(board, position, player = 'X')\n #player = current_player(board) #w/o this line, tictactoe spec will run properly\n position = position.to_i - 1\n board[position] = player\nend",
"def mark(row, col, player)\n new_board = Board.new(@m.map(&:dup), @human_player, @computer_player)\n new_board.mark!(row, col, player.to_s)\n new_board\n end",
"def update_board(mark, position)\n position = position.to_i\n\n @play_area[position] = mark\n end",
"def update_board(spot, symbol)\n @board[spot[0]][spot[1]] = symbol\n end",
"def place_piece(player, piece, position)\n raise BoardLockedError, \"Board was set from FEN string\" if @fen\n rank_index = RANKS[position.downcase.split('').first]\n\n file_index = position.split('').last.to_i-1\n icon = (piece == :knight ? :night : piece).to_s.split('').first\n (player == :black ? icon.downcase! : icon.upcase!)\n @board[file_index][rank_index] = icon\n end",
"def knight_moves(position_start,position_end)\n \n\n move = [-2,-1,1,2,].product([-2,-1,1,2]).select do |x,y| x.abs != y.abs end\n \n board = (0..7).map do \n [Array.new(8,nil)]\n end\n \n queue= []\n queue.push(position_start)\n notFind = true\n \n \n while !queue.empty? && notFind \n position = queue.shift\n move.\n collect do |x,y| \n [position[0] + x , position[1] + y]\n end.\n find_all do |x,y| \n (0..7) === x && (0..7) === y \n end.\n each do |x,y|\n if board[x][y].nil? \n board[x][y] = position \n notFind = !(x == position_end[0] && y == position_end[1])\n queue.push([x,y])\n end \n end \n end\n \n path = []\n position = position_end\n path << position_end\n while position != position_start \n position = board[position[0]][position[1]]\n path.unshift(position)\n end\n \n path\n end",
"def export\n # Temporarily use first database entry for all saves\n s = GomokuSave.first\n s.position = @current_state.position.join\n s.human_to_move = @current_state.player == :human\n s.human_last_row = @current_state.last_move[:human][0]\n s.human_last_column = @current_state.last_move[:human][1]\n s.computer_last_row = @current_state.last_move[:computer][0]\n s.computer_last_column = @current_state.last_move[:computer][1]\n s.top = @current_state.outer_bounds[:top]\n s.bottom = @current_state.outer_bounds[:bottom]\n s.left = @current_state.outer_bounds[:left]\n s.right = @current_state.outer_bounds[:right]\n s.save\n end",
"def knight_moves\n\t\tnode = Square.new(@start)\n\t\t@queue << node\n\t\twhile @queue.empty? == false\n\t\t\tcurrent = @queue[0]\n\t\t\tif current.value == @final\n\t\t\t\tdisplay_result(current)\t\t\t\n\t\t\telse\n\n\t\t\t\t8.times do |num|\n\t\t\t\t\tx = current.value[0] + @row[num]\n\t\t\t\t\ty = current.value[1] + @col[num]\n\t\t\t\t\tif (x.between?(1,8) && y.between?(1,8)) && @revised.include?([x, y]) == false\n\t\t\t\t\t\tnode = Square.new([x, y])\n\t\t\t\t\t\tnode.parent = current\n\t\t\t\t\t\tnode.count = current.count + 1\n\t\t\t\t\t\t@queue << node\n\t\t\t\t\telse\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t@revised << current.value\n\t\t\t\t@queue.shift\n\t\t\tend\n\t\tend\n\t\tputs \"NOT FOUND !!!\"\n\t\tputs \"This program presumes a 8x8 Chess Board\"\n\t\tputs \"Therefore your coordinates must be between (1, 1) and (8, 8).\"\n\tend",
"def save_pos; end",
"def save_moves file, tree, player\n # If we have -1, -1 as coordinates, which we just skip\n if tree['x'] != -1 and tree['y'] != -1 then\n # color and coordinates\n file.write \";#{player}[#{sgf_board_position(tree)}]\"\n\n # the other player is to play next\n player = invert_color(player)\n\n # do we have any move comments?\n comment = tree['text']\n\n # Is this the answer (right or wrong) already?\n if tree['correct_answer'] == true then\n comment = \"Correct.\\n#{comment}\"\n elsif tree['wrong_answer'] == true then\n comment = \"Wrong.\\n#{comment}\"\n end\n\n file.write \"C[#{comment.escape_for_sgf}]\" unless comment.nil? or comment.empty?\n end\n\n # do we have any marks?\n unless tree['marks'].nil? or tree['marks'].size == 0\n tree['marks'].each { |mark|\n position = sgf_board_position mark\n type = mark['marks']\n\n file.write \"CR[#{position}]\" unless type['circle'].nil?\n file.write \"TR[#{position}]\" unless type['triangle'].nil?\n file.write \"MA[#{position}]\" unless type['cross'].nil?\n file.write \"SQ[#{position}]\" unless type['square'].nil?\n file.write \"LB[#{position}:#{type['letter']}]\" unless type['letter'].nil?\n }\n end\n\n # do we have follow-ups?\n unless tree['branches'].nil? or tree['branches'].size == 0\n if tree['branches'].size > 1 then\n # multiple possible moves\n tree['branches'].each { |branch|\n file.write '('\n save_moves file, branch, player\n file.write \")\\n\"\n }\n\n elsif tree['branches'].size == 1 then\n # a single follow-up move\n save_moves file, tree['branches'][0], player\n end\n end\n end",
"def get_saved_game(game_id)\n res = @db.query(\"SELECT Board, GameType, Turn, LastPlayed FROM SavedGames WHERE GameID = #{game_id};\")\n row = res.fetch_row\n rows, columns = get_col_row(row[0])\n gs = GameState.new(2, row[1].to_sym, rows, columns)\n set_board(gs, row[0], rows, columns)\n coord = row[3].split\n gs.last_played = Coordinate.new(coord[0].to_i, coord[1].to_i)\n gs.player_turn = row[2].to_i\n gs\n end",
"def update_move(board, player, position)\n\tboard[position.to_i - 1] = player\n\tboard\nend",
"def move(board, index, marker)\n board[index] = marker\nend",
"def savePlayer(theName, theTime)\n\t\t@rankedTimeDB.execute(\"INSERT INTO rankedTime (name, time, idMap) VALUES('#{theName}', #{theTime}, #{@idMap})\")\t\n\tend",
"def moveSave(new_board)\nboard = [a1, a2, a3, b1, b2, b3, c1, c2, c3]\nboard.push(new_board)\nreturn board\nend",
"def move(board, pos, mark=\"X\")\n board[pos.to_i-1] = mark\nend",
"def encode_board(board)\n bot_board = SBot::Board.new(nil, board.number)\n 1.upto(9).each do |x|\n 1.upto(9).each do |y|\n piece_value = board.get_piece_value([x, y])\n bot_point = y * 10 + x\n bot_board.board[bot_point] = piece_value\n end\n end\n bot_board.sente_hand = board.sente_hand.to_a\n bot_board.gote_hand = board.gote_hand.to_a\n bot_board\n end",
"def knight(p1)\n row = get_row_from_index(p1)\n col = get_col_from_index(p1)\n valid = []\n valid_no_ff = []\n\n # Valid knight moves based on its board position\n if row < 7 && col < 8\n valid << (p1 + 17)\n end\n if row < 7 && col > 1\n valid << (p1 + 15)\n end\n if row < 8 && col < 7\n valid << (p1 + 10)\n end\n if row < 8 && col > 2\n valid << (p1 + 6)\n end\n if row > 1 && col < 7\n valid << (p1 - 6)\n end\n if row > 1 && col > 2\n valid << (p1 - 10)\n end\n if row > 2 && col < 8\n valid << (p1 - 15)\n end\n if row > 2 && col > 1\n valid << (p1 - 17)\n end\n\n # All possible moves for the knight based on board boundaries will added\n # This iterator filters for friendly fire, and removes indexes pointing to same color pices\n valid.each do |pos|\n unless piece_color(pos) == @@color\n valid_no_ff << pos\n end\n end\n\n return valid_no_ff\n end",
"def set_piece(player,location) #takes the arguments player and location\n\t\t@piece=player.piece #defines piece as the player's number (either 1 or 2)\n\t\trow=(location-1)/4 #takes the value of location (1-16) and converts it into a row coordinate 0, 1, 2, or 3\n\t\tcolumn=(location+3)%4 #takes the value of location (1-16) and converts it into a column coordinate 0, 1, 2, or 3\n\t\t@board[row][column]=@piece #defines the cell that the player has just selected as the player's number (1 or 2)\n\t\t@size+=1 #we count each move after its been made which is used in the function below, check_full?\n\tend",
"def update_board(board)\r\n @game_board = board\r\n end",
"def add_to_board(board, tet, loc)\n\t\nend",
"def move(board, position, current_player)\n board[position] = current_player\nend",
"def move(board, position, current_player= \"X\")\n board[position.to_i - 1] = current_player\nend",
"def coord_to_index(piece, board)\n all_coordinates = board.keys\n index = all_coordinates.index(piece.position.to_sym) \n end",
"def move(board, position, current_player = \"X\")\n board[position.to_i-1] = current_player\nend",
"def place_piece piece, position\n @board[@@ROWS.index(position[0])][@@COLUMNS.index(position[1])] = piece\n end",
"def winner_move(game, mark)\n (0..2).each do |x|\n (0..2).each do |y|\n board = game.board.dup #using the board's deep dup method\n pos = [x, y]\n\n next unless board.empty?(pos) #makes sure current position is empty\n board[pos] = mark #sets the current position on the dup'd board\n\n #returns the position if pos would make computer the winner\n # (remember, mark is set by the game object to track who is who)\n return pos if board.winner == mark\n end\n end\n\n # no winning move\n nil\n end",
"def move(board, location, current_player = \"X\")\n board[location.to_i-1] = current_player\nend",
"def move(board, location, current_player = \"X\")\n board[location.to_i-1] = current_player\nend",
"def set_night\n @night = Night.find(params[:id])\n end",
"def move(piece, column, row) \n piece.column = column\n piece.row = row\n @board[piece.column][piece.row] = piece\n end",
"def place_piece(player)\n $grid_hash[$confirmed_piece] = player\n return true\nend",
"def player_move(board, index, marker)\n board[index] = marker\n end",
"def saveMove(player, letter, word, x, y)\n if (self.pass?)\n self.update_attribute(:pass, false)\n end\n\n @grid[x][y] = letter\n self.playedWords << PlayedWord.new(game: self, player: player, letter: letter, word: word, x: x, y: y)\n player.addWord(word)\n\n # The grid is full, the game is finished\n if (self.playedWords.size + self.firstWord.length == self.size * self.size)\n end_game\n end\n end",
"def move(location, token)\n @board[location.to_i-1] = token\nend",
"def board_at_last_move\n game.board_at_move(game.move - 1)\n end",
"def get_move(game_board)\n position = game_board.index(\"\") # get the index of the first open position\n move = @moves[position] # get the corresponding location for the index\n end",
"def insert_play_on_board(player, turno)\n row_pos = 0\n #Verifica si el primer caracter del turno es letra, si si se obtiene su equivalente en numero siendo a = 0 y z = 26\n if turno[0].to_i == 0\n (\"a\"..\"z\").each_with_index do |letra, i|\n if turno[0] == letra\n row_pos = i\n end\n end\n else #Si el primer caracter no fue letra significa que es numero y se procede a obtener el equivalente de la letra\n (\"a\"..\"z\").each_with_index do |letra, i|\n if turno[1] == letra\n row_pos = i\n end\n end\n end\n col_pos = (turno[0].to_i != 0 ? turno[0].to_i : turno[1].to_i) - 1\n #Se pregunta que amenos que el espacio donde se piensa colocar la ficha sea un lugar vacio se inserta si no se descarta\n unless @tablero.component(row_pos, col_pos) != \" \"\n @tablero.send(:[]=, row_pos, col_pos, player.ficha)\n return true\n else\n puts \"Lo siento ese lugar esta ocupado krnal\"\n return false\n end\n end",
"def move\n\tputs \"Where would you like to move this king? Enter the coords as a 2-digit number\"\n\tnew_pos=gets.chomp\n\tx=new_pos[0].to_i\n\ty=new_pos[1].to_i\n\tif @moves.include? ([x,y])\n\t board[x][y]=self.sym\n\t board[self.pos[0]][self.pos[1]]=\"___\"\n\t self.pos=[x,y]\n\telse\t \n\t move\n\tend\nend",
"def move(board, position, player=current_player(board))\n position = position.to_i\n board[position-1]=player\nend",
"def make_move(move)\n\t\t@board[move]= $current_player\n\tend",
"def save_game\n Dir.mkdir(\"../saves\") unless Dir.exists?(\"../saves\")\n @@save_count += 1\n binding.pry\n log_saves\n savefile = \"../saves/save_#{@@save_count}.yml\"\n File.open(savefile, 'w') do | file |\n file.write(self.to_yaml)\n end\n end",
"def move(board, position, value = \"X\")\n\n board[position.to_i - 1] = value\n\n return board\nend",
"def write_board\n data = YAML.dump(@scores)\n File.write(@filename, data)\n end",
"def turn(row, column)\n place_piece(row, column)\n puts display_board\n check_for_win() \n end",
"def save_game(game_id, user1, user2, game_state)\n delete_saved_game(game_id)\n @db.query(\"INSERT INTO SavedGames \n (GameID, User1, User2, GameType, Board, Turn, LastPlayed)\n VALUES (#{game_id},\n '#{user1}',\n '#{user2}',\n '#{game_state.type}',\n '#{get_board(game_state)}',\n #{game_state.player_turn},\n '#{game_state.last_played.row} #{game_state.last_played.column}');\")\n end",
"def move(position, player=current_player)\n position = position.to_i\n @board[position-1]=player\n end",
"def move(board, move, player)\n board[move] = player\nend",
"def move(board, position , player= \"X\" )\n\tposition = position.to_i\n\tboard[position -1] = player\n\tdisplay_board(board)\nend",
"def move(board , location , player_character = \"X\")\n location = location.to_i\n board[location-1] = player_character\n return board\nend",
"def move(board , location , player_character = \"X\")\n location = location.to_i\n board[location-1] = player_character\n return board\nend",
"def save_game\n\t\t# If current game was previously saved, delete the old version of current game...\n\t\tif @running_saved_game != nil\n\t\t\tover_write_data\n\t\tend\n\t\t# And add new version of current game to saved data\n\t\tFile.open(@path, 'a+') do |f|\n\t\t\t\tf.puts \"#{@word.join},#{@guess},#{@wrong_letters},#{@turn}\"\n\t\tend\n\tend",
"def knight_moves(start_case, target_case)\r\n knight = Knight.new\r\n board = Board.new\r\n\r\n board.moves(knight, start_case, target_case)\r\nend",
"def update_board(board_arr, position, marker)\r\n\t#takes the board (as an array)\r\n\t#the position (as an integer for the index position)\r\n\t#and a marker\r\n\tboard_arr[position] = marker\r\n\tboard_arr\r\nend",
"def move_piece(board, move)\n # norm: <file_start><rank_start></file_end><rank_end>\n file_start = move.notation[0]\n rank_start = move.notation[1].to_i\n file_end = move.notation[2]\n rank_end = move.notation[3].to_i\n board[file_end][rank_end - 1] = board[file_start][rank_start - 1]\n board[file_start][rank_start - 1] = nil\n\n board\n end",
"def save_children(id, flowcell)\n flowcell.each_with_index do |lane, position|\n @session.save(lane, id, position)\n end\n end",
"def save_children(id, flowcell)\n flowcell.each_with_index do |lane, position|\n @session.save(lane, id, position)\n end\n end",
"def save()\n sql = \"\n INSERT INTO players\n ( name, team )\n VALUES\n ( '#{@name}', '#{@team}' )\n RETURNING *;\n \"\n @id = SqlRunner.run( sql )[0]['id'].to_i()\n end",
"def save_ws_on_db\n worksheet = {\n 'ws_num' => 0,\n 'ws_url' => '161w9F2_0vwwRpfr4ggATvXL0J_xUW83-Q7Y5IffgyWY'\n }\n case params[:save_id]\n # The ideal is to have 1 function save_data DRY\n when '1'\n save_data_event(worksheet)\n when '2'\n worksheet['ws_num'] = 1\n save_data_player(worksheet)\n when '3'\n worksheet['ws_num'] = 2\n save_data_game(worksheet)\n else\n # flash alert bug\n return\n end\n # add a flash alert\n redirect_back(fallback_location: show_data_event_path)\n end",
"def record_move(row, col, value)\n tile = @rows[row-1][col-1]\n tile.value = value\n tile\n end",
"def save\n string = \"UPDATE timeframes SET slot = '#{@slot}' WHERE id = #{@id};\"\n CONNECTION.execute(string)\n end",
"def write()\n\t\tdata = {\"rows\"=>@rows, \"cols\"=>@cols , \"moves\"=>@moves , \"time\"=> @time, \"nbGames\" => @nbGames}\n\t\tFile.open(@path, \"w\") {|out| out.puts data.to_yaml }\n\t\treturn self\n\tend",
"def to_yaml\n\t\tFile.write(\"save.yaml\", YAML.dump({\n\t\t\t:board => @board.board,\n\t\t\t:positions => @board.positions,\n\t\t\t:current_turn => @current_turn,\n\t\t\t:ai_on => @ai_on\n\t\t\t}))\n\tend",
"def knight_moves(start, target)\n valid_coordinates = valid_coordinate?(start) && valid_coordinate?(target)\n return puts \"Invalid coordinates!\" unless valid_coordinates\n @coordinate = start\n @visited << start\n\n knight = find_target(target)\n\n path = calculate_path_to(knight)\n\n number_of_moves = path.size - 1\n puts \"You made it in #{number_of_moves} moves! Here's your path:\"\n path.each do |move|\n p move\n end\n\n @visited = []\n end",
"def make_human_move(player, space)\n self.board[space] = player.symbol\n self.board.save\n end",
"def move(board,index,spot = \"X\")\n board[index] = spot\n return board\nend",
"def computer_move\n @move = Move.new\n @move = Move.create game_id: self.id\n @move.current_user = User.find_by_username(\"Computer\").id\n @move.player_number = self.player_number\n case self.difficulty\n when 1\n @move.square = computer_move_easy\n when 2\n @move.square = computer_move_hard\n end\n @move.save\n self.save\n end",
"def turn\n marker = @turn_count.even? ? marker = \"X\" : marker = \"O\"\n move\n print \"Current board: \"\n show_board\n @player +=1\n end",
"def move(board)\n board.display_board\n print \"Enter move for Player #{@id.to_s} (#{@piece}): \"\n position = gets.to_i\n return {position: position, piece: @piece} if board.valid_position?(position)\n puts \"Invalid position.\"\n move(board)\n end",
"def win(board, marker)\n\t\t#horizontal top\n\t\tif board[0] && board[1] == marker\n\t\t\tboard[2] == perfect_move\n\t\telsif board[0] && board[2] == marker\n\t\t\tboard[1] == perfect_move\n\t\telsif board[1] && board[2] == marker\n\t\t\tboard[0] == perfect_move\n\t\t#horiz middle\n\t\telsif board[3] && board[4] == marker\n\t\t\tboard[5] == perfect_move\n\t\telsif board[3] && board[5] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[5] == marker\n\t\t\tboard[3] == perfect_move\n\t\t#horiz bottom\n\t\telsif board[6] && board[7] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[6] && board[8] == marker\n\t\t\tboard[7] == perfect_move\n\t\telsif board[7] && board[8] == marker\n\t\t\tboard[6] == perfect_move\n\t\t#vertical left\n\t\telsif board[0] && board[3] == marker\n\t\t\tboard[6] == perfect_move\n\t\telsif board[3] && board[6] == marker\n\t\t\tboard[0] == perfect_move\n\t\telsif board[0] && board[6] == marker\n\t\t\tboard[3] == perfect_move\n\t\t#vert middle\n\t\telsif board[1] && board[4] == marker\n\t\t\tboard[7] == perfect_move\n\t\telsif board[1] && board[7] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[7] == marker\n\t\t\tboard[1] == perfect_move\n\t\t#vert right\n\t\telsif board[2] && board[5] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[2] && board[8] == marker\n\t\t\tboard[5] == perfect_move\n\t\telsif board[5] && board[8] == marker\n\t\t\tboard[2] == perfect_move\n\t\t#diaginal top left \n\t\telsif board[0] && board[4] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[0] && board[8] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[8] == marker\n\t\t\tboard[0] == perfect_move\n\t\t#diag bottom left\n\t\telsif board[2] && board[4] == marker\n\t\t\tboard[6] == perfect_move\n\t\telsif board[2] && board[6] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[6] == marker\n\t\t\tboard[2] == perfect_move\n\t\telse\n\n\t\tend\n\tend",
"def new_knight(knight_index,knight_arr, path)\r\n knight_arr[knight_index] = path[0]\r\n return knight_arr\r\nend",
"def move(position, player_token)\n @board[position] = player_token\n end",
"def move(board, index, current_player)\n @board[index] = current_player\nend",
"def set_coordinate_piece(coordinate, piece)\n @board[coordinate] = piece\n end",
"def turns\n puts \"#{@p1_name} your move?\"\n p1_move = gets.chomp\n @board[p1_move] = @p1\n puts \"#{@p2_name} where will your move be? Remember the last move occupied position #{p1_move}\"\n p2_move = gets.chomp\n @board[p2_move] = @p2\nend",
"def win(board, marker)\r\n\t\t#horizontal top\r\n\t\tif board[0] && board[1] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\telsif board[0] && board[2] == marker\r\n\t\t\tboard[1] == perfect_move\r\n\t\telsif board[1] && board[2] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\t#horiz middle\r\n\t\telsif board[3] && board[4] == marker\r\n\t\t\tboard[5] == perfect_move\r\n\t\telsif board[3] && board[5] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[5] == marker\r\n\t\t\tboard[3] == perfect_move\r\n\t\t#horiz bottom\r\n\t\telsif board[6] && board[7] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[6] && board[8] == marker\r\n\t\t\tboard[7] == perfect_move\r\n\t\telsif board[7] && board[8] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\t#vertical left\r\n\t\telsif board[0] && board[3] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\telsif board[3] && board[6] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\telsif board[0] && board[6] == marker\r\n\t\t\tboard[3] == perfect_move\r\n\t\t#vert middle\r\n\t\telsif board[1] && board[4] == marker\r\n\t\t\tboard[7] == perfect_move\r\n\t\telsif board[1] && board[7] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[7] == marker\r\n\t\t\tboard[1] == perfect_move\r\n\t\t#vert right\r\n\t\telsif board[2] && board[5] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[2] && board[8] == marker\r\n\t\t\tboard[5] == perfect_move\r\n\t\telsif board[5] && board[8] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\t#diagonal top left \r\n\t\telsif board[0] && board[4] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[0] && board[8] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[8] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\t#diag bottom left\r\n\t\telsif board[2] && board[4] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\telsif board[2] && board[6] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[6] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\telse\r\n\r\n\t\tend\r\n\tend",
"def create_board\n @board[\"18\"] = Rook.new(\"Blacks\")\n @board[\"28\"] = Knight.new(\"Blacks\")\n @board[\"38\"] = Bishop.new(\"Blacks\")\n @board[\"48\"] = Queen.new(\"Blacks\")\n @board[\"58\"] = King.new(\"Blacks\")\n @board[\"68\"] = Bishop.new(\"Blacks\")\n @board[\"78\"] = Knight.new(\"Blacks\")\n @board[\"88\"] = Rook.new(\"Blacks\") \n 8.times { |index| @board[\"#{index + 1}7\"] = BlackPawn.new(\"Blacks\") } \n\n 8.times { |index| @board[\"#{index + 1}6\"] = nil }\n 8.times { |index| @board[\"#{index + 1}5\"] = nil }\n 8.times { |index| @board[\"#{index + 1}4\"] = nil }\n 8.times { |index| @board[\"#{index + 1}3\"] = nil }\n\n 8.times { |index| @board[\"#{index + 1}2\"] = WhitePawn.new(\"Whites\") } \n @board[\"11\"] = Rook.new(\"Whites\") \n @board[\"21\"] = Knight.new(\"Whites\")\n @board[\"31\"] = Bishop.new(\"Whites\")\n @board[\"41\"] = Queen.new(\"Whites\")\n @board[\"51\"] = King.new(\"Whites\")\n @board[\"61\"] = Bishop.new(\"Whites\")\n @board[\"71\"] = Knight.new(\"Whites\")\n @board[\"81\"] = Rook.new(\"Whites\")\n end",
"def move(index, current_player)\n @board[index] = current_player\nend",
"def move(index, current_player)\n @board[index] = current_player\nend",
"def upsert_screenboard(dash_name, widgets)\n logger.info \"Upserting screenboard: #{dash_name}\"\n desc = \"created by DogTrainer RubyGem via #{@repo_path}\"\n dash = get_existing_screenboard_by_name(dash_name)\n if dash.nil?\n d = @dog.create_screenboard(board_title: dash_name,\n description: desc,\n widgets: widgets)\n check_dog_result(d)\n logger.info \"Created screenboard #{d[1]['id']}\"\n return\n end\n logger.debug \"\\tfound existing screenboard id=#{dash['id']}\"\n needs_update = false\n if dash['description'] != desc\n logger.debug \"\\tneeds update of description\"\n needs_update = true\n end\n if dash['board_title'] != dash_name\n logger.debug \"\\tneeds update of title\"\n needs_update = true\n end\n if dash['widgets'] != widgets\n logger.debug \"\\tneeds update of widgets\"\n needs_update = true\n end\n\n if needs_update\n logger.info \"\\tUpdating screenboard #{dash['id']}\"\n d = @dog.update_screenboard(dash['id'], board_title: dash_name,\n description: desc,\n widgets: widgets)\n check_dog_result(d)\n logger.info \"\\tScreenboard updated.\"\n else\n logger.info \"\\tScreenboard is up-to-date\"\n end\n end",
"def save\n @@games[@gameId] = self\n end",
"def place_piece\n @game = Game.find(params[:id])\n player = current_user.game_players.where(game_id: @game.id).first\n if !params[:hotel].nil?\n selected_hotel = params[:hotel]\n hotel_stock_cards = @game.stock_cards.where(hotel: selected_hotel)\n if hotel_stock_cards.count > 0\n chosen_card = hotel_stock_cards.first\n @game.stock_cards.delete(chosen_card)\n @game.save\n player.stock_cards << chosen_card\n player.save\n end\n else\n selected_hotel = 'none'\n end\n @cell = params[:cell]\n num, letter = params[:num].to_i, params[:letter]\n @game_tile = @game.game_tiles.where(cell: @cell)\n if @game.merger != true && player.buy_stocks != true\n if @game.is_current_players_turn?(current_user)\n if @game.player_hand(current_user, @cell) \n # throws exception if tile is part of new chain because need input from user\n begin\n array = @game.choose_color(letter, num, @cell, selected_hotel, player)\n rescue\n render :json => @game, :status => :unprocessable_entity\n return\n end\n\n if array == false\n answer = {legal: false}\n else\n # updates hand of tiles of player\n available_tiles = @game.game_tiles.where(available: true)\n new_game_tile = available_tiles[rand(available_tiles.length)]\n new_game_tile.available = false\n new_game_tile.save\n new_tile = @game.tiles.where(id: new_game_tile.tile_id)\n placed_tile = player.tiles.where(row: letter).where(column: num).first\n placed_game_tile = @game.game_tiles.where(tile_id: placed_tile.id).first\n placed_game_tile.placed = true\n placed_game_tile.save\n player.tiles.delete(placed_tile)\n player.tiles << new_tile\n\n color = array[0]\n other_tiles = array[1]\n merger = array[2]\n merger_three = array[3]\n if merger\n @game.acquired_hotel = array[4]\n num_shares = player.stock_cards.where(hotel: @game.acquired_hotel).count\n @game.has_shares = num_shares\n @game.merger_up_next = player.username\n else\n if merger_three\n merger = true\n @game.acquired_hotel = array[4]\n num_shares = player.stock_cards.where(hotel: @game.acquired_hotel).count\n @game.has_shares = num_shares\n @game.second_acquired_hotel = array[5]\n @game.merger_up_next = player.username\n else\n @game.acquired_hotel = 'none'\n end\n end\n founded_hotels = @game.game_hotels.where('chain_size > 0')\n if founded_hotels.length == 0 \n @game.end_turn\n else\n player.buy_stocks = true\n end\n\n @game.save\n player.save\n answer = {legal: true, color: color, other_tiles: other_tiles, new_tiles: player.tiles, merger: merger, has_shares: @game.has_shares, acquired_hotel: @game.acquired_hotel}\n end \n else\n answer = {legal: false}\n end\n else\n answer = {legal: false}\n end\n else\n answer = {legal: false}\n end\n # gets updated state of game and parses data as json and passes to front end\n game_state\n @payload[:answer] = answer\n render :json => @payload\n end",
"def perfect_move(marker, index)\r\n\t\tif board[index] == perfect_move\r\n\t\t\tboard[index] = marker\r\n\tend\r\n\r\n\t#final moves in order to win\r\n\tdef win(board, marker)\r\n\t\t#horizontal top\r\n\t\tif board[0] && board[1] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\telsif board[0] && board[2] == marker\r\n\t\t\tboard[1] == perfect_move\r\n\t\telsif board[1] && board[2] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\t#horiz middle\r\n\t\telsif board[3] && board[4] == marker\r\n\t\t\tboard[5] == perfect_move\r\n\t\telsif board[3] && board[5] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[5] == marker\r\n\t\t\tboard[3] == perfect_move\r\n\t\t#horiz bottom\r\n\t\telsif board[6] && board[7] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[6] && board[8] == marker\r\n\t\t\tboard[7] == perfect_move\r\n\t\telsif board[7] && board[8] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\t#vertical left\r\n\t\telsif board[0] && board[3] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\telsif board[3] && board[6] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\telsif board[0] && board[6] == marker\r\n\t\t\tboard[3] == perfect_move\r\n\t\t#vert middle\r\n\t\telsif board[1] && board[4] == marker\r\n\t\t\tboard[7] == perfect_move\r\n\t\telsif board[1] && board[7] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[7] == marker\r\n\t\t\tboard[1] == perfect_move\r\n\t\t#vert right\r\n\t\telsif board[2] && board[5] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[2] && board[8] == marker\r\n\t\t\tboard[5] == perfect_move\r\n\t\telsif board[5] && board[8] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\t#diagonal top left \r\n\t\telsif board[0] && board[4] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[0] && board[8] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[8] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\t#diag bottom left\r\n\t\telsif board[2] && board[4] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\telsif board[2] && board[6] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[6] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\telse\r\n\r\n\t\tend\r\n\tend\r\n\r\n\t#blocks an opponent from making the winning move\r\n\tdef block(human, marker, index)\r\n\t\tif human[marker] == win\r\n\t\t\tboard[index] = perfect_move\r\n\t\t\ttrue\r\n\t\telse\r\n\t\t\tfalse\r\n\t\tend\r\n\tend\r\n\r\n\tdef fork()\r\n\tend\r\n\r\n\tdef fork_block()\r\n\tend\r\n\r\n\tdef opposite_corner()\r\n\tend\r\n\r\n\tdef empty_corner()\r\n\tend\r\n\r\n\tdef empty_side()\r\n\tend\r\n\r\nend",
"def move(board_index, player_token = \"X\")\n @board[board_index] = player_token\n end",
"def board\n puts \"PUTSING THE BOARD\"\n @current_board = @board_array.dup\n end",
"def add_piece(board, move, piece=\"R\")\n spot = board[move].rindex(nil)\n board[move][spot] = piece\n board\n end",
"def []=(position, value)\n row, col = position\n @board[row][col] = value\n end",
"def board(row:, column:)\n board_state[index_from_row_column(row, column)]\n end",
"def perfect_move(marker, index)\n\t\tif board[index] == perfect_move\n\t\t\tboard[index] = marker\n\tend\n\n\t#final moves in order to win\n\tdef win(board, marker)\n\t\t#horizontal top\n\t\tif board[0] && board[1] == marker\n\t\t\tboard[2] == perfect_move\n\t\telsif board[0] && board[2] == marker\n\t\t\tboard[1] == perfect_move\n\t\telsif board[1] && board[2] == marker\n\t\t\tboard[0] == perfect_move\n\t\t#horiz middle\n\t\telsif board[3] && board[4] == marker\n\t\t\tboard[5] == perfect_move\n\t\telsif board[3] && board[5] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[5] == marker\n\t\t\tboard[3] == perfect_move\n\t\t#horiz bottom\n\t\telsif board[6] && board[7] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[6] && board[8] == marker\n\t\t\tboard[7] == perfect_move\n\t\telsif board[7] && board[8] == marker\n\t\t\tboard[6] == perfect_move\n\t\t#vertical left\n\t\telsif board[0] && board[3] == marker\n\t\t\tboard[6] == perfect_move\n\t\telsif board[3] && board[6] == marker\n\t\t\tboard[0] == perfect_move\n\t\telsif board[0] && board[6] == marker\n\t\t\tboard[3] == perfect_move\n\t\t#vert middle\n\t\telsif board[1] && board[4] == marker\n\t\t\tboard[7] == perfect_move\n\t\telsif board[1] && board[7] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[7] == marker\n\t\t\tboard[1] == perfect_move\n\t\t#vert right\n\t\telsif board[2] && board[5] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[2] && board[8] == marker\n\t\t\tboard[5] == perfect_move\n\t\telsif board[5] && board[8] == marker\n\t\t\tboard[2] == perfect_move\n\t\t#diaginal top left \n\t\telsif board[0] && board[4] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[0] && board[8] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[8] == marker\n\t\t\tboard[0] == perfect_move\n\t\t#diag bottom left\n\t\telsif board[2] && board[4] == marker\n\t\t\tboard[6] == perfect_move\n\t\telsif board[2] && board[6] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[6] == marker\n\t\t\tboard[2] == perfect_move\n\t\telse\n\n\t\tend\n\tend\n\n\t#blocks an opponent from making the winning move\n\tdef block(human, marker, index)\n\t\tif human[marker] == win\n\t\t\tboard[index] = perfect_move\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend\n\n\tdef fork()\n\tend\n\n\tdef fork_block()\n\tend\n\n\tdef opposite_corner()\n\tend\n\n\tdef empty_corner()\n\tend\n\n\tdef empty_side()\n\tend\n\nend"
] | [
"0.6420481",
"0.6128735",
"0.60095066",
"0.5973782",
"0.59638786",
"0.5896512",
"0.58839715",
"0.5771361",
"0.5710182",
"0.57052237",
"0.57034415",
"0.56949437",
"0.56610554",
"0.5650523",
"0.5622209",
"0.56087404",
"0.55820096",
"0.5581498",
"0.55697507",
"0.5545929",
"0.5545135",
"0.5540535",
"0.55405307",
"0.5531767",
"0.55249405",
"0.5504478",
"0.54886144",
"0.5478142",
"0.54765326",
"0.5474423",
"0.5470354",
"0.54684234",
"0.54635864",
"0.5462345",
"0.5452375",
"0.54503113",
"0.5448808",
"0.5433519",
"0.54329056",
"0.54329056",
"0.54298675",
"0.5426009",
"0.541451",
"0.5410851",
"0.5410818",
"0.5407159",
"0.540043",
"0.5394072",
"0.5384269",
"0.5379529",
"0.5368895",
"0.53646386",
"0.5348721",
"0.53487",
"0.5332476",
"0.53314257",
"0.5330628",
"0.53304046",
"0.5327969",
"0.5325914",
"0.5318682",
"0.5318682",
"0.5317553",
"0.5304281",
"0.5297099",
"0.52960104",
"0.5292214",
"0.5292214",
"0.5287406",
"0.5283727",
"0.527267",
"0.527262",
"0.5270684",
"0.5267364",
"0.5263493",
"0.52623945",
"0.5259703",
"0.52596444",
"0.52495337",
"0.52467686",
"0.5245779",
"0.52452034",
"0.52387494",
"0.5237636",
"0.52370465",
"0.5236119",
"0.52340114",
"0.5230379",
"0.52256525",
"0.52256525",
"0.5222605",
"0.5215857",
"0.5215806",
"0.5214861",
"0.5213297",
"0.52074",
"0.5203214",
"0.5199406",
"0.51983607",
"0.5193927"
] | 0.79746467 | 0 |
Adds all possible destinations with respect to the knight's position | def add_possible_destination(position, knights_action, knights_path)
possible_destinations = possible_destinations(position)
possible_destinations.each do |possible_destination|
add_path(possible_destination, knights_action, knights_path)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def knight_moves(start, destination)\n\t\tnode = possible_moves(Node.new(start), destination)\n\t\tpath = []\n\t\twhile node.parent != nil\n\t\t\tpath.push(node.value)\n\t\t\tnode = node.parent\n\t\tend\n\t\tpath.push(start)\n\t\tprint_path(path.reverse)\n\tend",
"def add_path(destination, knights_action, knights_path)\n visited_destinations << destination\n knights_path << { position: destination, source: knights_action }\n end",
"def destinations(board)\n #selects destinations that are on the board\n dest_array = @moves.select do |move|\n move = [move[0] + @pos[0], move[1] + @pos[1]]\n move.all? {|i| (0..7).include?(i)}\n end\n\n #selects only destinations that are empty or have the opponents piece on it\n dest_array = dest_array.select do |pos|\n piece = board[pos[0]][pos[1]]\n piece.nil? || piece.player != @player\n end \n end",
"def knight_moves(starting_position,ending_position)\n return puts \"You didn't need to move at all!\" if starting_position == ending_position\n search_queue = []\n moves_array = [starting_position]\n knight = Knight.new(starting_position)\n possible_moves = knight.next_possible_moves\n if possible_moves.include?(ending_position)\n moves_array << ending_position\n number_of_moves = moves_array.size - 1\n else\n possible_moves.each do |position|\n search_queue << [position]\n end\n end\n until moves_array[-1] == ending_position\n next_moves = search_queue.shift\n knight.position = next_moves[-1]\n possible_moves = knight.next_possible_moves\n if possible_moves.include?(ending_position)\n next_moves.each { |move| moves_array << move }\n number_of_moves = moves_array.size\n moves_array << ending_position\n else\n possible_moves.each do |position|\n possibility = next_moves + [position]\n search_queue << possibility\n end\n end\n end\n if number_of_moves == 1\n puts \"You made it in #{number_of_moves} move! Here's your path:\"\n else\n puts \"You made it in #{number_of_moves} moves! Here's your path:\"\n end\n moves_array.each { |position| puts position.inspect }\nend",
"def knight_moves(position_start,position_end)\n \n\n move = [-2,-1,1,2,].product([-2,-1,1,2]).select do |x,y| x.abs != y.abs end\n \n board = (0..7).map do \n [Array.new(8,nil)]\n end\n \n queue= []\n queue.push(position_start)\n notFind = true\n \n \n while !queue.empty? && notFind \n position = queue.shift\n move.\n collect do |x,y| \n [position[0] + x , position[1] + y]\n end.\n find_all do |x,y| \n (0..7) === x && (0..7) === y \n end.\n each do |x,y|\n if board[x][y].nil? \n board[x][y] = position \n notFind = !(x == position_end[0] && y == position_end[1])\n queue.push([x,y])\n end \n end \n end\n \n path = []\n position = position_end\n path << position_end\n while position != position_start \n position = board[position[0]][position[1]]\n path.unshift(position)\n end\n \n path\n end",
"def knight_moves(start, dest)\n return puts \"You are already there.\" if start == dest # If user input same starting and destination\n return puts \"Starting position is invalid\" if !valid_play(start[0], start[1]) # If user input invalid starting position\n return puts \"Destination is invalid\" if !valid_play(dest[0], dest[1]) # If user input invalid position on the board as destination\n\n visited = [start] # Start the visited array with start position as that has been checked for above (if start == dest)\n queue = []\n \n queue = build_path(Node.new(start), visited) # Returns the first iteration of the possible moves for the knight piece\n while !queue.empty? # Run until all positions have been checked\n current = queue.shift()\n if current.value == dest # If found\n print_path(current)\n break\n else\n visited << current.value # Mark position checked for\n queue += build_path(current, visited) # Add on new possible positions the knight can take\n end\n end\n end",
"def knight_moves(from, to)\r\n if from == to\r\n return to\r\n end\r\n queue = []\r\n #hash for tracking paths taken, initialized with start location\r\n paths_list = {from.to_s.to_sym => [from]}\r\n #This tracks if we have made a particular move from the current node\r\n #values are stored as symbolized node + move type \r\n visited = {}\r\n answer = []\r\n done = false\r\n #start location\r\n queue.push from\r\n\r\n until queue.empty? || done do\r\n #get first item in queue\r\n node = queue.shift\r\n\r\n @@moves.each do |move_type, offset|\r\n destinaiton = [node[0] + offset[0], node[1] + offset[1]]\r\n \r\n if @board.in_bounds?(destinaiton) && !visited[(node.to_s + move_type.to_s).to_sym]\r\n visited[(node.to_s + move_type.to_s).to_sym] = true\r\n queue.push destinaiton\r\n \r\n #track backward the path taken\r\n paths_list[destinaiton.to_s.to_sym] = (paths_list[node.to_s.to_sym] + [destinaiton])\r\n if to == destinaiton\r\n answer = paths_list[destinaiton.to_s.to_sym]\r\n done = true\r\n break\r\n end\r\n end\r\n end\r\n end\r\n answer\r\n end",
"def knight_moves(start, target)\n valid_coordinates = valid_coordinate?(start) && valid_coordinate?(target)\n return puts \"Invalid coordinates!\" unless valid_coordinates\n @coordinate = start\n @visited << start\n\n knight = find_target(target)\n\n path = calculate_path_to(knight)\n\n number_of_moves = path.size - 1\n puts \"You made it in #{number_of_moves} moves! Here's your path:\"\n path.each do |move|\n p move\n end\n\n @visited = []\n end",
"def enum_moves\n @scratch = dup_maze(@maze)\n @locs.each_with_index do |loc, robot|\n @cost = 1\n leading_edge = [loc]\n loop do\n next_edge = []\n leading_edge.each do |x, y|\n next_edge.concat search_from(x, y, robot)\n end\n break if next_edge.empty?\n leading_edge = next_edge\n @cost += 1\n end\n end\n\n @moves\n end",
"def calculate_moves(destination)\n path = []\n queue = [@current_position]\n # thanks to https://github.com/thomasjnoe/knight-moves for help with this visited concept\n visited = []\n\n return \"You're already there\" if @current_position.square == destination\n\n until queue.empty? \n current_move = queue.shift\n visited << current_move\n\n if current_move.square == destination\n path_move = current_move\n until path_move == @current_position\n path.unshift(path_move.square)\n path_move = path_move.parent\n end\n path.unshift(@current_position.square)\n puts \"You made it in #{(path.length - 1).to_s} moves. Here's your path: \"\n path.each do |s|\n p s\n end\n return path\n end\n\n current_move.next_placements = get_possible_moves_for(current_move).select { |move| !visited.include?(move) } \n\n current_move.next_placements.each do |placement|\n queue << placement\n visited << placement\n end\n end\n end",
"def knight_moves(position, final)\n position == final ? result = [final] : result = 0\n position = [position]\n queue = []\n while result == 0\n pm = possible_movements(position.last)\n if pm.include?(final)\n result = position << final\n else\n pm.each do |move|\n queue << (position + [move])\n end\n position = queue.delete_at(0)\n end\n end\n pretty_result(result)\nend",
"def knight_moves(initial, final)\n @board.check_impossible_move(initial, final)\n\n search_queue = [Vertex.new(initial)]\n\n until search_queue.empty?\n test_vertex = search_queue.shift\n\n return show_path(make_path(test_vertex)) if test_vertex.value == final\n \n @board.possible_moves(test_vertex.value).each do |move|\n new_vertex = Vertex.new(move)\n new_vertex.parent = test_vertex\n test_vertex.children << move\n search_queue << new_vertex\n end \n\n end\n \"No path was found :(\"\n end",
"def shortest_paths(dest)\n position = dest\n final = {}\n analisados = {}\n route = []\n route << dest\n @previous['a'] = -1\n\n @nodes.each do |n|\n analisados[n] = false\n end\n analisados[position] = true\n\n while analisados(analisados)\n adyacentes(position, analisados).each do |n|\n if @distance[n] == (@distance[position] - graph[n][position])\n @previous[position] = n\n position = n\n route << n\n end\n analisados[n] = true\n end\n\n end\n route << 'a'\n route\n end",
"def moves\n possible_moves = []\n dir do |dir|\n possible_moves += MyDirections(pos, dir)\n end\n possible_moves\n end",
"def knight_moves(start, finish)\n tree = MoveTree.new(start)\n queue = [tree]\n result = nil\n visited_points = Set.new()\n while queue.length > 0\n current_node = queue.shift\n visited_points.add(current_node.point)\n if current_node.point == finish\n result = get_path(current_node)\n break\n else\n propagate_tree(current_node)\n queue += current_node.children.reject { |n| visited_points.include?(n.point) }\n end\n end\n result\nend",
"def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @board[new_pos]\n else\n break\n end\n end\n end\n end",
"def destinations\n coords = XmlSimple.xml_in(\n @game.send( \"<movementOptions x='#{x}' y='#{y}' type='#{TYPE_FOR_SYMBOL[@type]}'/>\" )\n )[ 'coordinate' ]\n coords.map { |c|\n @game.map[ c[ 'x' ], c[ 'y' ] ]\n }\n end",
"def moves\r\n # pos = [0,0]\r\n # row, col = pos\r\n all_h = []\r\n all_d = []\r\n HORIZONTAL_DIRS.each do |h_pos|\r\n h_row, h_col = h_pos\r\n all_h += grow_unblocked_moves_in_dir(h_row, h_col) #returns all moves in h_pos\r\n end\r\n DIAGONAL_DIRS.each do |d_pos|\r\n h_row, h_col = d_pos\r\n all_d += grow_unblocked_moves_in_dir(h_row, h_col) #returns all moves in d_pos\r\n end\r\n if self.class == Queen\r\n return all_h + all_d\r\n elsif self.class == Bishop\r\n return all_d\r\n elsif self.class == Rook\r\n return all_h\r\n end\r\n end",
"def available_moves\n adjacent_tiles(*@hole)\n end",
"def update_visited_moves\n visited_coordinates << [x , y]\n end",
"def knights_moves(start, finish)\n board = create_board\n\n path = []\n queue = []\n\n queue << start\n\n loop do\n \tcurrent_node = board[queue[0][0]][queue[0][1]]\n\n current_node.moves.each do |node|\n unless node == start || board[node[0]][node[1]].parent != nil\n board[node[0]][node[1]].parent = queue[0] \n queue << node\n end\t\n end\n\n if queue.include? finish\n\n parent = board[finish[0]][finish[1]].parent\n path << parent\n\n loop do\n \tparent = board[parent[0]][parent[1]].parent\n \tbreak if parent == nil\n \tpath.unshift(parent)\n end\n\n path << finish\n break\n end\n\n \tqueue.shift\n end\n puts \"You can make it in #{path.length-1} steps!\"\n path\nend",
"def moves!\n total_possible_moves = []\n total_possible_moves.concat(diag_moves(diag_initializer))\n total_possible_moves.concat(straight_moves(move_initializer))\n total_possible_moves.select { |move| self.valid_move?(move) }\n end",
"def moves\n pos = self.current_position\n moves = []\n move_dirs.each do |arr|\n @current_position = pos\n loop do\n @current_position = [@current_position[0] + arr[0], @current_position[1] + arr[1]]\n break if [@current_position[0], @current_position[1]].any? { |val| val < 0 || val > 7 }\n if board.pos_occupied?(@current_position)\n if @board[@current_position].color == self.color\n break\n else\n moves << @current_position\n break\n end\n moves << @current_position\n end\n moves << @current_position\n end\n end\n moves\n end",
"def knight_moves(src_sqr = [0, 0], tgt_sqr = [0, 0])\n # Init the board and a Knight piece\n board = Board.new\n knight = Knight.new\n \n puts \"\\nFrom #{src_sqr} to #{tgt_sqr}...\"\n \n unless board.valid_position?(src_sqr[0], src_sqr[1]) && board.valid_position?(tgt_sqr[0], tgt_sqr[1])\n puts \"Invalid starting or ending positions!\\nPlease, provide only valid positions in range [0, 0] to [7, 7] to find a solution!\"\n\treturn\n end\n \n # Mark the source square on the board and set its distance to 0\n board.mark_square(src_sqr[0], src_sqr[1], knight.to_sym)\n board.set_square_distance(src_sqr[0], src_sqr[1], 0)\n # Enqueue the source square\n queue = [src_sqr]\n \n # BFS algorithm \n while !queue.empty?\n cur_sqr = queue.shift \n \n\tbreak if cur_sqr == tgt_sqr\n\t\n # Get all possible moves from current position\t\n\tknight.set_position(cur_sqr[0], cur_sqr[1])\n\tknight.get_possible_moves.each do |move| \n\t next unless board.is_square_empty?(move[0], move[1]) \n\t \n\t # Enqueue all possible moves whose related squares are not visited yet\n\t queue << move \n\t board.mark_square(move[0], move[1], knight.to_sym)\n\t board.set_square_distance(move[0], move[1], board.get_square_distance(cur_sqr[0], cur_sqr[1]) + 1)\n\t board.set_square_parent(move[0], move[1], cur_sqr)\n\tend\n end\n \n # Build the reverse path from src_sqr to tgt_sqr, starting from tgt_sqr\n path = [tgt_sqr]\n parent = board.get_square_parent(tgt_sqr[0], tgt_sqr[1])\n while !parent.nil?\n path << parent\n\tparent = board.get_square_parent(parent[0], parent[1])\n end\n \n # Print the solution\n puts \"Solution obtained in #{path.length - 1} move#{path.length - 1 != 1 ? 's' : ''}! The path is:\"\n path.reverse.each {|move| p move}\n \nend",
"def aggressive_moves(this, that)\n directions = []\n directions << :north if (this.y > that.y) && ((this.y - that.y) < 10)\n directions << :south if (that.y > this.y) && ((that.y - this.y) < 10)\n directions << :west if (this.x > that.x) && ((this.x - that.x) < 10)\n directions << :east if (that.x > this.x) && ((that.x - this.x) < 10)\n directions\n end",
"def generate_moves\n @delta.each do |step|\n new_pos = [@pos[0] + step[0], @pos[1] + step[1]]\n @move_list << new_pos if valid_coord?(new_pos)\n end\n end",
"def moves\n available_moves = []\n\n deltas.each do |delta|\n next_move = self.position.zip_sum(delta)\n break unless on_board?(next_move)\n break unless empty_square?(next_move)\n available_moves << next_move\n end\n\n available_moves + capture_moves\n end",
"def moves\n diagonal_dirs\n end",
"def possible_moves(start_node, destination)\n\t\n\t\tif start_node.value == destination\n\t\t\treturn start_node\n\t\telse\n\t\t\tgame.visited << start_node\n\t\t\tgame.unvisited = game.unvisited + (set_parent(start_node, possible_positions(start_node.value)) - game.visited)\n\t\t\tgame.unvisited.each do |position_node|\n\t\t\t\tif position_node.value == destination\n\t\t\t\t\treturn position_node\n\t\t\t\tend\n\t\t\t\tgame.visited << position_node\n\t\t\tend\n\t\t\tpossible_moves(game.unvisited.shift,destination) if game.unvisited.first != nil \n\t\tend\n\tend",
"def knight_path(from, to)\r\n\topen_queue = [PositionPath.new( from, [copy(from)] )]\r\n\tputs open_queue.inspect\r\n\tputs open_queue.empty?\r\n\tdiscovered = [from]\r\n\r\n\tuntil open_queue.empty?\r\n\t\tcurrent = open_queue.shift\r\n\t\tputs current.inspect\r\n\r\n\t\treturn current.path if current.position == to\r\n\t\tvalid_moves(current.position).each do |move|\r\n\t\t\tputs \"ruch #{move} jest ok\"\r\n\t\t\tunless discovered.include?(move)\r\n\t\t\t\tputs \"tego ruchu jeszce nie bylo = #{move}\"\r\n\t\t\t\tdiscovered << move\r\n\t\t\t\topen_queue.push(make_position_path(current, move)) \r\n\t\t\t\tputs \"open_queue = #{open_queue.size}\"\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\t\r\nend",
"def calculate_moves(piece, location)\n @x = location[0].to_i\n @y = location[1].to_i\n @possible_moves = []\n\n def add_straight_line_moves(index)\n move = \"#{@x + (index + 1)}#{@y}\" # Right\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n move = \"#{@x}#{@y + (index + 1)}\" # Up\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n move = \"#{@x - (index + 1)}#{@y}\" # Left\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n move = \"#{@x}#{@y - (index + 1)}\" # Down\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n end\n\n def add_diagonal_moves(index)\n move = \"#{@x + (index + 1)}#{@y + (index + 1)}\" # Up right\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n move = \"#{@x - (index + 1)}#{@y - (index + 1)}\" # Down left\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n move = \"#{@x + (index + 1)}#{@y - (index + 1)}\" # Down right\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n move = \"#{@x - (index + 1)}#{@y + (index + 1)}\" # Up left\n @possible_moves << move unless path_blocked?(move) || out_of_bounds?(move) ||\n friendly_piece?(move)\n end\n\n case piece\n\n when \"WhitePawn\"\n # 1 step forward\n move = \"#{@x}#{@y + 1}\"\n @possible_moves << move unless @board[move] != nil \n # Attack forward right\n move = \"#{@x + 1}#{@y + 1}\"\n if @board[move] != nil && @board[move].team == @current_opponent \n @possible_moves << move \n end \n # Attack forward left\n move = \"#{@x - 1}#{@y + 1}\"\n if @board[move] != nil && @board[move].team == @current_opponent \n @possible_moves << move \n end \n # 2 steps forward if its in the starting point\n move = \"#{@x}#{@y + 2}\"\n @possible_moves << move unless @y != 2 || path_blocked?(move) ||\n @board[move] != nil\n\n when \"BlackPawn\"\n # Same moves of the WhitePawn but reversed\n move = \"#{@x}#{@y - 1}\"\n @possible_moves << move unless @board[move] != nil \n \n move = \"#{@x + 1}#{@y - 1}\"\n if @board[move] != nil && @board[move].team == @current_opponent\n @possible_moves << move \n end\n \n move = \"#{@x - 1}#{@y - 1}\"\n if @board[move] != nil && @board[move].team == @current_opponent\n @possible_moves << move\n end\n \n move = \"#{@x}#{@y - 2}\"\n @possible_moves << move unless @y != 7 || path_blocked?(move) || @board[move]\n\n when \"Rook\"\n # 7 is the max distance between squares\n # The method is called 7 times to have a list of all possible targets ready\n 7.times { |index| add_straight_line_moves(index) }\n\n when \"Knight\"\n knight_moves = [[@x + 1, @y + 2], [@x + 2, @y + 1], \n [@x + 2, @y - 1], [@x + 1, @y - 2], \n [@x - 1, @y - 2], [@x - 2, @y - 1], \n [@x - 2, @y + 1], [@x - 1, @y + 2]]\n \n knight_moves.each do |move|\n move = \"#{move[0]}#{move[1]}\" \n @possible_moves << move unless out_of_bounds?(move) || friendly_piece?(move)\n end\n\n when \"Bishop\"\n 7.times { |index| add_diagonal_moves(index) }\n \n when \"Queen\"\n 7.times do |index|\n add_straight_line_moves(index)\n add_diagonal_moves(index)\n end\n \n when \"King\"\n # The King can move only 1 square away so the methods are called just once\n add_straight_line_moves(0)\n add_diagonal_moves(0)\n else\n\n end\n end",
"def place_ships!\n\t\t[\n\t\t\t['T', 2],\n\t\t\t['D', 3],\n\t\t\t['S', 3],\n\t\t\t['B', 4],\n\t\t\t['C', 5]\n\t\t].each do |ship|\n\t\t\tplace_ship(ship[0], ship[1])\n\t\tend\n\tend",
"def find_possible_moves\n @possible_moves = []\n\n @moveset.each do |move, value|\n x = @x + value[0]\n y = @y + value[1]\n\n next unless ChessBoard.check_boundaries(x, y) && !visited_coordinates.include?([x, y])\n\n @possible_moves << move\n end\n end",
"def attack_cells(from, _chessboard)\n (DiagonalMoves.directions + AxisAlignedMoves.directions)\n .map { |direction| from + direction }\n .reject(&:nil?)\n end",
"def moves\n available_moves = []\n\n deltas.each do |delta|\n next_move = self.position.zip_sum(delta)\n break unless empty_square?(next_move)\n if on_board?(next_move)\n available_moves << next_move\n end\n end\n\n available_moves + capture_moves\n end",
"def moves\n poss_moves = []\n determine_moves.each do |diff| #array of directions\n poss_moves += grow_unblocked_moves_in_dir(diff[0],diff[1])\n end\n poss_moves\n end",
"def new_move_positions(node)\n new_moves = KnightPathFinder.valid_moves(node.value).reject {|move| @visited_positions.include? move}\n new_moves.each {|move| @visited_positions << move}\n new_moves\n end",
"def all_moves(start, directed_moves)\n # Array of valid moves\n all_moves = []\n\n directed_moves.each do |ele|\n ele[0] = ele[0] + start[0]\n ele[1] = ele[1] + start[1]\n all_moves << ele\n end\n all_moves\n end",
"def knight_moves\n\t\tnode = Square.new(@start)\n\t\t@queue << node\n\t\twhile @queue.empty? == false\n\t\t\tcurrent = @queue[0]\n\t\t\tif current.value == @final\n\t\t\t\tdisplay_result(current)\t\t\t\n\t\t\telse\n\n\t\t\t\t8.times do |num|\n\t\t\t\t\tx = current.value[0] + @row[num]\n\t\t\t\t\ty = current.value[1] + @col[num]\n\t\t\t\t\tif (x.between?(1,8) && y.between?(1,8)) && @revised.include?([x, y]) == false\n\t\t\t\t\t\tnode = Square.new([x, y])\n\t\t\t\t\t\tnode.parent = current\n\t\t\t\t\t\tnode.count = current.count + 1\n\t\t\t\t\t\t@queue << node\n\t\t\t\t\telse\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t@revised << current.value\n\t\t\t\t@queue.shift\n\t\t\tend\n\t\tend\n\t\tputs \"NOT FOUND !!!\"\n\t\tputs \"This program presumes a 8x8 Chess Board\"\n\t\tputs \"Therefore your coordinates must be between (1, 1) and (8, 8).\"\n\tend",
"def add_distination(destinations, distance)\n @destination[destinations] = distance\n end",
"def determine_moves(loc)\n\n piece = @spaces[loc]\n\n moveset = []\n attackset = []\n new_moves = []\n\n x = loc[0]\n y = loc[1]\n\n enemy_king_checked = false\n\n\n case piece.type\n\n when \"pawn\"\n\n if piece.color == \"white\"\n\n new_moves << [x, y+1]\n new_moves << [x,y+2] if y == 1\n\n if @spaces[new_moves[0]].nil?\n\n moveset << new_moves[0]\n moveset << new_moves[1] if y == 1\n\n end\n\n atk_moves = [[x+1, y+1], [x-1, y+1]]\n atk_moves.each do |move|\n attackset << move if @spaces[move].nil?.! and @spaces[move].color == \"black\"\n if @spaces[move].nil?.!\n enemy_king_checked = true if @spaces[move].color == \"black\" and @spaces[move].type == \"king\"\n end\n end\n \n\n elsif piece.color == \"black\"\n\n new_moves = [[x, y-1]]\n new_moves << [x,y-2] if y == 6\n\n if @spaces[new_moves[0]].nil?\n\n moveset << new_moves[0]\n moveset << new_moves[1] if loc[1] == 6\n\n end\n\n atk_moves = [[x+1, y-1], [x-1, y-1]]\n atk_moves.each do |move|\n attackset << move if @spaces[move].nil?.! and @spaces[move].color == \"white\"\n if @spaces[move].nil?.!\n enemy_king_checked = true if @spaces[move].color == \"white\" and @spaces[move].type == \"king\"\n end\n end\n end\n\n @spaces[loc].moveset = moveset\n @spaces[loc].attackset = attackset\n \n\n when \"rook\"\n\n runner(loc, :north)\n runner(loc, :east)\n runner(loc, :south)\n runner(loc, :west)\n\n when \"knight\"\n\n possible_directions =\n [ [x+1, y+2],\n [x+1, y-2],\n [x-1, y+2],\n [x-1, y-2],\n [x+2, y+1],\n [x+2, y-1],\n [x-2, y+1],\n [x-2, y-1] ]\n\n moveset = possible_directions.select do |d|\n (d[0].between?(0,7) & d[1].between?(0,7)) and @spaces[d].nil?\n end\n\n attackset = possible_directions.select do |d|\n (d[0].between?(0,7) & d[1].between?(0,7)) and (@spaces[d].nil?.! and @spaces[d].color != @spaces[loc].color)\n end\n\n @spaces[loc].moveset = moveset\n @spaces[loc].attackset = attackset\n\n\n when \"bishop\"\n\n runner(loc, :northeast)\n runner(loc, :southeast)\n runner(loc, :northwest)\n runner(loc, :southwest)\n\n\n when \"queen\"\n\n runner(loc, :north)\n runner(loc, :northeast)\n runner(loc, :east)\n runner(loc, :southeast)\n runner(loc, :south)\n runner(loc, :southwest)\n runner(loc, :west)\n runner(loc, :northwest)\n\n\n when \"king\"\n\n runner(loc, :north, 1)\n runner(loc, :northeast, 1)\n runner(loc, :east, 1)\n runner(loc, :southeast, 1)\n runner(loc, :south, 1)\n runner(loc, :southwest, 1)\n runner(loc, :west, 1)\n runner(loc, :northwest, 1)\n\n end\n\n\n end",
"def moves\n sliding_moves + jumping_moves\n end",
"def dfs_rec knight, target, collector=[]\n\n if knight\n puts \"#{knight.position} and #{target}\"\n\n \n\n if knight.position == target\n collector.push knight\n end\n moves = knight.moves.size - 1\n moves.times do |num|\n dfs_rec knight.moves[num], target, collector\n end\n end\n\n return collector\nend",
"def moves\n # All pieces can stay in place\n [[0,0]]\n end",
"def possible_destinations(position)\n possible_moves = possible_moves_in_board(position)\n\n possible_destinations = possible_moves.map do |move|\n [move[0] + position[0], move[1] + position[1]]\n end.uniq\n\n possible_destinations - visited_destinations\n end",
"def possible_moves\n all_moves = []\n x, y = @position\n moves = [[x, y-1], [x-1, y-1], [x-1, y], [x-1, y+1], [x, y+1], [x+1, y+1], [x+1, y], [x+1, y-1]]\n moves.each do |position|\n all_moves << [position] if position.all? { |number| number.between?(0,7) }\n end\n all_moves\n end",
"def knight_path(from, to)\n\topen_queue = [PositionPath.new( from, [copy(from)] )]\n\tdiscovered = [from]\n\n\tuntil open_queue.empty?\n\t\tcurrent = open_queue.shift\n\n\t\treturn current.path if current.position == to\n\t\tvalid_moves(current.position).each do |move|\n\t\t\tunless discovered.include?(move)\n\t\t\t\tdiscovered << move\n\t\t\t\topen_queue.push(make_position_path(current, move)) \n\t\t\tend\n\t\tend\n\tend\n\t\nend",
"def place_knights\r\n $board[1][0] = Knight.new('white')\r\n\t\t$board[6][0] = Knight.new('white')\r\n\t\t$board[1][7] = Knight.new('black')\r\n\t\t$board[6][7] = Knight.new('black')\r\n end",
"def route_go_ride(from, dest)\n from = from.map{|x|x+1}\n dest = dest.map{|x|x+1}\n\n x=from[0]\n y=from[1]\n\n route = \"The route is\\n\\tstart at (#{x},#{y})\"\n\n if from[0]!=dest[0]\n if from[0]<dest[0]\n until x == dest[0]\n x = x + 1\n end\n route += \"\\n\\tgo to (#{x},#{y})\"\n route += \"\\n\\tturn right\" if y>dest[1]\n route += \"\\n\\tturn left\" if y<dest[1]\n\n else from[0]>dest[0]\n until x == dest[0]\n x = x - 1\n end\n route += \"\\n\\tgo to (#{x},#{y})\"\n route += \"\\n\\tturn left\" if y>dest[1]\n route += \"\\n\\tturn right\" if y<dest[1]\n end\n end\n\n if from[1]!=dest[1]\n if from[1]<dest[1]\n until y == dest[1]\n y = y + 1\n end\n route += \"\\n\\tgo to (#{x},#{y})\"\n else from[1]>dest[1]\n until y == dest[1]\n y = y - 1\n end\n route += \"\\n\\tgo to (#{x},#{y})\"\n end\n end\n\n route += \"\\n\\tfinish at (#{x},#{y})\"\n route\n\n end",
"def moves\n output = []\n move_one = false\n @directions = @directions.take(3) if position != @initial_position\n directions.each_index do |index|\n possible_position = [position[0] + directions[index][0],position[1] + directions[index][1]]\n if index.even?\n if board.in_bounds?(possible_position) && occupied?(possible_position)\n output << possible_position unless board[possible_position].color == board[position].color\n end\n elsif index == 1\n if board.in_bounds?(possible_position) && !occupied?(possible_position)\n output << possible_position\n move_one = true\n end\n elsif board.in_bounds?(possible_position) && !occupied?(possible_position)\n output << possible_position if move_one\n end\n end\n output\n end",
"def possible_moves(board)\n poss_move_array = []\n current_square = @history.last\n current_coords = parse_coord(current_square)\n\n poss_move_array.push(single_march(current_coords, board)) if single_march(current_coords, board)\n\n poss_move_array.push(double_march(current_coords, board)) if first_move? && double_march(current_coords, board)\n\n valid_diagonals(current_coords, board).each { |move| poss_move_array.push(move) }\n\n # en passant only allowed opportunity first created\n poss_move_array.push(en_passant?(current_coords, board)) if en_passant?(current_coords, board)\n\n poss_move_array\n end",
"def knight_moves(start, stop)\n\tknight = Knight.new(start)\n\tboard = Board.new\n\tq = MyQueue.new\n\n\tq.push knight\n\n\tuntil knight.position == stop\n\t\tknight = q.pop #select the knight from queue\n\t\t#Set children to all valid moves\n\t\tchildren = knight.children.select { |k| board.on_board?(k) } #k for knight\n\t\t#add each valid child move to the queue\n\t\tchildren.each { |k| q.push(k) }\n\tend\n\tknight.history #returns the array of all moves made\nend",
"def knight_moves(from, to)\n\treturn unless input_valid?(from, to)\n\tpath = knight_path(from, to)\n\tdisplay_path path\nend",
"def moves\n possible_moves = []\n\n self.move_dirs.each do |dir|\n num_steps = 1\n blocked = false\n\n until blocked\n next_step = [dir[0]*num_steps, dir[1]*num_steps]\n next_pos = [self.pos[0] + next_step[0], self.pos[1] + next_step[1]]\n\n break unless next_pos.all? { |i| i.between?(0,7) }\n\n if self.board[next_pos]\n blocked = true\n possible_moves << next_pos unless self.color == self.board[next_pos].color\n else\n possible_moves << next_pos\n num_steps += 1\n end\n end\n end\n\n possible_moves\n end",
"def move_neighbours()\n # Make sure to check for doorways that can't be passed through diagonally!\n # Start with the current list from neighbours()\n # foreach cell in that list, remove that cell if either of the conditions are met:\n # it is not passable\n # it is diagonal, and either it or this square is a doorway\n end",
"def shortest_path\n initial_position_obj = { position: start_position, source: {} }\n\n knights_path = [initial_position_obj]\n\n while knights_path.present?\n current_position = knights_path.shift\n\n position = current_position[:position]\n\n if position == end_position\n return path_to_destination(current_position, initial_position_obj)\n end\n\n add_possible_destination(position, current_position, knights_path)\n end\n end",
"def possible_moves(x, y)\n @moves = [[x+1,y+2], [x+1,y-2],\n [x-1,y+2], [x-1,y-2],\n [x+2,y+1], [x+2,y-1],\n [x-2,y+1], [x-2,y-1]]\n\n end",
"def children\n\t\tmoves = [ [@x+2, @y+1], [@x+2, @y-1], [@x-2, @y+1], [@x-2, @y-1],\n [@x+1, @y+2], [@x+1, @y-2], [@x-1, @y+2], [@x-1, @y-2] ]\n moves.map { |position| Knight.new( position, @history ) }\n\tend",
"def valid_destinations(current_pos)\n readable_positions = []\n manifest = piece_manifest\n p1 = get_index_from_rowcol(current_pos.to_s)\n \n valid_positions = possible_moves(p1, manifest, true)\n valid_positions.each do |pos|\n grid_pos = get_rowcol_from_index(pos)\n # Map first string character 1-8 to [A-H], for column, and then add second string character as [1-8]\n readable_positions << (@@row_mappings.key(grid_pos[0].to_i) + grid_pos[1].to_s)\n end\n return readable_positions.sort\n end",
"def destinations\n @destinations ||= []\n end",
"def possible_moves\n possible_moves = []\n\n # move up\n up_right = [start[X] + 1, start[Y] + 2]\n possible_moves << up_right\n\n up_left = [start[X] - 1, start[Y] + 2]\n possible_moves << up_left\n\n # move right\n right_up = [start[X] + 2, start[Y] + 1]\n possible_moves << right_up\n\n right_down = [start[X] + 2, start[Y] - 1]\n possible_moves << right_down\n\n # move down\n down_right = [start[X] + 1, start[Y] - 2]\n possible_moves << down_right\n\n down_left = [start[X] - 1, start[Y] - 2]\n possible_moves << down_left\n\n # move left\n left_up = [start[X] - 2, start[Y] + 1]\n possible_moves << left_up\n\n left_down = [start[X] - 2, start[Y] - 1]\n possible_moves << left_down\n\n possible_moves.select { |move| @board.valid_position?(move) }\n\n end",
"def possible_moves(from)\r\n\tpositions = []\r\n\tpair = { 1 => [2, -2], 2 => [1, -1] }\r\n row_change = [-2, -1, 1, 2]\r\n row_change.each do |change|\r\n \tpositions << add_positions(from, [change, pair[change.abs][0]])\r\n \tpositions << add_positions(from, [change, pair[change.abs][1]])\r\n end\r\n\tpositions\r\nend",
"def get_possible_moves\n moves = \n\t @@offsets.collect do |move| \n\t row = @position[:row] + move[0]\n\t col = @position[:col] + move[1]\n\t\t[row, col] if row.between?(0, 7) && col.between?(0, 7)\n\t end\n\tmoves.compact\n end",
"def directions\n return UP_DIRS + DOWN_DIRS if king\n color == :white ? UP_DIRS : DOWN_DIRS\n end",
"def build_path(parent_pos, visited)\n possible_moves = []\n # Getting all available moves for knight and applying it to the current position (root)\n @move_rows.each_with_index do |value, index|\n temp_arr = [parent_pos.value[0] + @move_rows[index], parent_pos.value[1] + @move_cols[index]] # Temp variable for repetition\n # Checking for validity of the new moves as well as checking if it hasn't already been visited\n if valid_play(parent_pos.value[0] + @move_rows[index], parent_pos.value[1] + @move_cols[index]) && !visited.include?(temp_arr)\n possible_moves << [parent_pos.value[0] + @move_rows[index], parent_pos.value[1] + @move_cols[index]]\n end\n end\n # Get all possible moves and add it as a child to the parent Node that was passed\n possible_moves.map do |value|\n parent_pos.child = Node.new(value, parent_pos)\n end\n end",
"def create_moves\n valid_moves = []\n MOVES.each do |move|\n location = [move[0] + loc[0], move[1] + loc[1]]\n valid_moves << location if location[0].between?(0,7) && location[1].between?(0,7)\n end\n valid_moves\n end",
"def moves \r\n move = []\r\n move_directions do |dir|\r\n move += grow_unblocked_moves_in_dir(*dir)\r\n end\r\n move\r\n end",
"def Knight_long_path(position, target)\n possible_moves = []\n moves = ['move_down', 'move_up', 'move_right', 'move_left']\n chessercise = Chessercise.new\n for i in moves do\n for j in moves do\n now = getposition(position)\n if i != j\n if @directions_flag[i.to_sym] != @directions_flag[j.to_sym]\n if chessercise.send(i.to_sym, now) != nil\n mv_now = chessercise.send(i.to_sym, now)\n now = getposition(mv_now)\n if chessercise.send(j.to_sym, now) != nil\n mv_now = chessercise.send(j.to_sym, now)\n now = getposition(mv_now)\n if chessercise.send(j.to_sym, now) != nil\n mv_now = chessercise.send(j.to_sym, now)\n possible_moves.push(mv_now)\n end\n end\n end\n end\n end\n end\n end\n return possible_moves\n # print Knight_long_path('d2')\n end",
"def possible_moves(from)\n\tpositions = []\n\tpair = { 1 => [2, -2], 2 => [1, -1] }\n row_change = [-2, -1, 1, 2]\n row_change.each do |change|\n \tpositions << add_positions(from, [change, pair[change.abs][0]])\n \tpositions << add_positions(from, [change, pair[change.abs][1]])\n end\n\tpositions\nend",
"def knight_moves(from, to)\r\n\treturn unless input_valid?(from, to)\r\n\tpath = knight_path(from, to)\r\n\tdisplay_path path\r\nend",
"def moves\n moves = []\n\n # call move_dirs and generate moves\n move_dirs.each do |x,y|\n moves += valid_positions(x,y)\n end\n moves\n end",
"def add_adj_jumps(x,y,dir, step, horz, dist,jump_tags)\n jump_length = 0 # number of \"tiles\" the jump will leap over.\n map = $game_map\n passables = jump_tags[:pass]\n \n ox, oy = x, y\n orig_valid = MoveUtils.ev_passable?(ox,oy,@source) && \n (map.passable?(ox,oy,dir) || passables[map.terrain_tag(ox,oy)])\n return if !orig_valid\n horz ? x+= step : y+=step # don't check start point, begin at an adjacent one\n\n while(jump_length < dist && map.valid?(x,y) && jump_tags[:jump][map.terrain_tag(x,y)] && !map.passable?(x,y,dir))\n jump_length+=1\n horz ? x+= step : y+=step\n end\n\n valid_jump = jump_length <= jump_tags[:jump_length] && jump_length > 0\n ev_pass = MoveUtils.ev_passable?(x,y,@source)\n map_valid = map.valid?(x,y)\n\n if ev_pass && map_valid && valid_jump\n v = Vertex.new(x,y,map.terrain_tag(x,y))\n v2 = Vertex.new(ox,oy,map.terrain_tag(ox,oy))\n add_vertex(v) if !@verticies[v]\n add_edge(v,v2,{:jump=>jump_length}, opp_dir(dir), dir)\n end\n end",
"def possible_moves(location)\n # something that returns legal_destinations, minus blocked paths\n # print \"legal dest are: #{legal_destinations(location)}\\n\"\n possible_moves = legal_destinations(location).select do |legal_move|\n # print \"current legal move is #{legal_move}\\n\"\n legal_move_obj = @board[legal_move]\n no_piece_in_the_way?(location, legal_move) &&\n (legal_move_obj == nil || legal_move_obj.color != self.color) &&\n legal_move.all? { |coord| coord >= 0 && coord <= 8 }\n end\n\n possible_moves\n end",
"def possible_king_moves(start_arr)\n\t\tx = start_arr[0]\n\t\ty = start_arr[1]\n\t\tcandidates = []\n\t\tcandidates << [x+1,y]\n\t\tcandidates << [x-1,y]\t\t\n\t\tcandidates << [x,y+1]\t\t\t\t\n\t\tcandidates << [x,y-1]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tcandidates << [x+1,y+1]\n\t\tcandidates << [x-1,y-1]\t\n\t\tcandidates << [x-1,y+1]\t\t\t\t\n\t\tcandidates << [x+1,y-1]\t\t\t\t\n\t\tchildren = candidates.select { |pos| pos[0] >= 0 && pos[1] >= 0 && pos[0] <= 7 && pos[1] <= 7}\n\t\tchildren.delete_if do |child|\n\t\t\tif !(@board[child] == \"*\")\n\t\t\t\t# If pieces not same color\n\t\t\t\tif @board[child].color == @board[start_arr].color\n\t\t\t\t\tif occupied(child)\n\t\t\t\t\t\tcan_do = true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tchildren\n\tend",
"def jump_moves\n moves = [] # initializes empty move array\n\n # choses \"forward\" y direction based on piece team\n if @team == \"l\"\n dir = 1\n else\n dir = -1\n end\n\n # looks at the two forward far diagonal positions and adds them to moves array if there are no pieces there and an opponent piece in between\n pos1 = [@x_pos + 2, @y_pos + 2*dir]\n moves << pos1 if Piece.all.find{|p| p.x_pos == @x_pos + 1 && p.y_pos == @y_pos + dir && p.team != @team} && Piece.all.none?{|p| [p.x_pos, p.y_pos] == pos1}\n pos2 = [@x_pos - 2, @y_pos + 2*dir]\n moves << pos2 if Piece.all.find{|p| p.x_pos == @x_pos - 1 && p.y_pos == @y_pos + dir && p.team != @team} && Piece.all.none?{|p| [p.x_pos, p.y_pos] == pos2}\n \n\n # deletes any moves with coordinates that aren't on the board\n moves.delete_if{|move| move.find{|n| n < 0 || n > 7}}\n return moves\n end",
"def build_paths(start)\n step = 0\n visited = []\n unvisited = [[board_node_by_location(start),step]]\n \n while !unvisited.empty?\n node = unvisited[0][0]\n step = unvisited[0][1] + 1\n \n node.neighbors.each do |x|\n if not_visited(board_node_by_location(x),visited, unvisited)\n unvisited << [board_node_by_location(x),step]\n end\n end\n visited << unvisited.shift\n end\n return visited\nend",
"def moves\n possible_moves = []\n\n move_dirs.each do |dir|\n possible_moves.concat(grow_unblocked_moves_in_dir(dir[0], dir[1])) \n end\n\n possible_moves \n end",
"def grow_unblocked_moves_dir(dx, dy)\n moves_dir =[]\n i, j = dx, dy\n k = 2\n next_pos = [@pos[0]+dx, @pos[1]+dy]\n while @board.in_bounds?(next_pos) && @board[next_pos].color != self.color\n \n moves_dir << next_pos\n break if @board[next_pos].color != nil\n dx = i * k\n dy = j * k\n k += 1\n next_pos = [@pos[0]+dx, @pos[1]+dy]\n end\n moves_dir\n end",
"def moves\n all_moves = []\n self.move_dirs.each do |move| \n if ((0..7).include?(self.pos[0] + move[0]) && (0..7).include?(self.pos[1] + move[1])) && !(@board[(self.pos[0] + move[0]), (self.pos[1] + move[1])].is_a?(Piece)) #|| self.color == \n all_moves << [(self.pos[0] + move[0]), (self.pos[1] + move[1])]\n end \n end\n all_moves\n end",
"def legal_moves\n # Fill this in\n end",
"def trace_path(direction)\n result = []\n current_position = position\n while valid_position?(current_position)\n current_position = current_position.zip(direction).map(&:sum)\n break if valid_position?(current_position)\n\n result << current_position\n \n break unless board.empty?(current_position)\n end\n result\n end",
"def create_knight_tour_graph(board_size)\n new_graph = Graph.new()\n board_size.times do |x|\n board_size.times do |y|\n new_graph.add_vertex([x,y])\n end\n end\n knight_legal_moves(new_graph)\n new_graph\nend",
"def moves(*move_dirs)\n possible_moves = []\n\n end",
"def knight_moves(start_case, target_case)\r\n knight = Knight.new\r\n board = Board.new\r\n\r\n board.moves(knight, start_case, target_case)\r\nend",
"def moves\n moves = []\n\n move_dirs.each do |dir| #[1,1]\n dx, dy = dir #1 0\n new_pos = grow_unblocked_moves_in_dir(dx, dy) #[1,0][2,0][3,0][4,0],[5,0][6,0][7,0]\n moves += new_pos\n end\n\n moves\n end",
"def new_move_positions(pos)\n possible_moves = KnightPathFinder.valid_moves(pos)\n possible_moves.reject! {|a_pos| @considered_position.include?(a_pos)}\n possible_moves.each {|a_pos| @considered_position << a_pos }\n possible_moves\n end",
"def new_move_pos(pos)\n all_possible_moves = KnightPathFinder.valid_moves(pos)\n all_possible_moves = all_possible_moves.reject {|pot_moves| @visited_pos.include?(pot_moves)}\n @visited_pos += all_possible_moves\n all_possible_moves\n end",
"def next_possible_moves\n positions_array = []\n x = @position[0]\n y = @position[1]\n next_position = [x+1,y+2]\n positions_array << next_position if position_check(next_position)\n next_position = [x+1,y-2]\n positions_array << next_position if position_check(next_position)\n next_position = [x-1,y+2]\n positions_array << next_position if position_check(next_position)\n next_position = [x-1,y-2]\n positions_array << next_position if position_check(next_position)\n next_position = [x+2,y+1]\n positions_array << next_position if position_check(next_position)\n next_position = [x+2,y-1]\n positions_array << next_position if position_check(next_position)\n next_position = [x-2,y+1]\n positions_array << next_position if position_check(next_position)\n next_position = [x-2,y-1]\n positions_array << next_position if position_check(next_position)\n positions_array\n end",
"def create_children\n @moves.each do |i|\n if @children.include?(i) == false && !i.nil?\n tmp = Knight.new(i)\n @children.push(tmp)\n end\n end\n @children\n end",
"def potential_diagonal_moves is_king=false\n moves = []\n\n # Possible moves\n # - all possible combination of increment/decrement of r_idx/c_idx\n\n r_min = is_king ? (r_idx - 1 >= 0 ? r_idx - 1 : r_idx) : 0\n c_min = is_king ? (c_idx - 1 >= 0 ? c_idx - 1 : c_idx) : 0\n r_max = is_king ? (r_idx + 1 <= 7 ? r_idx + 1 : r_idx) : Board::WIDTH - 1\n c_max = is_king ? (c_idx + 1 <= 7 ? c_idx + 1 : c_idx) : Board::WIDTH - 1\n\n # top-right: row-decrement, column-increment [4, 5] [3, 6]\n r = r_idx - 1\n c = c_idx + 1\n while (r >= r_min) && (c <= c_max)\n moves << [r, c]\n r -= 1\n c += 1\n end\n\n # bottom-right: row-increment, column-increment [4, 5] [5, 6]\n r = r_idx + 1\n c = c_idx + 1\n while (r <= r_max) && (c <= c_max)\n moves << [r, c]\n r += 1\n c += 1\n end\n\n # bottom-left: row-increment, column-decrement [4, 5] [5, 4]\n r = r_idx + 1\n c = c_idx - 1\n while (r <= r_max) && (c >= c_min)\n moves << [r, c]\n r += 1\n c -= 1\n end\n\n # top-left: row-decrement, column-decrement [4, 5] [3, 4]\n r = r_idx - 1\n c = c_idx - 1\n while (r >= r_min) && (c >= c_min)\n moves << [r, c]\n r -= 1\n c -= 1\n end\n\n # TODO\n # - refactor to avoid repeated pattern of code without compromising with runtime\n\n moves\n end",
"def setPlaces\n return unless self.distance_changed? || self.height_gain_changed? || self.height_loss_changed?\n PlaceRoute.delete place_route_ids\n Place.find_by_radius(averageLatitude, averageLongitude, 70).each do |place|\n waypoints.each do |waypoint|\n if place.dist(waypoint.latitude, waypoint.longitude) <= 0.6 || ([Lake,Glacier,Pass,Meadow].include?(place.class) && !waypoint.height.nil? && (place.height - waypoint.height).abs < 100 && place.dist(waypoint.latitude, waypoint.longitude) <= 2)\n PlaceRoute.create(:place_id => place.id, :route_id => id, :waypoint_index => waypoint.local_index)\n\t break\n end\n end\n end\n end",
"def all_moves_array(initial_x, initial_y)\n\t\tfinal = []\n\t\tx = initial_x + 2\n\t\tfinal << [x, initial_y+1] << [x, initial_y-1]\n\t\tx = initial_x - 2\n\t\tfinal << [x, initial_y+1] << [x, initial_y-1]\n\t\ty = initial_y + 2\n\t\tfinal << [initial_x+1, y] << [initial_x-1, y]\n\t\ty = initial_y - 2\n\t\tfinal << [initial_x+1, y] << [initial_x-1, y]\n\t\tfinal\n\tend",
"def build_king_move_tree\n move_tree_template = MoveTree.new([0, 0])\n\n # Get the 8 surrounding spaces\n locations = [-1, 0, 1].repeated_permutation(2).to_a\n locations.delete([0, 0])\n\n locations.each do |loc|\n move_tree_template.root.add_child(loc)\n end\n\n move_tree_template\n end",
"def new_move_positions(pos)\n new_positions = KnightPathFinder.valid_moves(pos) - @considered_positions\n @considered_positions += new_positions\n new_positions\n end",
"def grow_unblocked_moves_in_dir(dx,dy)\n start_x, start_y = self.pos\n #start for rook white === [7,0]\n # [6,0]\n # [5,0]\n # [4,0]\n # [3,0]\n # [2,0]\n\n dx = -1 #first iteration UP\n dy = 0\n\n\n 1.step do |i|\n start_x += dx\n start_y += dy\n if self.board.rows[start_x][start_y].empty? #[6,0]\n\n end\n # create an array to collect moves\n\n # get the piece's current row and current column\n\n\n # in a loop:\n # continually increment the piece's current row and current column to \n # generate a new position\n # stop looping if the new position is invalid (not on the board); the piece \n # can't move in this direction\n # if the new position is empty, the piece can move here, so add the new \n # position to the moves array\n # if the new position is occupied with a piece of the opposite color, the \n # piece can move here (to capture the opposing piece), so add the new \n # position to the moves array\n # but, the piece cannot continue to move past this piece, so stop looping\n # if the new position is occupied with a piece of the same color, stop looping\n\n # return the final moves array\n end\n \nend",
"def slide_moves\n dirs = (@dir == :up ? UP_DIRS : DOWN_DIRS)\n dirs = DOWN_DIRS + UP_DIRS if king\n\n dirs.each_with_object([]) do |dir, moves|\n new_square = add_dir(pos, dir)\n unless !@board.on_board?(new_square) || @board[*new_square]\n moves << [pos, new_square]\n end\n end\n end",
"def generate_paths_for(offsets, piece, game)\n board = game.board\n pieces = game.pieces\n moves = {}\n offsets.each do |offset|\n i = 1\n last_tile = piece.position\n # max length of a path in any direction is 7\n 7.times do |n|\n next_tile ||= \"\"\n adjusted_offset = offset * i \n coords = offsets_to_coordinates([adjusted_offset], piece, game)\n next_tile = coords unless coords.nil?\n move = { next_tile => [] }\n case \n when wrapped?(next_tile, last_tile)\n break\n when chess_board.is_piece?(next_tile, game)\n if next_tile != \"\" && chess_board.is_enemy?(next_tile, piece.color, game) \n moves.merge!( move ) \n break\n else\n break\n end\n else\n moves.merge!( move ) unless next_tile == \"\"\n end\n i += 1\n last_tile = next_tile\n end\n end\n moves\n end",
"def moves; [] end",
"def connect_spaces\n\n # set the tile-tile, tile-vtex, and tile-edge links\n @tiles.each do |tile|\n r, c = tile.row, tile.col\n\n # link the tile with its 6 neighboring tiles\n [[[ r-1 , c-1 ], :nw, :se],\n [[ r-1 , c ], :ne, :sw],\n [[ r , c+1 ], :e , :w ],\n [[ r+1 , c+1 ], :se, :nw],\n [[ r+1 , c ], :sw, :ne],\n [[ r , c-1 ], :w , :e ],\n ].each do |coords, dir1, dir2|\n other = @tile_map[coords]\n tile.set_tile(dir1, other)\n other.set_tile(dir2, tile) unless other.nil?\n end\n\n # link the tile with its 6 neighboring vertexes\n [[[ r-1 , c-1 , :down ], :nw, :se],\n [[ r , c , :up ], :n , :s ],\n [[ r-1 , c , :down ], :ne, :sw],\n [[ r+1 , c+1 , :up ], :se, :nw],\n [[ r , c , :down ], :s , :n ],\n [[ r+1 , c , :up ], :sw, :ne],\n ].each do |coords, dir1, dir2|\n vtex = @vtex_map[coords]\n tile.set_vtex(dir1, vtex)\n vtex.set_tile(dir2, tile) unless vtex.nil?\n end\n\n # link the tile with its 6 neighboring edges\n [[[ r , c , :vert ], :w , :e ],\n [[ r , c , :asc ], :nw, :se],\n [[ r , c , :desc ], :ne, :sw],\n [[ r , c+1 , :vert ], :e , :w ],\n [[ r+1 , c+1 , :asc ], :se, :nw],\n [[ r+1 , c , :desc ], :sw, :ne],\n ].each do |coords, dir1, dir2|\n edge = @edge_map[coords]\n tile.set_edge(dir1, edge)\n edge.set_tile(dir2, tile) unless edge.nil?\n end\n end\n\n # link the :up vertexes with neighboring edges\n @up_vtexs.each do |vtex|\n r, c = vtex.row, vtex.col\n [[[ r-1 , c , :vert ], :n , :s ],\n [[ r , c , :asc ], :sw, :ne],\n [[ r , c , :desc ], :se, :nw],\n ].each do |coords, dir1, dir2|\n edge = @edge_map[coords]\n vtex.set_edge(dir1, edge)\n edge.set_vtex(dir2, vtex) unless edge.nil?\n end\n end\n\n # link the :down vertexes with neighboring edges\n @down_vtexs.each do |vtex|\n r, c = vtex.row, vtex.col\n [[[ r+1 , c+1 , :vert ], :s , :n ],\n [[ r+1 , c+1 , :asc ], :ne, :sw],\n [[ r+1 , c , :desc ], :nw, :se],\n ].each do |coords, dir1, dir2|\n edge = @edge_map[coords]\n vtex.set_edge(dir1, edge)\n edge.set_vtex(dir2, vtex) unless edge.nil?\n end\n end\n end",
"def moves\n # create array to collect moves\n final_array = []\n\n\n\n pos = self.move_dirs\n\n pos.each do |optional_pos|\n\n end\n\n # Note do these logics for all the optional positions \n spec_dx = pos[0]\n spec_dy = pos[1]\n\n possible_movements = grow_unblocked_moves_in_dir(spec_dx, spec_dy)\n possible_movements\n # ending\n\n\n # iterate over each of the directions in which a slideable piece can move\n # use the Piece subclass' `#move_dirs` method to get this info\n # for each direction, collect all possible moves in that direction\n # and add them to your moves array \n # (use the `grow_unblocked_moves_in_dir` helper method)\n\n # return the final array of moves (containing all possible moves in all directions)\n end"
] | [
"0.6738935",
"0.67211807",
"0.67088896",
"0.66092366",
"0.65555704",
"0.65023845",
"0.6478805",
"0.64724344",
"0.64675397",
"0.63763046",
"0.6321274",
"0.6287201",
"0.62555367",
"0.62447125",
"0.6160926",
"0.61265546",
"0.61096984",
"0.60430247",
"0.6032911",
"0.60122496",
"0.6006301",
"0.60046846",
"0.5996479",
"0.5993141",
"0.59778565",
"0.59635556",
"0.5955608",
"0.59519666",
"0.5948968",
"0.5945341",
"0.5939879",
"0.5937178",
"0.5930712",
"0.59289074",
"0.59226197",
"0.591105",
"0.5892238",
"0.58900636",
"0.58883417",
"0.58734363",
"0.586938",
"0.5864996",
"0.58616847",
"0.5855628",
"0.584665",
"0.58396494",
"0.5832298",
"0.5824005",
"0.5809533",
"0.5807125",
"0.5785424",
"0.57844126",
"0.57730585",
"0.57684755",
"0.5755275",
"0.57416505",
"0.57347775",
"0.57331324",
"0.5716343",
"0.57008576",
"0.5700692",
"0.57003134",
"0.56825733",
"0.5675945",
"0.5671217",
"0.5665574",
"0.5660198",
"0.5647866",
"0.5647801",
"0.5643584",
"0.564252",
"0.56351435",
"0.5634844",
"0.5622469",
"0.5620681",
"0.56201214",
"0.5593948",
"0.5593932",
"0.5592544",
"0.5582846",
"0.55760694",
"0.55492145",
"0.5547475",
"0.55342054",
"0.5526694",
"0.5525236",
"0.5519274",
"0.55149925",
"0.5513211",
"0.55106544",
"0.55087996",
"0.55083984",
"0.55060357",
"0.5501075",
"0.5500871",
"0.54957616",
"0.54882264",
"0.5486282",
"0.5485667",
"0.5485394"
] | 0.76067793 | 0 |
Add destination to visited destinations Adds destination with respect to the action taken by knight and adds the path taken to destination to source to track. | def add_path(destination, knights_action, knights_path)
visited_destinations << destination
knights_path << { position: destination, source: knights_action }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_possible_destination(position, knights_action, knights_path)\n\n possible_destinations = possible_destinations(position)\n\n possible_destinations.each do |possible_destination|\n add_path(possible_destination, knights_action, knights_path)\n end\n end",
"def set_destination(destination)\n if @destination\n @destination.remove_entrance(self)\n end\n @destination = destination\n if @destination\n @destination.add_entrance(self)\n end\n return\n end",
"def find_path(dest)\n if @previous[dest] != -1\n find_path @previous[dest]\n end\n @path << dest\n end",
"def shortest_paths(dest)\n position = dest\n final = {}\n analisados = {}\n route = []\n route << dest\n @previous['a'] = -1\n\n @nodes.each do |n|\n analisados[n] = false\n end\n analisados[position] = true\n\n while analisados(analisados)\n adyacentes(position, analisados).each do |n|\n if @distance[n] == (@distance[position] - graph[n][position])\n @previous[position] = n\n position = n\n route << n\n end\n analisados[n] = true\n end\n\n end\n route << 'a'\n route\n end",
"def add_location(source, target, weight)\n connect_graph(source, target, weight) #directional graph\n connect_graph(target, source, weight) #non directed graph (inserts the other locations too)\n end",
"def add_distination(destinations, distance)\n @destination[destinations] = distance\n end",
"def knight_moves(start, destination)\n\t\tnode = possible_moves(Node.new(start), destination)\n\t\tpath = []\n\t\twhile node.parent != nil\n\t\t\tpath.push(node.value)\n\t\t\tnode = node.parent\n\t\tend\n\t\tpath.push(start)\n\t\tprint_path(path.reverse)\n\tend",
"def add_destination_directory(*destination_paths)\n destination_paths.each do |destination|\n new_path = Pathname.new(destination)\n # Check to ensure the specified path is a directory\n next unless new_path.directory?\n # Add the new destination to the list of destination directories\n @destination_directories.push(new_path)\n end\n end",
"def get_allpaths(source, dest, visited, path)\n # mark visited\n visited[source] = 1\n path << source\n\n if source.eql? dest\n @paths << path.dup\n else\n # recurse for all neighboring nodes\n @nnmap[source].each do |n|\n get_allpaths(n, dest, visited, path) if visited[n].eql? 0\n end\n end\n\n path.pop\n visited[source] = 0\n end",
"def add=(location)\n @destinations << location\n end",
"def calculate_moves(destination)\n path = []\n queue = [@current_position]\n # thanks to https://github.com/thomasjnoe/knight-moves for help with this visited concept\n visited = []\n\n return \"You're already there\" if @current_position.square == destination\n\n until queue.empty? \n current_move = queue.shift\n visited << current_move\n\n if current_move.square == destination\n path_move = current_move\n until path_move == @current_position\n path.unshift(path_move.square)\n path_move = path_move.parent\n end\n path.unshift(@current_position.square)\n puts \"You made it in #{(path.length - 1).to_s} moves. Here's your path: \"\n path.each do |s|\n p s\n end\n return path\n end\n\n current_move.next_placements = get_possible_moves_for(current_move).select { |move| !visited.include?(move) } \n\n current_move.next_placements.each do |placement|\n queue << placement\n visited << placement\n end\n end\n end",
"def add_destination(object)\n\t\t\tif validate_source_destination(object)\n\t\t\t\t@destination = object\n\t\t\t\tobject.add_input(self)\n\t\t\telse\n\t\t\t\traise \"Invalid arc destination object: #{object.class}\"\n\t\t\tend\n\t\tend",
"def knight_moves(start, dest)\n return puts \"You are already there.\" if start == dest # If user input same starting and destination\n return puts \"Starting position is invalid\" if !valid_play(start[0], start[1]) # If user input invalid starting position\n return puts \"Destination is invalid\" if !valid_play(dest[0], dest[1]) # If user input invalid position on the board as destination\n\n visited = [start] # Start the visited array with start position as that has been checked for above (if start == dest)\n queue = []\n \n queue = build_path(Node.new(start), visited) # Returns the first iteration of the possible moves for the knight piece\n while !queue.empty? # Run until all positions have been checked\n current = queue.shift()\n if current.value == dest # If found\n print_path(current)\n break\n else\n visited << current.value # Mark position checked for\n queue += build_path(current, visited) # Add on new possible positions the knight can take\n end\n end\n end",
"def destination= (newDestination)\n @destination = newDestination\n end",
"def knight_moves(start, target)\n valid_coordinates = valid_coordinate?(start) && valid_coordinate?(target)\n return puts \"Invalid coordinates!\" unless valid_coordinates\n @coordinate = start\n @visited << start\n\n knight = find_target(target)\n\n path = calculate_path_to(knight)\n\n number_of_moves = path.size - 1\n puts \"You made it in #{number_of_moves} moves! Here's your path:\"\n path.each do |move|\n p move\n end\n\n @visited = []\n end",
"def add_destination_file(*destination_files)\n destination_files.each do |destination|\n new_path = Pathname.new(destination)\n # Check to ensure the specified path is a directory\n next if new_path.directory?\n # Add the new destination to the list of destination directories\n @destination_files.push(new_path)\n end\n end",
"def destinations\n @destinations ||= []\n end",
"def destination=(destination)\n @destination = destination\n end",
"def all_paths_util(u, d)\n # Mark the current node as visited and store in path\n @visited[u] = true\n @path << u\n\n # If current vertex is same as destination, then store it\n # current path[]\n if u == d\n @all_paths << @path.dup\n else\n # If current vertex is not destination\n # Recur for all the vertices adjacent to this vertex\n @graph[u].each do |i|\n if @visited[i] == false\n all_paths_util(i, d)\n end\n end\n end\n # Remove current vertex from path[] and mark it as unvisited\n @path.pop()\n @visited[u]= false\n end",
"def destination_params\n params.require(:destination).permit(:name, :arrived_on, :left_on, :lng, :lat, :visited)\n end",
"def set_destination\n @destination = Destination.friendly.find(params[:id])\n end",
"def destination=(destination)\n\t\t#@ denotes an instance variable\n\t\t@destination = destination\n\tend",
"def set_destination(opts)\n opts = check_params(opts,[:destinations])\n super(opts)\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def destination(access_token:, params: {})\n ride_id = require_ride_id(params)\n resp = connection(access_token).put do |req|\n req.url \"/#{Api::VERSION}/rides/#{ride_id}/destination\"\n req.body = params\n end\n handle_response(resp)\n end",
"def destination(dest); end",
"def destination(dest); end",
"def add_destination(*destination_paths)\n destination_paths.each do |destination|\n new_path = Pathname.new(destination)\n # Check if the specified path is a directory\n if new_path.directory?\n @destination_directories.push(new_path)\n next\n end\n # Check to ensure the parent directory is valid\n return false unless Pathname.new(new_path.dirname).directory?\n @destination_files.push(new_path)\n end\n return true\n end",
"def add_edge(source_vertex, destination_vertex)\n @adjacent_list[source_vertex].push(destination_vertex)\n @indegree[destination_vertex] += 1\n end",
"def create\n @destination = Destination.new(destination_params)\n @destination.save\n set_destinations\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def store(source_path, destination_path)\n @queue_for_storage << [source_path, destination_path]\n end",
"def update_visited_moves\n visited_coordinates << [x , y]\n end",
"def update\n @destination.update(destination_params)\n set_destinations\n end",
"def destinations(board)\n #selects destinations that are on the board\n dest_array = @moves.select do |move|\n move = [move[0] + @pos[0], move[1] + @pos[1]]\n move.all? {|i| (0..7).include?(i)}\n end\n\n #selects only destinations that are empty or have the opponents piece on it\n dest_array = dest_array.select do |pos|\n piece = board[pos[0]][pos[1]]\n piece.nil? || piece.player != @player\n end \n end",
"def shortest_path_to(dest_node)\n return unless has_path_to?(dest_node)\n path = []\n while (dest_node != @node) do\n path.unshift(dest_node)\n dest_node = @edge_to[dest_node]\n end\n path.unshift(@node)\n end",
"def knight_moves(from, to)\r\n if from == to\r\n return to\r\n end\r\n queue = []\r\n #hash for tracking paths taken, initialized with start location\r\n paths_list = {from.to_s.to_sym => [from]}\r\n #This tracks if we have made a particular move from the current node\r\n #values are stored as symbolized node + move type \r\n visited = {}\r\n answer = []\r\n done = false\r\n #start location\r\n queue.push from\r\n\r\n until queue.empty? || done do\r\n #get first item in queue\r\n node = queue.shift\r\n\r\n @@moves.each do |move_type, offset|\r\n destinaiton = [node[0] + offset[0], node[1] + offset[1]]\r\n \r\n if @board.in_bounds?(destinaiton) && !visited[(node.to_s + move_type.to_s).to_sym]\r\n visited[(node.to_s + move_type.to_s).to_sym] = true\r\n queue.push destinaiton\r\n \r\n #track backward the path taken\r\n paths_list[destinaiton.to_s.to_sym] = (paths_list[node.to_s.to_sym] + [destinaiton])\r\n if to == destinaiton\r\n answer = paths_list[destinaiton.to_s.to_sym]\r\n done = true\r\n break\r\n end\r\n end\r\n end\r\n end\r\n answer\r\n end",
"def add_path(station_id1, station_id2, minutes)\n\t\taction = [\"MOVE\", station_id1, station_id2, minutes]\n\t\t@path.push(action)\n\tend",
"def push(source_loc, current_loc, next_loc, dir, goal_loc, depth)\n \n extra_cost = depth\n node_cost = predict_movement_cost(source_loc,current_loc,goal_loc) + extra_cost\n node = Map_Address.new(next_loc.x,next_loc.y,node_cost)\n \n @nodes.push(node)\n @nodes.sort!{ |a,b| a.cost <=> b.cost}\n \n # save source direction\n @move_dir[ hash_address(next_loc.x,next_loc.y) ] = dir\n # save source address\n @nodes_parent_id[ hash_address(next_loc.x, next_loc.y) ] = hash_address(current_loc.x,current_loc.y)\n end",
"def test_add_destination\n assert_equal(@vertex.edges.length, 0)\n @vertex.add_destination(Edge.new('', 4000))\n @vertex.add_destination(Edge.new('', 4000))\n @vertex.add_destination(Edge.new('', 4000))\n assert_equal(@vertex.edges.length, 3)\n end",
"def connect_graph(source, target, weight)\n if (!graph.has_key?(source))\n graph[source] = {target => weight}\n else\n graph[source][target] = weight\n end\n if (!locations.include?(source))\n locations << source\n end\n end",
"def set_destination\n @destination = current_user.destinations.find(params[:id])\n end",
"def destination=(destination)\n if destination.nil?\n fail ArgumentError, 'invalid value for \"destination\", destination cannot be nil.'\n end\n @destination = destination\n end",
"def add_transition(source,dest)\n add_node source\n add_node dest\n if source.record \n add_node source.record\n end\n if dest.record \n add_node dest.record\n end\n end",
"def add_edge(src, dest, weight)\n @v << src if !@v.include?(src)\n @v << dest if !@v.include?(dest)\n new_edge = Edge.new(src,dest, weight)\n src.out_edges << new_edge\n dest.in_edges << new_edge\n @e << new_edge\n end",
"def add_edge(source, dest)\n if VERT_MAP.has_key? source\n VERT_MAP[source] << dest\n else\n VERT_MAP[source] = Set.new [dest]\n end\n end",
"def path_to(destination, options = {})\n Gdirections::Route.find(self, destination, options)\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def set_destination\n @destination = Destination.find(params[:id])\n end",
"def destination=(d)\n raise ArgumentError, \"destination must be a string\" unless d.is_a?(String)\n @destination = d\n end",
"def create\n @user = User.find(params[:user_id])\n @destination = Destination.new(destination_params)\n @destination.user_id = params[:user_id]\n if @destination.save\n redirect_to user_destination_path(@user.id, @destination.id)\n else\n redirect_to root_path\n end\n end",
"def travel_cost( dest )\n sp = shortest_path( dest )\n path_cost( sp )\n end",
"def add_edge(src, dest)\n # add a edge to the head\n @adjList[src] << dest\n # since this graph is not directed we need to do the oposite also\n # @adjList[dest] << src\n @edges += 1\n end",
"def add_to_database destination\n\t\tdestination_airport_object = Airport.make_destination destination\n\t\tparse_flights.each do |hash|\n\t\t\tnext if hash[\"Actual Arrival Time\"] == \"00:00\"\n\t\t\tdate = hash[\"Date (MM/DD/YYYY)\"]\n\t\t\tnew_date = format_date date\n\t\t\tairline = hash[\"Carrier Code\"]\n\t\t\tnumber = hash[\"Flight Number\"]\n\t\t\tairport = hash[\"Origin Airport \"]\n\t\t\tairline_object = Airline.find_by_name(airline)\n\t\t\tif airline_object.nil?\n\t\t\t\tairline_object = Airline.create(:name => hash[\"Carrier Code\"])\n\t\t\tend\n\t\t\tflight_object = Flight.find_by_number(number)\n\t\t\tif flight_object.nil?\n\t\t\t\tflight_object = Flight.create(\n\t\t\t\t\t:number => hash[\"Flight Number\"],\n\t\t\t\t\t:airline_id => airline_object.id\t\n\t\t\t\t\t)\n\t\t\tend\n\t\t\torigin_airport_object = Airport.find_by_name(airport)\n\t\t\tif origin_airport_object.nil? #if the current airport in the hash isn't already in the database, make it\n\t\t\t\torigin_airport_object = Airport.create(:name => hash[\"Origin Airport \"])\n\t\t\tend\n\t\t\tarrival_object = Arrival.create(\n\t\t\t\t:date => new_date,\n\t\t\t\t:scheduled_time => hash[\"Scheduled Arrival Time\"],\n\t \t\t:actual_time => hash[\"Actual Arrival Time\"],\n\t \t\t:flight_id => flight_object.id,\n\t \t\t:origin_airport_id => origin_airport_object.id,\n\t \t\t:destination_airport_id => destination_airport_object.id\n\t \t\t)\n\t\tend\n\tend",
"def destinations\n bookmarks = @medium.manuscript.metadata['bookmarks'] || []\n bookmarks.map { |b| b['destination'] }\n end",
"def set_routes(origin, destination)\n origin_lines = get_route_line(origin)\n destination_lines = get_route_line(destination)\n get_connections(origin, destination, origin_lines, destination_lines)\n end",
"def store_path_visited(path)\n redis.sadd paths_visited_key, path\n end",
"def add_edge(source, target, edge = Edge.new)\n _clear_cache\n @pathway.append(Bio::Relation.new(source, target, edge))\n edge\n end",
"def shortest_paths(source, dest)\n @graph_paths=[]\n @source = source\n dijkstra source\n @path=[]\n find_path dest\n actual_distance=if @distance[dest] != INFINITY\n @distance[dest]\n else\n \"no path\"\n end\n \"Shortest route and distance : #{@path.join(\"-->\")}, #{actual_distance} km\"\n end",
"def path_to_destination(knights_path, inital_knight_position)\n steps_taken = []\n loop do\n steps_taken << to_char(knights_path[:position][0], knights_path[:position][1])\n\n if knights_path == inital_knight_position\n return steps_taken.reverse.to_sentence\n end\n\n knights_path = knights_path[:source]\n end\n end",
"def destination_params\n params.require(:destination).permit(:location, :price, :trip_length, :weather, :agent_id)\n end",
"def <<(new_path)\n @locations.unshift(new_path)\n end",
"def shortest_path\n initial_position_obj = { position: start_position, source: {} }\n\n knights_path = [initial_position_obj]\n\n while knights_path.present?\n current_position = knights_path.shift\n\n position = current_position[:position]\n\n if position == end_position\n return path_to_destination(current_position, initial_position_obj)\n end\n\n add_possible_destination(position, current_position, knights_path)\n end\n end",
"def map_paths(orig = @orig, dest = @dest, path = [])\n\n\t\t# we have to duplicate each path array to its own object\n\t\t# to ensure it isn't contaminated by another iteration\n\t\tpath = path.dup\n\t\tpath << orig\n\n\t\tif orig == dest\n\t\t\tif !@successful_paths.include?(path)\n\t\t\t\t@successful_paths << path\n\t\t\t\treturn\n\t\t\tend\n\t\telse\n\t\t\t# get connections\n\t\t\tconnections = orig.connected\n\t\t\t# remove previous stops from possible connections list\n\t\t\tconnections = connections - path\n\t\t\tconnections.each do |c|\n\t\t\t\tmap_paths(c, dest, path)\n\t\t\tend\n\t\tend\n\tend",
"def add_edge(source, dest, weight)\n edges << Edge.new(source, dest, weight)\n end",
"def destination(dest)\n @destination ||= {}\n @destination[dest] ||= begin\n path = site.in_dest_dir(dest, URL.unescape_path(url))\n path = File.join(path, \"index\") if url.end_with?(\"/\")\n path << output_ext unless path.end_with? output_ext\n path\n end\n end",
"def save_path(pathVector)\n node = destination\n begin\n pathVector << node\n node = pathTo[node]\n end while node != nil\n end",
"def get_path(dest,path)\n if @prev[dest] != -1\n path += get_path(@prev[dest],\"\")\n end\n path += \">#{dest}\"\n end",
"def shortest_paths(source, dest)\n\t\t\t@source = source\n\t\t\tdijkstra source\n\t\t\tprint_path dest\n\t\t\treturn @distance[dest]\n\t\tend",
"def create\n @destination = current_user.destinations.new(destination_params)\n if @destination.save\n redirect_to destinations_path, notice: 'Destination was successfully created.'\n else\n render :new\n end\n end",
"def destination\n @destination\n end",
"def destination\n @destination\n end",
"def destination_path\n @_destination_path ||= \"#{@rf['project_id']}/#{@rf['booking_id']}/\" end",
"def move_to( destination, options = {} )\n command = \"\"\n options[ :exclusions ] ||= []\n \n new_hex = @hex\n \n if destination != @hex\n # Travel\n \n path = shortest_path( destination, options[ :exclusions ] )\n if path.empty?\n $stderr.puts \"No path from #{self} to #{destination}\"\n else\n dests = destinations\n new_dest = path.pop\n while new_dest and not dests.include?( new_dest )\n new_dest = path.pop\n end\n end\n \n if new_dest.nil?\n $stderr.puts \" Can't move #{self} to #{destination}\"\n else\n o = new_dest.unit\n if o and allied_with?( o )\n # Can't move through allied units\n options[ :exclusions ] << new_dest\n return move_to( destination, options )\n else\n x = new_dest.x\n y = new_dest.y\n new_hex = new_dest\n command << \"<move x='#{x}' y='#{y}'/>\"\n end\n end\n end\n \n target = nil\n also_attack = options[ :also_attack ]\n if also_attack\n enemies = targets( new_hex )\n if not enemies.empty?\n case also_attack\n when Array\n preferred = also_attack & enemies\n else\n preferred = [ also_attack ] & enemies\n end\n target = preferred.first# || enemies.random\n \n if target\n command << \"<attack x='#{target.x}' y='#{target.y}'/>\"\n end\n end\n end\n \n if(\n not options[ :no_capture ] and\n can_capture? and\n new_hex == destination and\n new_hex.capturable?\n )\n puts \"#{self} capturing #{new_hex}\"\n command << \"<capture/>\"\n end\n \n if not command.empty?\n result = send( command )\n puts \"Moved #{self} to #{new_hex}\"\n @hex.unit = nil\n new_hex.unit = self\n @hex = new_hex\n if target\n #<attack target='[3,4]' damageReceived='2' damageInflicted='7' remainingQuantity='8' />\n process_attack result\n @game.last_attacked = target\n end\n \n # Success\n true\n end\n end",
"def destination_params\n params.require(:destination).permit(:name, :weather, :description, :timezone, :cityimage, :landingtime, :boardingtime)\n end",
"def add_edge(source, target, weight = 1)\r\n\t\tself.push source unless self.include?(source)\r\n\t\tself.push target unless self.include?(target)\r\n\t\t@edges.push Edge.new(source, target, weight)\r\n\tend",
"def destination_path\n @destination_path ||= Pathname.new(self.destination_root)\n end",
"def destination\r\n @destination\r\n end",
"def index\n @destination = Destination.new\n set_destinations\n end",
"def shortest_path( dest, exclusions = [] )\n exclusions ||= []\n previous = shortest_paths( exclusions )\n s = []\n u = dest.hex\n while previous[ u ]\n s.unshift u\n u = previous[ u ]\n end\n s\n end",
"def destination\n if (destinationAirport.nil?) then setAirports end\n return @destinationAirport\n end",
"def with_destination( new_destination )\n\t\traise LocalJumpError, \"no block given\" unless block_given?\n\t\t# self.log.debug \"Overriding render destination with: %p\" % [ new_destination ]\n\n\t\tbegin\n\t\t\t@destinations.push( new_destination )\n\t\t\tyield\n\t\tensure\n\t\t\t# self.log.debug \" removing overridden render destination: %p\" % [ @destinations.last ]\n\t\t\t@destinations.pop\n\t\tend\n\n\t\treturn new_destination\n\tend",
"def dfs_rec knight, target, collector=[]\n\n if knight\n puts \"#{knight.position} and #{target}\"\n\n \n\n if knight.position == target\n collector.push knight\n end\n moves = knight.moves.size - 1\n moves.times do |num|\n dfs_rec knight.moves[num], target, collector\n end\n end\n\n return collector\nend",
"def possible_moves(start_node, destination)\n\t\n\t\tif start_node.value == destination\n\t\t\treturn start_node\n\t\telse\n\t\t\tgame.visited << start_node\n\t\t\tgame.unvisited = game.unvisited + (set_parent(start_node, possible_positions(start_node.value)) - game.visited)\n\t\t\tgame.unvisited.each do |position_node|\n\t\t\t\tif position_node.value == destination\n\t\t\t\t\treturn position_node\n\t\t\t\tend\n\t\t\t\tgame.visited << position_node\n\t\t\tend\n\t\t\tpossible_moves(game.unvisited.shift,destination) if game.unvisited.first != nil \n\t\tend\n\tend",
"def add_destination(label, style, *params)\n @destinations[label] = PDF::Writer::Object::Destination.new(self, @current_page, style, *params)\n end",
"def find_path()\n visited = Array.new(8) {Array.new(8)}\n return [] if @destination == @currentPosition\n paths = [[@currentPosition]]\n visited[@currentPosition[0]][@currentPosition[1]] = true\n\n until paths.empty?\n new_paths = []\n paths.each do |path|\n next_positions = possibleMoves(path.last, visited)\n next_positions.each do |move|\n newpath = path.dup << move\n if move == @destination #if we reached our destination stop and return the path\n return newpath\n end\n visited[move[0]][move[1]] = true\n new_paths.push(newpath)\n end\n end\n paths = new_paths\n end\n end",
"def trips_dfs(start, finish, stops, visited, path, paths, cycles)\n adj_vertices(visited.last, adj_lists).each do |vertex|\n print \"Visited stack: #{visited}, Next vertex: #{vertex}\\n\"\n s = visited.size # stops, including added vertex\n\n if visited.last == finish && cycles != \"NO CYCLES EXIST\"\n\n # try adding cycles if we hit finish vertex too early\n\n visited_before_cycles = visited\n # picks expanded cycles that begin with finish vertex\n ec = expanded_cycles(cycles).select{|c| c.first == finish}\n\n # keep adding cycles till we reach stops\n ec.each do |cycle1|\n visited, paths, break_loop = try_cycles(visited, cycle1, paths, stops, 0)\n visited1 = visited\n\n ec.each do |cycle2|\n begin\n visited, paths, break_loop = try_cycles(visited, cycle2, paths, stops, 0)\n end until break_loop\n visited = visited1\n end\n\n visited = visited_before_cycles\n end\n\n elsif !visited.include?(vertex) && dist(visited.last, vertex) != \"NO SUCH ROUTE\" && s <= stops\n visited << vertex\n path = visited\n\n if vertex == finish && s == stops\n paths << path\n print \"\\n*** Path: #{path}, Stops: #{s}, Length: #{path_length(path)}\\n\\n\"\n visited.pop\n break\n end\n\n trips_dfs(start, finish, stops, visited, path, paths, cycles)\n visited.pop\n visited.pop if visited.size.between?(2, 3) && stops <= 1\n visited = [start] if visited == []\n end\n end\n paths.size\n end",
"def store_paths_to_visit(paths)\n return if paths.empty?\n redis.sadd paths_to_visit_key, paths\n end",
"def move \n\n # If we've reached the end of our path, not much to do\n if @path_step >= @path.length\n return\n end\n\n # So, just set the destination to the next step on the path and let the base\n # ship movement handle it\n @dest_x = @path[@path_step][0]\n @dest_y = @path[@path_step][1]\n super\n\n # Now just check to see if we've reached the target - if so, move on to the next\n # step on the path\n if ( @x == @path[@path_step][0] ) && ( @y == @path[@path_step][1] )\n @path_step += 1\n end\n\n end",
"def setDestination(destx, desty)\n let @lengthx = destx - @x\n let @lengthy = desty - @y\n let dx = Math.abs(@lengthx)\n let dy = Math.abs(@lengthy)\n let @invert = (dx < dy)\n let temp = 0\n let @positivex = 0\n let @positivey = 0\n\n # scan should be on Y-axis\n if (@invert)\n let temp = dx # swap dx, dy\n let dx = dy\n let dy = temp\n\n let @positivex = (@y < desty)\n let @positivey = (@x < destx)\n else\n let @positivex = (@x < destx)\n let @positivey = (@y < desty)\n end\n\n let @d = (2 * dy) - dx\n let @straightD = 2 * dy\n let @diagonalD = 2 * (dy - dx)\n end",
"def set_Destination(value)\n set_input(\"Destination\", value)\n end",
"def set_Destination(value)\n set_input(\"Destination\", value)\n end",
"def set_Destination(value)\n set_input(\"Destination\", value)\n end",
"def destination\n super\n end",
"def destination_params\n params.require(:destination).permit(:city, :state, :packing_list, :category, :avatar, :suggestion_id)\n end",
"def auto_destination= dest\n @auto_destination = (dest == '/') ? nil : dest\n end"
] | [
"0.7589915",
"0.62062234",
"0.6092163",
"0.6044265",
"0.6023083",
"0.5994683",
"0.59566385",
"0.5937222",
"0.59344935",
"0.58746743",
"0.5832598",
"0.58178014",
"0.5743225",
"0.571955",
"0.5697374",
"0.5666418",
"0.56610596",
"0.5653673",
"0.5625447",
"0.5583469",
"0.55764425",
"0.55761385",
"0.55597365",
"0.55527735",
"0.55527735",
"0.5552142",
"0.55490965",
"0.55490965",
"0.55450326",
"0.55388963",
"0.5532652",
"0.54646647",
"0.54646647",
"0.54646647",
"0.5462361",
"0.5461811",
"0.5440007",
"0.5409269",
"0.5405654",
"0.5403138",
"0.5398526",
"0.5380426",
"0.53518784",
"0.5342375",
"0.53416973",
"0.53340584",
"0.53051746",
"0.5297471",
"0.52870166",
"0.5284767",
"0.5281415",
"0.5281415",
"0.5281415",
"0.5281105",
"0.52800643",
"0.5279612",
"0.52618814",
"0.5260757",
"0.5255159",
"0.5222726",
"0.5215461",
"0.520925",
"0.52087855",
"0.5183249",
"0.5176354",
"0.51635516",
"0.5154439",
"0.5135788",
"0.5133059",
"0.5133008",
"0.51317143",
"0.51245934",
"0.51170814",
"0.510956",
"0.50976795",
"0.50976795",
"0.50948125",
"0.5088278",
"0.50869846",
"0.50841737",
"0.50752586",
"0.5074453",
"0.5072982",
"0.50679696",
"0.5064246",
"0.50502855",
"0.5044444",
"0.50233173",
"0.5014462",
"0.4998015",
"0.49907297",
"0.49847102",
"0.49809638",
"0.49804476",
"0.49777728",
"0.49777728",
"0.49777728",
"0.49744034",
"0.49713755",
"0.49514365"
] | 0.8459319 | 0 |
Checks if the given position remains within the board | def within_board?(x, y)
BOARD_SIZE.include?(x) && BOARD_SIZE.include?(y)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_board?(pos)\n pos.all? { |el| el.between?(0, @board.size - 1) }\n end",
"def position_taken?(board, position)\n int = position.to_i\n if board[int - 1] != 0.upto(8) || board[int - 1] != \" \"\n return false\n end\nend",
"def on_board?(pos)\n pos.all? {|coord| coord.between?(0, SIZE - 1)}\n end",
"def check_position(position)\n\n puts \"Checking \" + position[0].to_s + \",\" + position[1].to_s\n\n unless check_valid_board_position(position)\n puts \"Invalid board position\"\n return false\n end\n\n if @board[position[1]][position[0]] != \".\"\n puts \"Position already occupied\"\n false\n else\n true\n end\n\n end",
"def position_taken?(board, position)\n if !(board[position.to_i - 1] == \"X\" || board[position.to_i - 1] == \"O\")\n return true\n else \n return false\n end\nend",
"def position_taken?(board, position)\n position = position.to_i - 1\n if board[position] == \"X\" || board[position] == \"O\"\n true\n end\nend",
"def position_taken?(board, position)\n value = position.to_i - 1\n if board[value] == \"X\" || board[value] == \"0\"\n true\n end\nend",
"def position_taken?(board, position)\n\tif board[position] == \"X\" || board[position] == \"0\"\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"def valid_move?(board, position)\n indexed_position = position.to_i - 1\n indexed_position.between?(0,8) && !position_taken?(board, indexed_position)\nend",
"def position_check(position)\n @gameboard.array.include?(position)\n end",
"def position_taken?(board,position)\n position = position.to_i - 1\n if board[position] == \"X\" || board[position] == \"O\"\n return true\n else\n return false\n end\nend",
"def valid_move?(board, position)\n position.between?(0, 8) && !position_taken?(board, position)\nend",
"def valid_position?(position)\n\tboard_size = 8\n\tposition[0].between?(0, board_size - 1) && position[1].between?(0, board_size - 1)\nend",
"def position_taken?(position)\n @board[position] != \" \"\n end",
"def position_taken?(board, position)\n if !board.empty? && board[position] && (board[position].include?(\"X\") || board[position].include?(\"O\"))\n true\n else\n false\n end\nend",
"def position_taken?(position)\n @board[position] != \" \"\n end",
"def valid_move?(board, position)\n position = position.to_i - 1\n if position.between?(0, 8) && !position_taken?(board, position)\n true\n end\nend",
"def position_taken?(board,position)\n pos = position.to_i\n val = board[pos-1]\n if val == \"X\" || val ==\"O\"\n true\n else\n false\n end\nend",
"def full?(board) #check if the board is full\n board.each_with_index do |position, index|\n if position_taken?(board, index) == false \n return false\n end\n end\n return true\nend",
"def valid_move? (board, position)\n position = position.to_i - 1\n (position.between?(0,8)) && (position_taken?(board, position) == false)\nend",
"def position_taken?(position)\n @board[position] != nil && @board[position] != \" \"\n end",
"def valid_move?(board, position)\n !position_taken?(board, position) && position.between?(0,8)\nend",
"def position_taken?(board, position)\n\ta = board[position.to_i - 1]\n\tif a != \" \"\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"def position_taken?(board, position)\n return true if board[position - 1] == \"X\" || board[position - 1] == \"O\"\n false\nend",
"def valid_move?(board,position)\n position=position.to_i-1\n if position.between?(0,8) && !position_taken?(board, position)\n true\n else\n false\n end\nend",
"def valid_move?(board, position)\n position = (position.to_i - 1)\n\n if position.between?(0, 8) && !position_taken?(board, position)\n true\n else false\n end\nend",
"def position_taken?(board,pos)\n if board[pos.to_i]==\"X\" || board[pos.to_i] ==\"O\"\n return true\n else\n return false\n end\nend",
"def position_taken?(board, position)\n board[position] != \" \"\nend",
"def valid_position?(position)\r\n\tboard_size = 8\r\n\tposition[0].between?(0, board_size - 1) && position[1].between?(0, board_size - 1)\r\nend",
"def valid_move?(board, position)\n position = position.to_i - 1\n position_taken?(board, position) == false && position.between?(0,8) == true\nend",
"def position_taken?(position)\n !(@board[position.to_i] == \" \") \n end",
"def valid_move?(board, position)\n position.to_i.between?(1,9) && !position_taken?(board, position.to_i-1)\nend",
"def position_taken?(board, position)\n \n if board[position.to_i-1] == \" \"\n then false\n elsif board[position.to_i-1] == \"\" \n then false\n elsif board[position.to_i-1] == nil\n then false\n elsif board[position.to_i-1] == \"X\"\n then true\n elsif board[position.to_i-1] == \"O\"\n then true\n end\nend",
"def position_taken?(board, position)\n if board[(position.to_i) - 1] == \" \" || board[(position.to_i) - 1] == \"\" || board[(position.to_i) - 1] == nil\n false\n elsif board[(position.to_i) - 1] == \"X\" || board[(position.to_i) - 1] == \"O\"\n \tfalse\n end\nend",
"def position_taken?(board, position)\n return false if valid_move?(board, position)\n return true unless valid_move?(board, position)\nend",
"def validate_position(row,col)\n if row<=@board.size and col <=@board.size\n if @board[row][col]==EMPTY_POS\n return true\n else\n puts \"position is occupied\"\n end\n else\n puts \"invalid position\"\n end\n return false\n end",
"def position_taken?(board, position)\n\tx = board[position -1]\n\tcase x \n\twhen \"\", \" \"\n\t\t return false \n\telse\n\t\t return true \n\tend\nend",
"def position_taken?(board, position)\n board[position] == 'X' || board[position] == 'O'\nend",
"def valid_move?(board, position)\n position_taken?(board, position) == false && position.between?(0, 8) ? true : false\nend",
"def position_taken?(board, position)\n if board[(position.to_i - 1)] == \" \"\n false\n else\n true\n end\nend",
"def position_taken?(board, position)\n if board[position] == \"X\" || board[position] == \"O\"\n true\n else\n false\n end\nend",
"def position_taken?(pos)\r\n #true if space is empty and false if filled\r\n if @board[pos] == \" \"\r\n return false\r\n else\r\n return true\r\n end\r\n end",
"def position_taken?(board, position)\n if (board[position] == \"X\" || board[position] == \"O\")\n true\n end\nend",
"def position_taken?(position)\n !(@board[position].nil? || @board[position] == \" \")\n end",
"def valid_move?( board, position )\n position_int = position.to_i\n position_ary = position_int - 1\n if !(position_taken?( board, position_ary )) && position_ary.between?( 0, 8 )\n true\n else\n false\n end\nend",
"def valid_move?( board, position )\n position_int = position.to_i\n position_ary = position_int - 1\n if !(position_taken?( board, position_ary )) && position_ary.between?( 0, 8 )\n true\n else\n false\n end\nend",
"def valid_move?(board, position)\n # position = position.to_i \n position.to_i. between?(1, 9) && !position_taken?(board, position.to_i-1)\nend",
"def position_taken?(board, position)\n if board[position] == \"X\" || board[position] == \"O\"\n return true\n end\n false\nend",
"def valid_move? (board, index)\n if index.between?(0,8) && position_taken?(board, index) == true\n #position is between 0-8 (1-9) AND the position is available (#position_taken)\n true\n else\n false\n end\nend",
"def valid_move?(board, position)\n if position_taken?(board, position) == false && position.to_i.between?(0,8)\n true\n else\n false\n end\n end",
"def occupied(pos)\n\t\t!( @board[pos] == \"*\" ) ? true : false\n\tend",
"def position_taken?(board, pos)\n if board[pos]==\"X\" || board[pos]==\"O\"\n taken = true\n else\n taken = false\n end\n taken\nend",
"def position_taken?(board, position)\n if board[position] == \"X\" || board[position] == \"O\"\n return true\n end\nend",
"def position_taken?(board,position)\n return true if board[position]==\"X\" || board[position]==\"O\"\n return false\nend",
"def valid_move?(board, position)\n if !(position_taken?(board, position)) && position.between?(0, 8)\n return true\n else\n return false\n end\nend",
"def valid_move?(position)\n position.between?(0,8) && !position_taken?(position)\n end",
"def valid_move?(board, position)\n index = position.to_i\n if position_taken?(board, index) == false && index.between?(0, 8)\n return true\n else\n return false\n end\nend",
"def position_taken?(board, desired_position)\n if [\" \", \"\", nil].include?board[desired_position]\n return false\n end\n if [\"X\", \"O\"].include?board[desired_position]\n return true\n end\nend",
"def position_taken?(board, position)\n if (board[position.to_i - 1] == \"X\" || board[position.to_i - 1] == \"O\")\n return true\n elsif !(board[position.to_i - 1] == \" \" || board[position.to_i - 1] == nil )\n return true\n else\n return false\n end\nend",
"def position_taken?(board, idx)\n [\"X\", \"O\"].include?(board[idx])\nend",
"def position_taken?(board, position)\n board[position] == \"X\" || board[position] == \"O\"\nend",
"def position_taken?(board, position)\n board[position] == \"X\" || board[position] == \"O\"\nend",
"def validating_position?(board, position, marker)\n \tboard[position] == position + 1\nend",
"def position_taken?(board, position)\n if (board[position] == \"X\" || board[position] == \"O\")\n true\n else\n false\n end\n\nend",
"def touching?(board)\n @positions.any? do |row, col|\n [[0, 0], [1, 0], [-1, 0], [0, 1], [0, -1]].any? do |dr, dc|\n board.nonempty_space?(row + dr, col + dc)\n end\n end\n end",
"def valid_move?(board, index)\n # Is the position taken?\n pos_taken = position_taken?(board, index)\n # Is the position on the board?\n on_board = index.between?(0, board.length - 1)\n # If position is open and on the board, return true,\n if !pos_taken && on_board\n return true\n else\n return false\n end\nend",
"def valid_move?(board, position)\n position = position.to_i\n if(position.between?(1,9))\n position -=1\n if(position_taken?(board, position))\n false\n else\n true\n end\n end\nend",
"def position_taken?(location)\n @board[location] != \" \" && @board[location] != \"\"\n end",
"def position_taken?(board,position)\n position= position.to_i\n position = position - 1\n board[position]!= \" \" && board[position]!= \"\" && board[position]!= nil\nend",
"def valid_move?(board, position)\n position = position.to_i\n \n if !(position_taken?(board, position-1)) && position.between?(1,9)\n return true\n else\n return false\n end\nend",
"def valid_move?(board, position)\n position = position.to_i - 1\n if position_taken?(board, position) == false && position.to_i.between?(0, 8)\n return true\nelsif position_taken?(board, position) == true\n return false\nelse \n return false\nend\nend",
"def valid_move?(board, position)\n position.to_i.between?(1,9) && !position_taken?(board,position.to_i-1)\n\nend",
"def position_taken?(board, location)\n board[location] != \" \" && board[location] != \"\"\n end",
"def on_board? position #position should be [x,y]\n\t\tposition.all? { |val| val.between?( 0, 7 ) }\n\tend",
"def position_taken?(board, position)\n if board[position.to_i-1] == \" \" || board[position.to_i-1] == \"\" || board[position.to_i-1] == nil # if the position is empty like so \" \" or like so \"\", or if the position has a value of nil, it has not been taken\n false\n else # otherwise, it is unavailable\n true\n end\nend",
"def position_taken?(board, position)\n chars = ['X', 'O']\n chars.include? board[position]\nend",
"def position_taken?(board, index_to_validate)\n if (board[index_to_validate] == \"X\" || board[index_to_validate] == \"O\")\n return true\n end\n return false # NOTE: if we arrive here, the position is definitely not taken\nend",
"def position_taken?(board, position)\n if board[position]==\"\" || board[position]==\" \"\n return false\n elsif board[position] == \"X\" || board[position]==\"O\"\n return true\n else\n return false\n end\nend",
"def position_taken?(location)\n @board[location] != \" \" && @board[location] != \"\"\n end",
"def position_taken?(location)\n @board[location] != \" \" && @board[location] != \"\"\n end",
"def move_valid?(pos)\n return false unless board.in_bounds?(pos)\n return false if board.occupied?(pos) && board.grid[pos[0]][pos[1]].color == self.color\n true\n end",
"def position_taken?(board, index)\n space = board[index]\n if space == 'X' || space == \"O\"\n return true\n else\n return false\n end\nend",
"def on_board?(pos)\n pos.all? {|p| p >= 0 && p <= 7}\n end",
"def is_legal?(pos)\n # checks if there is a piece in the spot and whether it is the same\n # color. Also checks if it is off of the board.\n return false unless pos[0].between?(0, 7) && pos[1].between?(0, 7)\n return true if board[pos.first][pos.last].nil?\n return false if self.color == board[pos.first][pos.last].color\n\n true\n end",
"def position_taken?(board, position)\n return true if (board[position-1] == \" \" || board[position-1] == \"\" || board[position-1] == nil)\n return false if (board[position-1] == \"X\" || board[position-1] == \"O\")\nend",
"def check_move?(new_position)\n if new_position[0].between?(0,7) &&\n new_position[1].between?(0,7) &&\n !space_full?(new_position)\n return true\n end\n false\n end",
"def valid_move?(position)\n index=position.to_i - 1\n index.between?(0, 8) && !(position_taken?(index))\n end",
"def position_taken?(board,index)\n [\"X\", \"O\"].include?(board[index])\nend",
"def position_taken?(board, position)\n\n position = board[position.to_i]\n if board[position.to_i] == \" \" || board[position.to_i] == \"\" || board[position.to_i] == nil\n false\n else board[position.to_i] == \"X\" || board[position.to_i] == \"O\"\n true\n end\nend",
"def valid?(position)\n row, col = position\n position.all? {|i| i >= 0 && i< @grid.length}\n \n end",
"def position_taken?(board, index)\n\n if board == [\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"] and index == 0\n false\n elsif board == [\"\", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"] and index == 0\n false\n elsif board == [nil, \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"]\n false\n elsif board == [\"X\", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \"O\"] and between? == true\n true\n end\n\nend",
"def valid_move? (board, index)\n if index.between?(0, 8) && !position_taken?(board, index)\n true \n end \nend",
"def position_taken?(board, position)\n board[position] != \" \" && board[position] != \"\"\nend",
"def valid_move?(board, index)\n index.between?(0, 8) && position_taken?(board, index) == false\n\nend",
"def move_into_check?(pos)\n board_dup = board.dup\n\n board_dup.move!(self.pos, pos)\n\n board_dup.in_check?(board_dup[pos].color)\n end",
"def valid_move? (board, index)\n index.between?(0, 8) && !position_taken?(board, index)\nend",
"def position_taken?(board, new_index)\n if board[new_index] == \"X\" || board[new_index] == \"O\"\n return true\n else\n return false\n end\nend",
"def position_taken?(board, position)\n if ((board[position] == \"X\") || (board[position] == \"O\" ))\n return true\n elsif board[position] == nil\n false\n else\n false\n end\nend",
"def in_board?(x, y)\n x >= 0 && y >= 0 && x < @board.size && y < @board[x].size - 1\n end",
"def valid_move?(board, position)\n position = position.to_i\n \n if (position_taken?(board, position) ==false) && position.between?(1,9)\n return true\n else\n return false\n end\nend",
"def valid_move?(board,index)\n if index.between?(0,8) && position_taken?(board,index)\n true\n end\nend"
] | [
"0.7868998",
"0.78427935",
"0.7838406",
"0.7818385",
"0.7801968",
"0.7790167",
"0.7788958",
"0.7745353",
"0.7741053",
"0.7739301",
"0.7709756",
"0.77031",
"0.76981044",
"0.76784337",
"0.76782143",
"0.76752454",
"0.76629615",
"0.76542926",
"0.76477575",
"0.76452565",
"0.76361823",
"0.7631141",
"0.76273227",
"0.7616349",
"0.76140064",
"0.76061934",
"0.76003325",
"0.75945455",
"0.75914234",
"0.7588054",
"0.7577766",
"0.7573322",
"0.7559787",
"0.7547878",
"0.7544532",
"0.7538307",
"0.7521955",
"0.75203055",
"0.75173473",
"0.7515169",
"0.7514673",
"0.7511121",
"0.7505615",
"0.75037557",
"0.74946266",
"0.74946266",
"0.74944586",
"0.7493868",
"0.7488912",
"0.74872977",
"0.7482418",
"0.7477204",
"0.7471064",
"0.7471001",
"0.74629825",
"0.7461933",
"0.74603635",
"0.7459317",
"0.74564075",
"0.74505955",
"0.7443114",
"0.7443114",
"0.7437003",
"0.74263775",
"0.7422351",
"0.7421425",
"0.7419144",
"0.7417812",
"0.7417109",
"0.741116",
"0.74072415",
"0.74067473",
"0.7403644",
"0.7397815",
"0.7393966",
"0.73917645",
"0.7389378",
"0.73870414",
"0.73857796",
"0.73857796",
"0.7385071",
"0.7384483",
"0.7377385",
"0.73756814",
"0.7373935",
"0.7371984",
"0.7369185",
"0.73650277",
"0.73647296",
"0.73631287",
"0.7357639",
"0.7351923",
"0.73486656",
"0.7346341",
"0.73376757",
"0.7328746",
"0.73270404",
"0.73242855",
"0.73214185",
"0.73201984",
"0.7311607"
] | 0.0 | -1 |
Maps the character to number | def char_mapping
@char_mapping ||= BOARD_SIZE.each_with_object({}) do |index, hash|
hash[(96 + index).chr] = index
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replaceCharToNumber(char)\n case char\n when 'T'\n then\n char = 10\n when 'J'\n then\n char = 11\n when 'Q'\n then\n char = 12\n when 'K'\n then\n char = 13\n when 'A'\n then\n char = 14\n end\n char.to_i\nend",
"def letter_to_number(letter)\n letter.ord - 64\nend",
"def letter_to_number(letters)\n letters.upcase.each_codepoint.reduce(0) do |result, codepoint|\n 26 * result + codepoint - CODEPOINT_OFFSET\n end\n end",
"def translate_string_to_number(input)\n\n #take the input\n #break it up into individual letters\n #map the letters to a dictionary (a = 1) or\n #map the input to a placement in an array\n\nend",
"def letter_to_number(letter)\n case letter\n when \"A\", \"B\", \"C\"\n print \"2\"\n when \"D\", \"E\", \"F\"\n print \"3\"\n when \"G\", \"H\", \"I\"\n print \"4\"\n when \"J\", \"K\", \"L\"\n print \"5\"\n when \"M\", \"N\", \"O\"\n print \"6\"\n when \"P\", \"Q\", \"S\", \"T\"\n print \"7\"\n when \"T\", \"U\", \"V\"\n print \"8\"\n when \"W\", \"X\", \"Y\", \"Z\"\n print \"9\"\n when \" \"\n print \"-\"\n else \n print \"Not a letter\"\n end\nend",
"def charToNum(letter)\n return letter.upcase.ord-65 #ensure this is uppercase???\nend",
"def interesting_number(number)\n number.each_char.map {|c| c.to_i}\n puts number\nend",
"def letterToInt (c)\n\t\treturn c.ord() -'A'.ord() + 1\n\tend",
"def get_char_number(char)\n a = 'a'.ord\n z = 'z'.ord\n val = char.ord\n\n if a <= val && val <= z\n return val - a\n end\n\n -1\nend",
"def convert_to_int num_string\n num_hash = {\n '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4,\n '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9 \n }\n\n num_array = num_string.chars.map do |char|\n num_hash[char]\n end\n\n final_number = 0\n count = num_array.length - 1\n\n num_array.each do |num| \n final_number += num * (10 ** count)\n count -=1\n end\n\n p final_number\nend",
"def dec_rom_num_map\n {\n 3000 => \"MMM\",\n 2000 => \"MM\",\n 1000 => \"M\",\n 900 => \"DCCCC\",\n 800 => \"DCCC\",\n 700 => \"DCC\",\n 600 => \"DC\",\n 500 => \"D\",\n 400 => \"CCCC\",\n 300 => \"CCC\",\n 200 => \"CC\",\n 100 => \"C\",\n 90 => \"LXXXX\",\n 80 => \"LXXX\",\n 70 => \"LXX\",\n 60 => \"LX\",\n 50 => \"L\",\n 40 => \"XXXX\",\n 30 => \"XXX\",\n 20 => \"XX\",\n 10 => \"X\",\n 9 => \"VIIII\",\n 8 => \"VIII\",\n 7 => \"VII\",\n 6 => \"VI\",\n 5 => \"V\",\n 4 => \"IIII\",\n 3 => \"III\",\n 2 => \"II\",\n 1 => \"I\"\n }\nend",
"def letter_to_num(letter)\n \n if letter?(letter) == false\n return false\n end\n \n if letter.length != 1\n return false\n end\n \n letter = letter.downcase\n \n number = letter.ord - 96\nend",
"def convert_tile_to_number(cell)\n row = cell['row']\n column = cell['column']\n convert = {}\n nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']\n letters.zip(nums) do |letter, num|\n convert[letter] = num\n end\n\n cell_number = ((convert[row] - 1)* 12) + (column - 1)\n response = cell_number\n\n if !cell['current_color'].nil?\n response = [cell_number, cell['current_color']]\n end\n\n response\n end",
"def row_to_num(input)\n (\"a\"..\"zz\").to_a.index(input[0])\n end",
"def column_letter_to_number(column_letter)\n pow = column_letter.length - 1\n result = 0\n column_letter.each_byte do |b|\n result += 26**pow * (b - 64)\n pow -= 1\n end\n result\n end",
"def encode_digit(d)\n d + 22 + 75 * (d < 26 ? 1 : 0)\n # 0..25 map to ASCII a..z or A..Z \n # 26..35 map to ASCII 0..9\n end",
"def numbers_to_numerals\n {\n 1 => \"I\",\n 4 => \"IV\",\n 5 => \"V\",\n 9 => \"IX\",\n 10 => \"X\",\n 40 => \"XL\",\n 50 => \"L\",\n 90 => \"XC\",\n 100 => \"C\",\n 400 => \"CD\",\n 500 => \"D\",\n 900 => \"CM\",\n 1000 => \"M\"\n }\n end",
"def to_num(input)\n result = 0\n #iterate on roman number hash\n MAPPING.each do |k,v|\n while input.index(k) == 0 #if \"CL\".index(\"C\") == 0\n result += v #assign value of current hash key\n input.slice!(0) #remove string \"C\" from input and so on\n end\n end\n result\n end",
"def numberfy(string)\n message = string.downcase.split(//)\n message.each do |char|\n (ALPHA.include? char) ? number = ALPHA_HASH[char] : number = char\n @numeric_message << number\n end\n end",
"def encode_digit(d)\n d + 22 + 75 * (d < 26 ? 1 : 0)\n # 0..25 map to ASCII a..z\n # 26..35 map to ASCII 0..9\n end",
"def map_char(ident, &block) ; map_primitive(:char, ident, &block) ; end",
"def translate_color_to_num(color)\n case color\n when \"b\"\n 1\n when \"w\"\n 2\n when \"r\"\n 3\n when \"g\"\n 4\n end\n end",
"def replaceNumberToChar(number)\n case number\n when 10\n then\n number = 'T'\n when 11\n then\n number = 'J'\n when 12\n then\n number = 'Q'\n when 13\n then\n number = 'K'\n when 14\n then\n number = 'A'\n end\n number.to_s\nend",
"def create_letter_to_number_hash\n letters = (\"a\"..\"z\")\n letter_number = Hash.new\n count = 0\n letters.each do |letter|\n letter_number[letter] = count\n count += 1\n end\n\n letter_number\nend",
"def to_numbers( chars )\r\n chars.unpack(\"C*\").collect {|x| x - 64}\r\n end",
"def convert_map_coordinate(map_coordinate)\n coordinate = map_coordinate.to_s # in case it was a symbol\n # converts first character \"ABCDEFGHIJ\" <=> \"0123456789\"\n one = coordinate[0]\n two = coordinate[1,2]\n\n if one.ord < \"A\".ord\n # \"00\"..\"09\" to \"A1\"..\"J1\"\n two = (two.ord + 17).chr # convert digits to characters\n one = (one.to_i + 1).to_s\n coordinate = (two + one).to_sym\n else\n one = (one.ord - 17).chr # convert characters to digits\n two = (two.to_i - 1).to_s\n coordinate = two + one # allows A1 J1 map to 00..09\n end\n return coordinate\nend",
"def column_name_to_num(name)\n num = 0\n name.upcase.each_char do |c|\n num *= 26 if num > 0\n add = c.ord - \"A\".ord + 1\n raise \"Invalid symbol in Excel column name: '#{c}'\" if add < 1 || add > 26\n num += add\n end\n num - 1\n end",
"def number_encoder( input )\n output = \"\"\n \n # build letter to number hash\n translator = Hash.new\n letters = ('A'..'Z').to_a\n letters.each_index{|i| translator[ letters[i] ] = i+1 }\n\n \n # seperates into chunks\n input.each(' ') do |chunk|\n chunk.each_char() { |char| output << translator[char].to_s + ' ' }\n end\n output.rstrip!\n output \nend",
"def vowels_to_numbers(word)\n word.tr('aeiou','43106')\n end",
"def number_decoder( input )\n output = \"\"\n \n # build number to letter hash\n translator = Hash.new\n letters = ('A'..'Z').to_a\n letters.each_index{|i| translator [(i+1).to_s] = letters[i] }\n \n input.each(' ') do |nibble|\n\n \n num = nibble.strip.to_i\n if (num == 0 or num.nil?) then output << \" \"\n else\n case (num-1)/26\n when 0 then output << translator[num.to_s]# + ' '\n when 1 then output << translator[(num - 26).to_s]\n end\n end\n end\n \n output\nend",
"def numToChar(number)\n return (number+65).chr\nend",
"def to_digit\n return NUMBER[self] if self <= 9 && self >= 0\n NUMBER[0]\n end",
"def title_to_number(s)\n s.split(\"\").map {|ch| ch.ord - 'A'.ord + 1}.reduce(:+)\nend",
"def split_char(char)\n return if char.nil?\n x, y = char.split('')\n [char_mapping[x.downcase], y.to_i]\n end",
"def title_to_number(s)\n i = - 1\n s.chars.reverse.inject(0) { |agg, c|\n i += 1\n agg + 26 ** i * (c.ord - 'A'.ord + 1)\n } \nend",
"def mapping\n {\n \"ch\" => 4,\n \"co\" => 3,\n \"gen\" => 0,\n \"char\" => 4,\n \"copy\" => 3,\n \"art\" => 1,\n \"meta\" => 5,\n \"general\" => 0,\n \"character\" => 4,\n \"copyright\" => 3,\n \"artist\" => 1,\n }\n end",
"def message_to_numbers(message) # not working need to change the hash or find smarter solution\n keyboard = {\n -1 => [''],\n 0 => [' '],\n 1 => [''],\n 2 => ['a', 'b', 'c'],\n 3 => ['d', 'e', 'f'],\n 4 => ['g', 'h', 'i'],\n 5 => ['j', 'k', 'l'],\n 6 => ['m', 'n', 'o'],\n 7 => ['p', 'q', 'r', 's'],\n 8 => ['t', 'u', 'v'],\n 9 => ['w', 'x', 'y', 'z']\n }\n\n coresponding_sequence = []\n p message.chars\n message.chars.each do |char|\n number = keyboard.key(char)\n p keyboard.key('')\n #keyboard[number].index(char).times {coresponding_sequence << number}\n end\n\n coresponding_sequence\nend",
"def number_to_ord(i)\n nums_hash = { \n \"1\" =>\t\"First\",\n \"2\" =>\t\"Second\",\n \"3\" =>\t\"Third\",\n \"4\" =>\t\"Fourth\",\n \"5\" =>\t\"Fifth\",\n \"6\" =>\t\"Sixth\",\n \"7\" =>\t\"Seventh\",\n \"8\" =>\t\"Eighth\",\n \"9\" =>\t\"Ninth\",\n \"10\" =>\t\"Tenth\",\n \"11\" => \"Eleventh\",\n \"12\" =>\t\"Twelfth\",\n \"13\" => \"Thirteenth\",\n \"14\" => \"Fourteenth\",\n \"15\" => \"Fifteenth\",\n \"16\" => \"Sixteenth\",\n \"17\" => \"Seventeenth\",\n \"18\" => \"Eighteenth\",\n \"19\" => \"Nineteenth\",\n \"20\" => \"Twentieth\"\n }\n nums_hash[i.to_s]\nend",
"def word_to_digit(str)\n num_hash = {\n 'one'=> 1, 'two'=> 2, 'three'=> 3, 'four'=> 4, 'five'=> 5, 'six'=> 6, 'seven'=> 7, 'eight'=> 8, 'nine'=> 9, 'zero'=> 0\n }\n \n num_hash.keys.each {|key|\n str.gsub!(key,num_hash[key].to_s)\n }\n \n str\nend",
"def number_encoding(str)\n result = ''\n str.downcase.each_char do |char|\n if char =~ /[a-z]/\n result << (char.ord - 96).to_s\n else\n result << char\n end\n end\n result\nend",
"def atoi(word)\n results = []\n word.chars.each do |char|\n letter = change_letter(char)\n results << letter\n end\n results.each do |integer|\n print integer\n end\n puts \"\"\nend",
"def mnemonic_digit(char)\n char.downcase!\n n = char.ord - 'a'.ord\n n -= 1 if char.ord >= 'q'.ord\n n -= 1 if char.ord >= 'x'.ord\n\n 2 + n / 3\nend",
"def number_to_letter\n\t\t(self + 64).chr\n\tend",
"def next_char c, number\n new_ord = c.ord + filter_by_95(number)\n if new_ord > 126\n new_ord -= (126 - 31)\n end\n return new_ord.chr\nend",
"def translate_notation(letter_number)\n coordinates = letter_number.split(//)\n translate_row(coordinates[1])\n translate_column(coordinates[0])\n { row: @row, column: @column }\n end",
"def locNumToInt(str)\n\tnum = 0\n\tstr.split('').each {|c|\n\t\tnum += 2**(c.ord - 97)\n\t}\n\tnum\nend",
"def symbol_to_integer(key)\n\t\tkey[-2..-1].to_i\n\tend",
"def word_to_digit(number_string)\n NUMBER_HASH.each do |string, value|\n number_string.gsub!(/\\b#{string}\\b/, NUMBER_HASH[string])\n end\n number_string\nend",
"def string_to_integer(string)\n\n\tnumbers = {'0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5,\n\t\t\t\t'6' => 6, '7' => 7, '8' => 8, '9' => 9 }\n\n\tarray = string.chars.map do |n|\n\t\tnumbers[n]\n\tend\n\n\tarray.inject(0){ |total, num| total * 10 + num}\n\nend",
"def string_to_integer(string)\n\n\tnumbers = {'0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5,\n\t\t\t\t'6' => 6, '7' => 7, '8' => 8, '9' => 9 }\n\n\tarray = string.chars.map do |n|\n\t\tnumbers[n]\n\tend\n\n\tarray.inject(0){ |total, num| total * 10 + num}\n\nend",
"def word_to_digit(string)\n words_to_numbers = {\n 'zero' => 0,'one' => 1, 'two' => 2,'three' => 3,'four' => 4,\n 'five' => 5,'six' => 6,'seven' => 7,'eight' => 8,'nine' => 9,\n }\n words_to_numbers.keys.each do |word|\n string.gsub!(word,words_to_numbers[word].to_s)\n end\n string\nend",
"def mapper(character)\n case \n when character==\"J\" then \"jack\"\n when character==\"Q\" then \"queen\"\n when character==\"K\" then \"king\"\n when character==\"A\" then \"ace\"\n else character\n end\n\nend",
"def decode_digit(cp)\n cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : BASE\n end",
"def decode_digit(cp)\n cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : BASE\n end",
"def hexToDec(hexChar)\n #Between 0 and 9\n if hexChar.match(/\\d/)\n return hexChar.to_i\n else\n case hexChar \n when 'A'\n return 10 \n when 'B'\n return 11 \n when 'C'\n return 12 \n when 'D'\n return 13 \n when 'E'\n return 14 \n when 'F'\n return 15\n end\n end \nend",
"def to_num(string)\n string.gsub!(' ', '')\n string.each_char.map { |char| \"#{convert[char]} \" }.join.chop\n end",
"def int_to_key(num)\n #10s digit = num/26\n d1 = num/26 + 97\n\n #1s digit = num%26\n d2 = num%26 + 97\n result = d1.chr + d2.chr\n\n return result\nend",
"def mapping(stringToSplit)\n arrSplit = stringToSplit.scan /\\w/\n return arrSplit.map { |n| n.ord }\nend",
"def ascii_value(string)\n counter = 0\n string.chars.map { |e| counter += e.ord }\n counter\nend",
"def convertDigitToNumeral(digit, index)\n returnStr = \"\"\n numerals = [\"I\", \"V\", \"X\", \"L\", \"C\", \"D\", \"M\"]\n case digit.to_i\n when 1..3\n i = 0\n while i < digit.to_i\n returnStr.concat(\"#{numerals[index]}\")\n i += 1\n end\n when 4\n returnStr.concat(\"#{numerals[index]}#{numerals[index + 1]}\")\n when 5\n returnStr.concat(\"#{numerals[index + 1]}\")\n when 6..8\n returnStr.concat(\"#{numerals[index + 1]}\")\n i = 0\n while i < (digit.to_i) - 5\n returnStr.concat(\"#{numerals[index]}\")\n i += 1\n end\n when 9\n returnStr.concat(\"#{numerals[index]}#{numerals[index + 2]}\")\n end\n return returnStr\nend",
"def pnum cel\n number = cel.gsub(' ', '').gsub('(', '').gsub(')', '')\n end",
"def to_char(x, y)\n \"#{char_mapping.key(x).upcase}#{y}\"\n end",
"def character\n {0 => :s, 1 => :p, 2 => :d, 3 => :f}[quantum_number]\n end",
"def number\n result = ''\n while @current_char and @current_char =~ /[[:digit:]]/\n result << @current_char\n advance\n end\n\n if @current_char == '.'\n result << @current_char\n advance\n while @current_char and @current_char =~ /[[:digit:]]/\n result << @current_char\n advance\n end\n Token.new(:real_const, result.to_f)\n else\n Token.new(:integer_const, result.to_i)\n end\n end",
"def letters_to_numbers(text_array, alphabet_hash)\n\ti = 0\n\tnew_name = 0\n\tnew_array =[]\n\t\n\ttext_array.each do |name|\n\t\tname.each_char do |char|\n\t\t\tnew_name += alphabet_hash[char]\n\t\t\tputs \"#{char} equals #{alphabet_hash[char]}\"\n\t\tend\n\t\tputs \"#{name} in numbers equals #{new_name}\"\n\t\tnew_array << new_name\n\t\tnew_name = 0\n\tend\n\tnew_array\nend",
"def do_digit(chr, base)\n # max roman number is 3000\n # 1 = base 1 char, 10 = base 2 chars, 100 = base 3 chars, 1000 = base 4 chars\n romans = { 1 => 'I', 5 => 'V', 10 => 'X', 50 => 'L', 100 => 'C', 500 => 'D', 1000 => 'M' }\n\n result = ''\n num = chr.to_i\n case num\n when (1..3)\n 1.upto(num) { result << romans[base] }\n when 4\n result << 'IV' if base == 1\n result << 'XL' if base == 10\n result << 'CD' if base == 100\n when 5\n result << 'V' if base == 1\n result << 'L' if base == 10\n result << 'D' if base == 100\n when (6..8)\n result << 'VI' if base == 1\n result << 'LX' if base == 10\n result << 'DC' if base == 100\n # add extra C, X or I\n 1.upto(num - 6) { result << romans[base] }\n when 9\n result << 'IX' if base == 1\n result << 'XC' if base == 10\n result << 'CM' if base == 100\n else\n # zero will go here, don't need to do anything about it\n end\n result\n end",
"def ord(x)\n if x.is_a? String\n x.ord\n else\n x\n end\nend",
"def character_score(character)\n alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n alphabet.index(character) + 1\nend",
"def get_number_system(tok)\n ret = String.new(tok)\n if ret[0] == 36 # $\n ret[0] = \"\"\n return ret.to_i(16)\n elsif ret[0] == 67 # C\n ret[0] = \"\"\n return ret.to_i(8)\n elsif ret[0] == 66 # B\n ret[0] = \"\"\n return ret.to_i(2)\n else\n return ret.to_i(10)\n end\n end",
"def digit; end",
"def metrics_for(char)\n glyph = if (char.kind_of?(Integer))\n ISO_LATIN1_ENCODING[char]\n else\n ISO_LATIN1_ENCODING[char.unpack(\"C*\").first]\n end\n @char_metrics[glyph]\n end",
"def increment_cell_value(str)\n letter = str[/[A-Za-z]+/]\n number = str[/\\d+/].to_i\n\n incremented_number = number + 1\n\n \"#{letter}#{incremented_number}\"\n end",
"def roman_to_int(str)\n hash = {\n 'M' => 1000,\n 'D' => 500,\n 'C' => 100,\n 'L' => 50,\n 'X' => 10,\n 'V' => 5,\n 'I' => 1,\n }\n sum = 0\n cur = 0\n\n str.chars.each do |l|\n prev = cur\n cur = hash[l]\n sum += cur\n sum -= (prev * 2) if prev < cur\n end\n\n sum\nend",
"def convert_to_numbers(multiline_digit)\n chunked = multiline_digit.map { |line| line.chars.each_slice(3).to_a }.transpose\n numbers = chunked.map { |digit| DIGIT_DICTIONARY[digit.flatten.join] ||= \"?\" }\n numbers.join('')\nend",
"def word_to_digit(phrase)\n numbers = {'zero' => 0, 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4,\n 'five' => 5, 'six' => 6, 'seven' => 7, 'eight' => 8, 'nine' => 9}\n phrase_arr = phrase.split(\" \")\n phrase_arr.map! do |word|\n if word[-1] == \".\"\n front = word.chop\n if numbers.keys.include?(front)\n word = numbers[front].to_s + \".\"\n else\n word\n end\n elsif numbers.keys.include?(word)\n word = numbers[word]\n else\n word\n end\n end\n p phrase_arr.join(\" \")\nend",
"def enumerate( char )\n raise \"An illegal character (\" + char + \") was entered!\" unless RomanNumeral.equivalents.has_key?(char)\n RomanNumeral.equivalents[char]\n end",
"def numeralise!(num, ans=\"\", mapping = roman_mapping)\n return ans if num == 0\n \n mapping.keys.each do |key_num|\n next unless key_num <= num\n quotient, modulus = num.divmod(key_num)\n ans << (mapping[key_num] * quotient)\n return numeralise!(modulus, ans) if quotient > 0\n end\nend",
"def decode_int\n # @index is at the position of the the 'i' so we just need everything between it\n # and the next appearance of 'e'.\n index_of_last_digit = self[@index..self.length - 1].index 'e'\n number_string = self[(@index + 1)..(@index + index_of_last_digit - 1)]\n @index += index_of_last_digit\n number_string.to_i\n end",
"def string_to_integer2(string)\n digits = string.chars.map { |char| HASH[char] }\n\n value = 0\n digits.each { |digit| value = 10 * value + digit }\n value\nend",
"def prev_char c, number\n new_ord = c.ord - filter_by_95(number)\n if new_ord < 32\n new_ord += (126 - 31)\n end\n return new_ord.chr\nend",
"def from_alpha(col)\n result = 0\n col = col.split(//)\n col.each_with_index do |c, i|\n result += (c.ord - 64) * (26**(col.length - (i + 1)))\n end\n result\n end",
"def from_alpha(col)\n result = 0\n col = col.split(//)\n col.each_with_index do |c,i|\n result += (c.ord - 64) * (26 ** (col.length - (i+1)))\n end\n result\n end",
"def hash\n num = 0\n self.each do |k,v|\n if k.is_a?(Integer) && v.is_a?(Integer)\n num += k * 26 + v\n elsif k.is_a?(Integer) && !v.is_a?(Integer)\n num += k * 26 + ALPHA_NUMBERS[v.to_s.downcase]\n elsif v.is_a?(Integer) && !k.is_a?(Integer)\n num += v * 26 + ALPHA_NUMBERS[k.to_s.downcase]\n elsif !k.nil? && !v.nil?\n num += ALPHA_NUMBERS[k.to_s.downcase] * ALPHA_NUMBERS[v.to_s.downcase]\n end\n end\n num\n end",
"def encode_character(char)\n if @@has_ord ||= char.respond_to?(:ord)\n char.ord.to_s\n else\n char[0]\n end\n end",
"def word_to_digit(words)\n DIGITS_HASH.keys.each do |word|\n words.gsub!(/\\b#{word}\\b/, DIGITS_HASH[word])\n end\n words\nend",
"def build_char_codes(node, key)\n build_char_codes(node.left, key + '0') if node.left\n build_char_codes(node.right, key + '1') if node.right\n @char_code[node.value] = key if node.leaf?\n end",
"def string_to_integer(str)\n num_hsh = {'1'=>1,'2'=>2,'3'=>3,'4'=>4,'5'=>5,'6'=>6,'7'=>7,'8'=>8,'9'=>9,'0'=>0,}\n arr = str.chars.reverse\n total = 0\n new_arr = []\n arr.each do |str|\n new_arr << num_hsh[str]\n end\n new_arr.each_with_index do |num, i|\n total += num * 10**i\n end\n total\nend",
"def parse_symbol(symbol, match_data)\n symbol.to_i\n end",
"def ascii_value(string)\r\n integer = 0\r\n string.each_char { |chr| integer += chr.ord }\r\n integer\r\nend",
"def numberise!(numeral, ans=0, mapping = roman_mapping)\n return ans if numeral.empty?\n\n mapping.values.each do |roman_num|\n while numeral[0..roman_num.size-1] == roman_num\n ans += mapping.key(roman_num)\n numeral = numeral[roman_num.size..-1]\n end\n end\n return numberise!(numeral, ans)\nend",
"def do_digit(chr, base)\n result = \"\"\n num = chr.to_i\n case num\n when (1..3)\n 1.upto(num) { result << ROMANS[base] }\n when 4 \n result << 'IV' if base == 1 #=> 4\n result << 'IL' if base == 10 #=> 40\n result << 'ID' if base == 100 #=> 400\n # no 4000+ in roman number, max roman number is 3000\n when 5\n result << 'V' if base == 1 #=> 5\n result << 'L' if base == 10 #=> 50\n result << 'D' if base == 100 #=> 500\n # no 5000 in roman number, max roman number is 3000\n when (6..8)\n result << 'V' if base == 1 #=> 6+\n result << 'L' if base == 10 #=> 60+\n result << 'D' if base == 100 #=> 600+\n 1.upto(num-5) { result << ROMANS[1] } # add extra 'III'\n # no 6000+ in roman number, max roman number is 3000\n when 9\n result << 'IX' if base == 1 #=> 9\n result << 'XC' if base == 10 #=> 90\n result << 'CM' if base == 100 #=> 900\n # no 9000 in roman number, max roman number is 3000\n end \n result\n end",
"def do_digit(chr, base)\n result = \"\"\n num = chr.to_i\n case num\n when (1..3)\n 1.upto(num) { result << ROMANS[base] }\n when 4 \n result << 'IV' if base == 1 #=> 4\n result << 'XL' if base == 10 #=> 40\n result << 'CD' if base == 100 #=> 400\n # no 4000+ in roman number, max roman number is 3000\n when 5\n result << 'V' if base == 1 #=> 5\n result << 'L' if base == 10 #=> 50\n result << 'D' if base == 100 #=> 500\n # no 5000 in roman number, max roman number is 3000\n when (6..8)\n result << 'VI' if base == 1 #=> 6+\n result << 'LX' if base == 10 #=> 60+\n result << 'DC' if base == 100 #=> 600+\n # add extra C, X or I\n 1.upto(num-6) { result << ROMANS[base] } \n # no 6000+ in roman number, max roman number is 3000\n when 9\n result << 'IX' if base == 1 #=> 9\n result << 'XC' if base == 10 #=> 90\n result << 'CM' if base == 100 #=> 900\n # no 9000 in roman number, max roman number is 3000\n end \n result\n end",
"def extract_number( val, letter )\n str_num = []\n val.split('').each do | num |\n if num != letter\n str_num << num\n end\n end\n\n return str_num.join()\n end",
"def ascii_value(str)\n counter = 0\n str.each_char do |char|\n counter = counter + char.ord\n end\n counter\nend",
"def roman_to_int(s)\n letters = {'I' => 1, 'V' => 5, 'X' => 10, 'L' => 50, 'C' => 100, 'D' => 500, 'M' => 1000}\n words = s.split(\"\")\n result = words.reduce do |accumulator, current|\n letters[accumulator] + letters[current]\n end \n result\nend",
"def convert_string_to_number(str); end",
"def get_phone_alpha_mappings()\n phone_mappings = {\n 'a' => 2,\n 'b' => 2,\n 'c' => 2,\n 'd' => 3,\n 'e' => 3,\n 'f' => 3,\n 'g' => 4,\n 'h' => 4,\n 'i' => 4,\n 'j' => 5,\n 'k' => 5,\n 'l' => 5,\n 'm' => 6,\n 'n' => 6,\n 'o' => 6,\n 'p' => 7,\n 'q' => 7,\n 'r' => 7,\n 's' => 7,\n 't' => 8,\n 'u' => 8,\n 'v' => 8,\n 'w' => 9,\n 'x' => 9,\n 'y' => 9,\n 'z' => 9\n }\n phone_mappings\nend",
"def char_to_id(ch); end",
"def intToLocNum(num)\n\tlocNumStr = \"\"\n\twhile num > 0\n\t\tlocNum = Math.log(num, 2).floor\n\t\tnum -= 2**locNum\n\t\tlocNumStr += (97 + locNum).chr\n\tend\n\tlocNumStr.reverse\nend",
"def to_number\n acc = ''\n mult = 1\n gnumber.split.each do |gdigit| # each gnumber is splitted into tokens (a single digit )\n val = @@galactic_digit[gdigit] # get the corrispondent Roman digit\n if val.nil?\n mult *= @@galactic_coin[gdigit]\n else # the digit has an equivalent roman digit\n acc << val # so it is accumulated in a string to produce a roman number\n end\n end\n mult * RomanNumber.new(acc).to_i\n end"
] | [
"0.79000664",
"0.71542317",
"0.7078814",
"0.7056756",
"0.70373267",
"0.69364727",
"0.67737263",
"0.65925413",
"0.6562108",
"0.6543928",
"0.65069336",
"0.6470825",
"0.6466184",
"0.6453851",
"0.64459795",
"0.64024603",
"0.6368526",
"0.635451",
"0.63265824",
"0.63247395",
"0.63224894",
"0.63077223",
"0.62970984",
"0.6274277",
"0.6273971",
"0.6248042",
"0.6241519",
"0.6192025",
"0.6185078",
"0.6178428",
"0.6173162",
"0.6168723",
"0.61642873",
"0.61638314",
"0.6151056",
"0.6147382",
"0.6146883",
"0.6145729",
"0.6143769",
"0.6117118",
"0.6106379",
"0.60885566",
"0.6053737",
"0.6049188",
"0.6044388",
"0.6014666",
"0.59734535",
"0.59724987",
"0.5954033",
"0.5954033",
"0.595078",
"0.59331036",
"0.5930432",
"0.5930432",
"0.5927838",
"0.5924715",
"0.5919658",
"0.591646",
"0.59127265",
"0.5902543",
"0.5900436",
"0.58874846",
"0.5880255",
"0.5866716",
"0.58656615",
"0.58593696",
"0.58199656",
"0.5818454",
"0.5815572",
"0.5814432",
"0.581195",
"0.5806859",
"0.5803937",
"0.58009297",
"0.5790338",
"0.57889783",
"0.5785373",
"0.5780123",
"0.5756288",
"0.57442796",
"0.5742049",
"0.57376164",
"0.5735838",
"0.57317483",
"0.572858",
"0.57213295",
"0.57205594",
"0.5719889",
"0.5719019",
"0.5715674",
"0.57124364",
"0.570356",
"0.5700511",
"0.5689355",
"0.56838745",
"0.56740326",
"0.56740284",
"0.5670734",
"0.5663385",
"0.565489"
] | 0.6338032 | 18 |
Splits the chat to (x,y) position | def split_char(char)
return if char.nil?
x, y = char.split('')
[char_mapping[x.downcase], y.to_i]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split(position)\n end",
"def split(position)\n end",
"def separate_coordinates\n piece = @input[0..1]\n @row = input_to_row(piece[1])\n @col = input_to_col(piece[0])\n\n location = @input[2..3]\n @row_new = input_to_row(location[1])\n @col_new = input_to_col(location[0])\n end",
"def draw_messages\n @messages.last(window_line_size).inject(0) do |line_number, message|\n setpos(line_number, 0)\n clrtoeol\n\n if message.command == \"PRIVMSG\"\n sendMsg = \"#{message.to}: <#{message.from}> #{message.msg}\"\n elsif message.command == \"Successfull Join\"\n @currentRoom = message.msg.split[0]\n @joinedRooms.merge(message.msg.split)\n sendMsg = message.text\n elsif message.command == \"Successfull Part\"\n @joinedRooms.delete(message.msg)\n if @currentRoom == message.msg then @currentRoom = @joinedRooms.to_a[0] end\n sendMsg = message.text\n else\n sendMsg = message.msg\n end\n\n if sendMsg != \"\"\n addstr(\"> #{sendMsg}\")\n line_number = line_number + 1\n end\n\n line_number\n end\n end",
"def split\n sw = (w / 2.0).round\n sh = (h / 2.0).round\n return Rect.new(x, y, sw, sh),\n Rect.new(x + sw, y, sw, sh),\n Rect.new(x, y + sh, sw, sh),\n Rect.new(x + sw, y + sh, sw, sh)\n end",
"def position\n [x, y]\n end",
"def position\n [@x, @y]\n end",
"def rect(a, b, screen)\n screen[0...b].each do |row|\n row[0...a] = (\"#\"*a).split(\"\")\n end\n\n screen\nend",
"def new_position(params)\n char_height = params[0]\n char_width = params[1]\n char_x = params[2]\n char_y = params[3]\n if @location == 8\n # top\n x = char_x - self.width/2\n y = char_y - char_height/2 - self.height - @tail.bitmap.height/2\n @tail.bitmap.rotation(0)\n tail_x = x + self.width/2 \n tail_y = y + self.height\n elsif @location == 2\n # bottom\n x = char_x - self.width/2\n y = char_y + char_height/2 + @tail.bitmap.height/2\n @tail.bitmap.rotation(180)\n tail_x = x + self.width/2\n tail_y = y\n elsif @location == 4\n # left\n x = char_x - char_width/2 - self.width - @tail.bitmap.width/2\n y = char_y - self.height/2\n @tail.bitmap.rotation(270)\n tail_x = x + self.width\n tail_y = y + self.height/2\n elsif @location == 6\n # right\n x = char_x + char_width/2 + @tail.bitmap.width/2\n y = char_y - self.height/2\n @tail.bitmap.rotation(90)\n tail_x = x\n tail_y = y + self.height/2\n end\n return [x,y,tail_x,tail_y]\n end",
"def split(position)\n result = Spline.new(dimension, geometric_resolution, order)\n do_split(result, position)\n result\n end",
"def position_coordinates(character)\n which_row = []\n which_cell = []\n (0...@n).each { |i| prepare_set(i, character, which_row, which_cell) }\n [which_row, which_cell]\n end",
"def group_positions_by_marker(line)\n markers = line.group_by {|position| @game.game.board[position]}\n markers.default = []\n markers\n end",
"def position(y, x)\n [START[0] + (y * SPACING[0]),\n START[1] + (x * SPACING[1])]\n end",
"def line_and_column(pos); end",
"def position\n [ChessBoard.col_index(pos[0]), pos[1].to_i]\n end",
"def position\n return [@x, @y, @heading]\n end",
"def new_coords(x,y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end",
"def split_msg(msg)\n sub_end = MAX_CHAR - 5\n # Goes back to start of word if matches inside a word. If it matches inside a coloured key go back to start of word before colour\n # Remove starting whitespace. Sometimes creates empty array indice so remove if length isn't long enough\n arr = msg.scan(/.{0,#{Regexp.escape(sub_end.to_s)}}[\\\\033\\[0-90-9m\\w\\\\e\\[0m\\ ]{0}(?:\\ |$)/mi).select { |s| s.length > 1 }.each { |n| n.slice!(0) if n[0] == \" \"}\n end",
"def position\n\t\t[ @x, @y ]\n\tend",
"def fork_positions\n board = @board.clone\n positions = []\n\n board.blanks.each do |blank_position|\n board.place_move(blank_position, @play_symbol)\n\n if win_positions(board).size >= 2\n positions << blank_position\n end\n\n board.undo_move(blank_position)\n end\n\n positions\n end",
"def calculate_position_coordinates(n, grid, character)\n which_row = []\n which_cell = []\n (0...n).each do |i|\n grid[i].split('').each_with_index do |k ,index|\n if k == character\n which_row << i\n which_cell << index\n end \n end\n end\n return which_row, which_cell\nend",
"def start_position\n position = ''\n welcome_message = 'Welcome! Enter starting position (ex. Place 0,0,North)'\n get_input_for(welcome_message) do |input|\n position = input\n input_position = position.match(/[a-zA-Z]{5} \\d,\\d,\\w*/).to_s.split(',')\n input_position.size == 3\n end\n position\n end",
"def clean_positions\n self.x_pos = self.x_pos.strip.to_i.to_s\n self.y_pos = self.y_pos.strip.to_i.to_s\n end",
"def new_coords(x, y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end",
"def convert_to_board_coordinates(position)\n alpha = ('a'..'h').to_a\n\n x_coordinate, y_coordinate = position.split('')\n\n [alpha.index(x_coordinate)+1, y_coordinate.to_i]\n end",
"def render_chat_tavolo(msg)\n @txtrender_tavolo_chat.text += msg\n # ugly autoscrolling... \n @txtrender_tavolo_chat.makePositionVisible(\n @txtrender_tavolo_chat.rowStart(@txtrender_tavolo_chat.getLength))\n \n \n end",
"def get_line_and_col_pos(pos)\n pos = self.size if pos > self.size\n pos = 0 if pos < 0\n\n lpos = get_line_pos(pos)\n\n lpos = @line_ends.size if lpos == nil\n cpos = pos\n cpos -= @line_ends[lpos - 1] + 1 if lpos > 0\n\n return [lpos, cpos]\n end",
"def pos\n [posx, posy]\n end",
"def split(the_string, position)\n results = [the_string[0, position], the_string[position, the_string.length()]]\nend",
"def index_line_and_col(index) \n\t\ti = 0\n\t\ti += 1 while index_of_position(i) <= index\n\t\ti -= 1\n\t\t[i, index - index_of_position(i)]\n\tend",
"def move_to(piece)\r\n cols = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']\r\n rows = [1, 2, 3, 4, 5, 6, 7, 8]\r\n counter = 0; x = ''; y = ''\r\n until counter == 1\r\n print \"Enter destination coordinates: \"\r\n coordinate = STDIN.gets.chomp\r\n x = coordinate[0]; y = coordinate[1].to_i\r\n counter+=1 if ((cols.include? x) && (rows.include? y))\r\n end\r\n puts ''\r\n puts \"#{piece.class} to #{x}#{y}.\"\r\n stop = []\r\n stop[0] = cols.index(x)\r\n stop[1] = rows.index(y)\r\n stop \r\n end",
"def coord2pos(x, y)\n (y % h)*w+(x % w)\n end",
"def get_coordinates(pos)\n row = (pos / @width) + 1\n col = (pos % @width) + 1\n [row, col]\n end",
"def decompose_position(position); end",
"def decompose_position(position); end",
"def decompose_position(position); end",
"def split\n [self[0,self.length/2], self[self.length/2,self.length]]\nend",
"def draw(canvas, max_x, max_y)\n render.each_line.with_index do |line, rowi|\n line.each_char.with_index do |char, coli|\n next if char == \"\\n\"\n pos = camera.cartesian2screen(self)\n\n off_x = -camera.x + camera.half_screen_width\n off_y = -camera.y + camera.half_screen_height\n\n # _x = coli + pos.x - camera.half_screen_width\n # _y = rowi + pos.y - camera.half_screen_height\n # _x = coli - (pos.x * width_offset) + width_offset\n # _y = rowi - (pos.y * height_offset) + height_offset\n # _x = coli + x - off_x # pos.x\n # _y = rowi - y + off_y # pos.y\n _x = (camera.screen.width - position.x * width) - width\n _y = (camera.screen.height - position.y * height) - height\n # _x = coli + x\n # _y = rowi + y\n\n _x = position.x*3 - (camera.screen.width/2)\n _y = (camera.screen.height/2) - position.y*3\n\n _x += width*2 + 1\n # _x += width_offset\n _y += height*2 - 1\n # _y += height_offset\n\n _x += coli\n _y += rowi\n\n canvas[_y][_x] = char if camera.can_view?(_x, _y, self)\n # canvas[_x][_y] = char\n # canvas[x][y] = char if camera.can_view?(x, y, self)\n end\n end\n end",
"def pieces_at(x, y)\n @board[x][y]\n end",
"def positioned_message msg\n result = [msg]\n result << \"in file #{file}\" if file\n result << \"at line #{line}:#{pos}\" if line\n result.join(\" \")\n end",
"def board\n # split_letters = @board_string.partition { |group| }\n # p split_letters\n # @empty_board.each { |row| puts row }\n @game_board.each_with_index {|row| p row}\n # end\n end",
"def splitrow(row,col)\n\t\ttext = @text[row].dup\n\t\t@text[row] = text[(col)..-1]\n\t\tinsertrow(row,text[0..(col-1)])\n\tend",
"def block_fork_positions\n board = @board.clone\n positions = []\n\n board.blanks.each do |blank_position|\n board.place_move(blank_position, @play_symbol)\n\n if block_positions(board).size >= 2\n positions << blank_position\n end\n\n board.undo_move(blank_position)\n end\n\n positions\n end",
"def split_send(content)\n send_multiple(Discordrb.split_message(content))\n nil\n end",
"def split_coords(placements)\n coords = []\n placements.map do |coord|\n split_up_coords = coord.split('')\n if split_up_coords.size == 3\n coords << split_up_coords[0]\n coords << split_up_coords[1..2].join\n elsif split_up_coords.size == 4\n coords << split_up_coords[0]\n coords << split_up_coords[1..3].join\n else\n coords << split_up_coords[0]\n coords << split_up_coords[1]\n end\n end\n end",
"def place position\n x,y = position\n\n leftmost = most(position, Left)\n rightmost= most(position, Right)\n topmost= most(position, Top)\n bottommost= most(position, Bottom)\n\n (leftmost[0]..rightmost[0]).each {|x| @horizontal.delete [x,y]}\n (topmost[1]..bottommost[1]).each {|y| @vertical.delete [x,y]}\n\n @horizontal[leftmost] = rightmost[0]\n @vertical[topmost] = bottommost[1] \n end",
"def place_robot(x,y,name)\n if (0..max_length).include?(x) && (0..max_height).include?(y)\n self.robot_position[name] = [x,y]\n end\n end",
"def coords(x, y)\n return [x % WIDTH, y % HEIGHT]\n end",
"def position\n [row.position, column.position]\n end",
"def split(aString, position)\n # split the string\n results = [aString[0, position], aString[position..aString.size]]\nend",
"def coordinate_list\n @board.each_index.inject([]) do |result,row_index|\n result.concat( \n @board[row_index].each_index.collect do |column_index|\n [row_index + 1, column_index + 1]\n end\n )\n end\n end",
"def convert_user_coord(input)\n input.split\n end",
"def parse\n start_x = 0\n start_y = 0\n\n @maze.each_with_index do |line, index|\n if line.include? 'S'\n start_y = line.index('S')\n start_x = index\n break\n end\n end\n [start_x, start_y]\n end",
"def match_pattern(pattern, x, y)\n coords = []\n players = pattern.map do |coordinates|\n new_x = x + coordinates[0]\n new_y = y + coordinates[1]\n coords << [new_x, new_y]\n index = index_from_coords(new_x, new_y)\n if index == -1\n nil\n else\n @board[index]\n end\n end\n [players, coords]\n end",
"def input_parse(input)\n list_coords = []\n height = 0\n xMin, xMax, yMin = [500, 0, 500]\n input.split(\"\\n\").each do |com_coords|\n if com_coords[0]=='x'\n x_raw, y_raw = com_coords.split(\",\")\n x = x_raw.delete(\"^0-9\").to_i\n xMin, xMax = [[xMin, x].min, [xMax, x].max]\n y_min, y_max = y_raw.delete(\" y=\").split('..').map{|i| i.to_i}\n height = [height, y_max].max\n (y_min..y_max).each do |y| \n list_coords.push({x: x, y: y})\n end\n else\n y_raw, x_raw = com_coords.split(\",\")\n y = y_raw.delete(\"^0-9\").to_i\n height = [height, y].max\n x_min, x_max = x_raw.delete(\" x=\").split('..').map{|i| i.to_i}\n xMin, xMax = [[xMin, x_min].min, [xMax, x_max].max]\n (x_min..x_max).each do |x| \n list_coords.push({x: x, y: y})\n end\n end\n end\n\n drawing = []\n height.times{|h| drawing.push(' '*((xMax - xMin)+3))}\n list_coords.each{|coords| drawing[coords[:y]-1][coords[:x] - xMin+1] = '#'} # draw clay\n drawing[0][500-xMin+1] = '|'\n drawing\nend",
"def parseChat\n messages = Array.new\n unless @fields.empty?\n @fields[0].each do |message|\n messages << ChatMessage.new(\n message[0],\n message[1],\n self.class.normalizeData(message[2]),\n message[3].to_i,\n message[4].to_i,\n message[5].to_i,\n message[6].to_i,\n )\n end\n end\n return messages.reverse\n end",
"def pos_to_coords(pos)\n x = (pos % size)\n y = size - 1 - (pos / size).to_i\n\n Point.new x, y\n end",
"def coords\n coord_list = []\n (@x..(@x + @size_x - 1)).each do |i|\n (@y..(@y + @size_y - 1)).each do |j|\n coord = [i, j]\n coord_list << coord\n end\n end\n\n return coord_list\n end",
"def coordinates(image)\n image.each_with_index.flat_map do |row,x|\n (0...row.length).find_all{|i| row[i] == @char }.map{|y| [x,y] }\n end\n end",
"def split_at(idx)\n [self[0...idx] || [], self[idx..-1] || []] \n end",
"def neighbors(point)\n x, y = @letters.index(point.chars.first), point[1, 2].to_i\n neighbors = []\n unless y == 1\n neighbors << @letters[x] + (y - 1).to_s\n end\n unless y == self.size.split('x')[0].to_i\n neighbors << @letters[x] + (y + 1).to_s\n end\n unless @letters[x] == @letters.first\n neighbors << @letters[x-1] + y.to_s\n end\n unless @letters[x] == @letters.last\n neighbors << @letters[x+1] + y.to_s\n end\n return neighbors\n end",
"def split_rows\n\t\t@board.values.each_slice(15).to_a\n\tend",
"def frame(text, char)\n\n longest_word_length = (text.map { |w| w.length }.max)\n frame_width = longest_word_length + 4\n\n frame_top_bottom = char*(frame_width)\n frame_arr = []\n\n #top of frame\n frame_arr.push(\"#{frame_top_bottom}\\n\")\n\n #middle of frame (content and the sides of the frame)\n text.each do |word|\n diff = longest_word_length - word.length\n spaces = ' '*diff\n frame_arr.push(\"#{char} #{word} #{spaces}#{char}\\n\")\n end\n\n #bottom of frame\n frame_arr.push(\"#{frame_top_bottom}\")\n frame_arr.join\nend",
"def convert_to_piece_position(coordinates)\n alpha = ('a'..'h').to_a\n\n row_index, column_index = coordinates\n\n alpha[row_index-1] + column_index.to_s\n end",
"def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end",
"def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end",
"def generate_children_coordinates(x,y)\n child_coordinates = []\n MOVEMENT_DIFF.each do |dx, dy|\n move = [x+dx, y+dy]\n child_coordinates << move if within_limits?(move)\n end\n child_coordinates\n end",
"def middle_points(north_west_corner,south_east_corner,split_point)\n\t\tn_y,n_x=north_west_corner.position\n\t\ts_y,s_x=south_east_corner.position\n\t\tsp_y,sp_x=split_point.position\t\n\n\t\tnorth_middle=Point.new(n_y,sp_x,'wall')\n\t\tsouth_middle=Point.new(s_y,sp_x,'wall')\n\t\twest_middle=Point.new(sp_y,n_x,'wall')\n\t\teast_middle=Point.new(sp_y,s_x,'wall')\n\t\treturn [north_west_corner,split_point,north_middle,east_middle,west_middle,south_middle,split_point,south_east_corner]\n\tend",
"def pos(x,y,t=\"\") sync_spawn(\"oled-exp\",@opt,\"cursor\",\"#{y+1},#{x+1}\",\"write\",t.to_s) end",
"def getCoords (index)\n return index%10, index/10\n end",
"def to_coordinates(x, y, size, orientation)\n coords = []\n\n if orientation == :across\n size.times do |n|\n coords << [x+n, y] \n end\n elsif orientation == :down\n size.times do |n|\n coords << [x, y+n]\n end\n end\n\n return coords\n end",
"def get_command_coords_and_direction(command_segments, index)\n if command_segments[index+1].include? \",\"\n \n # Get our x coord from the first param\n params = command_segments[index+1].split(\",\")\n\n if self.is_numeric? params[0]\n # Set our x coord from the first split element\n x_coord = params[0].to_i\n else\n # If no y coord was found, return an error\n puts \"Invalid X co-ordinate given to the PLACE command, skipping command...\"\n return false\n end\n \n\n # Check if the second paramater is numberic and if so use that as our y coord\n if !params[1].nil? \n # Strip comma\n y_coord = params[1].to_i \n elsif self.is_numeric? command_segments[index+2].tr!(\",\", \"\")\n # If we found the y coord in the next command segment use this\n y_coord = command_segments[index+2].to_i\n else\n # If no y coord was found, return an error\n puts \"Invalid Y co-ordinate given to the PLACE command, skipping command...\"\n return false\n end\n\n # Check if we have a direction to face as well\n if !params[2].nil?\n direction = params[2].tr(\" \", \"\")\n return {x: x_coord, y: y_coord, direction: direction}\n elsif command_segments[index+3] == \"NORTH\" || command_segments[index+3] == \"EAST\" || command_segments[index+3] == \"SOUTH\" || command_segments[index+3] == \"WEST\"\n direction = command_segments[index+3]\n return {x: x_coord, y: y_coord, direction: direction}\n else\n puts \"Invalid direction given to the PLACE command, skipping command\"\n return false\n end\n else\n puts \"Invalid PLACE command, skipping command...\"\n return false\n end\n end",
"def position \n\t\treturn @y,@x\n\tend",
"def stitching(x, y)\n\t\t# Return only what's already been generated (that is, what's above and to the left).\n\t\treturn [:normal, [\n\t\t\t([x - 1, y] if x > 0),\n\t\t\t([x - 1, y - 1] if x > 0 and y > 0),\n\t\t\t([x, y - 1] if y > 0),\n\t\t\t([x + 1, y - 1] if y > 0 and x < @field_width - 1)\n\t\t].compact]\n\tend",
"def set_positions(*args)\n x = y = 0\n (args.size / 3).times do |i|\n next unless (v = @followers[i])\n\n c = v.character\n x = args[i * 3]\n y = args[i * 3 + 1]\n c.moveto(x, y)\n c.direction = args[i * 3 + 2]\n c.update\n c.particle_push\n v.update\n end\n end",
"def create_starting_positions\n\t\t[Point.new(BOARD_WIDTH/4, BOARD_HEIGHT/4),\n \t\tPoint.new(3 * BOARD_WIDTH/4, 3 * BOARD_HEIGHT/4),\n\t\tPoint.new(3 * BOARD_WIDTH/4, BOARD_HEIGHT/4),\n\t\tPoint.new(BOARD_WIDTH/4, 3 * BOARD_HEIGHT/4)]\n\tend",
"def moves\n # All pieces can stay in place\n [[0,0]]\n end",
"def hint_idx_to_coord(i)\n j = i % SIZE\n\n if i >= 0 && i < SIZE\n # top\n r = (0..(SIZE-1)).to_a.map{ |a| {x: j, y: a} }\n elsif i >= SIZE && i < (SIZE * 2)\n r = (0..(SIZE-1)).to_a.reverse.map{ |a| {x: a, y: j} }\n elsif i >= (SIZE * 2) && i < (SIZE * 3)\n r = (0..(SIZE-1)).to_a.reverse.map{ |a| {x: (SIZE - 1) - j, y: a} }\n else\n r = (0..(SIZE-1)).to_a.map{ |a| {x: a, y: (SIZE - 1) - j} }\n end\n r\nend",
"def hint_idx_to_coord(i)\n j = i % SIZE\n\n if i >= 0 && i < SIZE\n # top\n r = (0..(SIZE-1)).to_a.map{ |a| {x: j, y: a} }\n elsif i >= SIZE && i < (SIZE * 2)\n r = (0..(SIZE-1)).to_a.reverse.map{ |a| {x: a, y: j} }\n elsif i >= (SIZE * 2) && i < (SIZE * 3)\n r = (0..(SIZE-1)).to_a.reverse.map{ |a| {x: (SIZE - 1) - j, y: a} }\n else\n r = (0..(SIZE-1)).to_a.map{ |a| {x: a, y: (SIZE - 1) - j} }\n end\n r\nend",
"def set_player_positions\n self.print_grid\n\n xy = self.ask_for_x_y do\n \"Player 1: Where would you like to place your flag?\"\n end\n\n @player1_x = xy[0]\n @player1_y = xy[1]\n \n xy = self.ask_for_x_y do\n \"Player 2: Where would you like to place your flag?\"\n end\n\n @player2_x = xy[0]\n @player2_y = xy[1]\n end",
"def neighbors(position)\n x,y = position\n [\n [x - 1, y + 1], [x , y + 1], [x + 1, y + 1],\n [x - 1, y ], [x + 1, y ],\n [x - 1, y - 1], [x , y - 1], [x + 1, y - 1],\n ]\nend",
"def pos\n\t\tif not moved_to.nil? and moved?\n\t\t\tsquare.neighbor( moved_to )\n\t\telse\n\t\t\tsquare\n\t\tend\n\tend",
"def place_marker(x, y)\n val = x.to_i - 1\n key = y\n row_arry = @grid_hash[key]\n if row_arry[val] == ' '\n if @@counter.odd?\n # player 1 #\n row_arry[val] = 'x'\n end_turn\n else\n # player 2 #\n row_arry[val] = 'o'\n end_turn\n end\n else\n p 'location taken'\n end\n end",
"def index_positions(message)\n cracker.character_map.each_with_index do |char, index|\n if char == message\n @indexes << index\n end\n end\n indexes\n end",
"def x_points\n points = [[], []]\n (0...height).each do |y|\n (0...width).each do |x|\n if (array[y][x]).nonzero? && (x - 1 < 0 || (array[y][x - 1]).zero?)\n points[0] << Point.new(x - 1, y) + @position\n end\n\n if (array[y][x]).nonzero? && (x + 1 >= length || (array[y][x + 1]).zero?)\n points[1] << Point.new(x + 1, y) + @position\n end\n end\n end\n\n points\n end",
"def horizontal_seperator y, x, x2\n [x, y, x2, y, 150, 150, 150]\n end",
"def map_position(position)\n coords = position.split(\"\")\n col, row = coords\n\n unless coords.length == 2 && ChessGame::LETTER_MAP[col] && row.to_i.between?(1,8)\n raise RuntimeError.new \"Invalid Input - Please use A-H and 1-8\"\n end\n\n [ChessGame::LETTER_MAP[col], (row.to_i)-1]\n end",
"def build_chat_log\n return \"\" unless @scrollback\n out = \"\"\n displayed_buffer = @buffer.length > 30 ? @buffer[@buffer.length-30..-1] : @buffer\n displayed_buffer.each do |msg|\n out += \"#{msg[0]}: #{msg[1]}\\n\"\n end\n return out\n end",
"def move\n @leading_x = coordinate_array[0]\n @leading_y = coordinate_array[1]\n end",
"def joker_split\n jokers_loci = self.find_jokers\n \n top_pos = jokers_loci.min\n \n cards_above = @deck.slice!(0,top_pos)\n \n jokers_loci = self.find_jokers\n bottom_pos = jokers_loci.max\n cards_below = @deck.slice!(bottom_pos+1,52) # 52 is max possible cards below last card\n \n @deck.insert(0, cards_below) if (cards_below)\n @deck.insert(-1, cards_above) if (cards_above)\n @deck.flatten! \n end",
"def draw_on(matrix)\n @position.each_with_index do |coords, i|\n coords.symbolize_keys!\n if i.zero?\n matrix.set(coords[:x], coords[:y], \"head-#{@snek.id}\")\n elsif i == (position.length - 1)\n matrix.set(coords[:x], coords[:y], \"tail-#{@snek.id}\")\n else\n matrix.set(coords[:x], coords[:y], \"body-#{@snek.id}\")\n end\n end\n end",
"def move_to(x, y); puts \"\\e[#{y};#{x}G\" end",
"def place_ship\n puts\"Your battle ship is 4 squares long.\\nPlease place it on your grid.\\nIt can not be placed diagonally.\\nCo-ordinates could be '2a 3a 4a 5a' \"\n @coordinates_string=gets.chomp\n marker=@coordinates_string.split(\" \")\n marker.each do |x|\n @grid[x]=\" + \"\n end\n end",
"def position_character(c,i)\n return if $game_variables[Yuki::Var::FM_Sel_Foll] > 0\n c1 = (i == 0 ? $game_player : @followers[i - 1].character)\n x = c1.x\n y = c1.y\n if $game_switches[Sw::Env_CanFly] || $game_switches[Sw::FM_NoReset]\n case c1.direction\n when 2\n y -= 1\n when 4\n x += 1\n when 6\n x -= 1\n else\n y += 1\n end\n end\n c.through = false\n if c.passable?(x, y, 0) # c1.direction)) #$game_map\n c.moveto(x, y)\n else\n c.moveto(c1.x, c1.y)\n end\n c.through = true\n c.direction = $game_player.direction\n c.update\n end",
"def position_changing(position , to)\n end",
"def generate_adj_pos (x, y)\n adj_pos = Array.new()\n top_y = position_translate(y) - 1\n bottom_y = top_y + 2\n left_x = position_translate(x) - 1\n right_x = left_x + 2\n new_x = position_translate(x)\n new_y = position_translate(y)\n if valid_edge(top_y, new_x)\n adj_pos.push([x , y - 1])\n end\n if valid_edge(bottom_y, new_x)\n adj_pos.push([x, y + 1])\n end\n if valid_edge(new_y, left_x)\n adj_pos.push([x - 1, y])\n end\n if valid_edge(new_y, right_x)\n adj_pos.push([x + 1, y])\n end\n return adj_pos\n end",
"def position\n [ @row_offset, @col_offset ]\n end",
"def on_text_node_cell_id_coords(attributes, buf, ctx)\n data_in = buf.strip.split(/[\\s=,]+/).map(&:to_i)\n data = []\n until data_in.empty?\n row, col, cell_id = data_in.shift(3)\n data << (row << 16) + col\n data << cell_id\n end\n @esf.put_u4_ary data\n end",
"def set_pieces\n @pieces.each do |piece|\n y , x = piece.location\n @rows[y][x] = piece\n end\n end",
"def get_move\n\t\tputs \"Enter where you would like to mark in the form (X, Y): \"\n\t\tmove = gets.chomp\n\t\tpositions = move.split(\", \")\n\t\t[positions[0].to_i, positions[1].to_i]\n\tend",
"def normalize_positions(pos_array)\n pos_array.map do |x, y|\n \"#{ChessBoard::COLUMN_CODES[x-1]}#{y}\"\n end\n end"
] | [
"0.6258403",
"0.6258403",
"0.6070784",
"0.58054936",
"0.5791814",
"0.5660853",
"0.560132",
"0.55725354",
"0.5551007",
"0.5542057",
"0.55148786",
"0.5495848",
"0.54716355",
"0.5466907",
"0.54618776",
"0.5441884",
"0.5380161",
"0.5374498",
"0.5364923",
"0.53582746",
"0.53505737",
"0.5344683",
"0.53385043",
"0.53125626",
"0.52938104",
"0.52740157",
"0.5224615",
"0.520007",
"0.5189643",
"0.5174923",
"0.51451063",
"0.5140721",
"0.51329714",
"0.5117433",
"0.5117433",
"0.5117433",
"0.5105687",
"0.50977826",
"0.5082662",
"0.50708115",
"0.5067151",
"0.50636",
"0.5063",
"0.5059904",
"0.5056857",
"0.5051116",
"0.5050266",
"0.5048692",
"0.50367826",
"0.5033863",
"0.5031218",
"0.5030233",
"0.502845",
"0.5026251",
"0.50206876",
"0.5015016",
"0.5012057",
"0.50051796",
"0.49995148",
"0.49978355",
"0.4995817",
"0.49911457",
"0.49847692",
"0.49809393",
"0.49761295",
"0.49761295",
"0.49740744",
"0.49726146",
"0.49638093",
"0.4963656",
"0.49561894",
"0.49426374",
"0.49383146",
"0.49351412",
"0.49262398",
"0.49053386",
"0.49005404",
"0.48930782",
"0.48930782",
"0.48898783",
"0.48875472",
"0.48844633",
"0.4884082",
"0.48825762",
"0.48736653",
"0.48681575",
"0.4863837",
"0.48619053",
"0.48601124",
"0.48562384",
"0.4852397",
"0.48497924",
"0.48449",
"0.48393348",
"0.48192638",
"0.4814954",
"0.48147583",
"0.48126107",
"0.4808305",
"0.48065302",
"0.48046082"
] | 0.0 | -1 |
Instantiates a new unifiedRoleManagementPolicyExpirationRule and sets the default values. | def initialize()
super
@odata_type = "#microsoft.graph.unifiedRoleManagementPolicyExpirationRule"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(opts = {})\n @expiration = opts[:expiration]\n end",
"def expiration\n @expiration ||= 60 * 60 * 24 * 30 # 30 days\n end",
"def add_default_expiration(vm, exps)\n return exps if vm.default_expiration\n exps << Berta::Entities::Expiration.new(vm.next_expiration_id,\n Time.now.to_i + Berta::Settings.expiration_offset,\n Berta::Settings.expiration.action)\n end",
"def default_expiration\n expirations\n .find_all { |exp| exp.default_action? && exp.in_expiration_interval? }\n .min { |exp| exp.time.to_i }\n end",
"def default_expiration\n expirations\n .find_all { |exp| exp.default_action? && exp.in_expiration_interval? }\n .min { |exp| exp.time.to_i }\n end",
"def expiration(env = nil)\n DEFAULT_EXPIRATION\n end",
"def expiration(_env = nil)\n DEFAULT_EXPIRATION\n end",
"def initialize(object, ttl = nil)\n ttl = TTL_ONE_HOUR if ttl.nil?\n @object = object\n @expiry_time = Time.now + ttl\n end",
"def expiry\n @expiry ||= 60 * 10\n end",
"def expiry\n @expiry ||= 60 * 10\n end",
"def refresh_rates_expiration!\n @rates_expiration = Time.now + ttl_in_seconds\n end",
"def refresh_rates_expiration!\n @rates_expiration = Time.now + ttl_in_seconds\n end",
"def refresh_rates_expiration!\n @rates_expiration = Time.now + ttl_in_seconds\n end",
"def refresh_rates_expiration!\n @rates_expiration = Time.now + ttl_in_seconds\n end",
"def password_expiration_set(handle:,\n password_expiry_duration:,\n password_history: 0,\n password_notification_period: 15,\n password_grace_period: 0)\n\n mo = AaaUserPasswordExpiration.new(parent_mo_or_dn: \"sys/user-ext\")\n args = {\n :password_expiry_duration => password_expiry_duration.to_s,\n :password_history => password_history.to_s,\n :password_notification_period => password_notification_period.to_s,\n :password_grace_period => password_grace_period.to_s\n }\n mo.set_prop_multiple(**args)\n handle.set_mo(mo: mo)\n return handle.query_dn(dn: mo.dn)\nend",
"def refresh_rates_expiration!\n @rates_expiration = Time.now + ttl_in_seconds\n end",
"def refresh_rates_expiration\n @rates_expiration = rates_timestamp + ttl_in_seconds\n end",
"def initialize\n self.min_idle = 0\n self.max_idle = 8\n self.max_idle_time = 30 * 60\n self.max_active = 8\n self.idle_check_no_per_run = 3\n self.idle_check_interval= 0\n self.timeout = 60\n self.validation_timeout = 30\n end",
"def initialize(issuer, audience, user_uid, opts = {})\n self.issuer = issuer\n self.audience = audience\n self.user_uid = user_uid\n\n self.expiration = if (exp = opts[:exp])\n exp\n elsif (ttl_sec = opts[:ttl])\n Time.now + ttl_sec\n end\n\n @permissions = []\n @claims = {}\n end",
"def expiration=(value)\n @expiration = value\n end",
"def expiration=(expiration_date)\n unless self.new_record?\n logger.warn(\"Attempted to set expiration on existing record: access_token id=#{self.id}. Update ignored\")\n return\n end\n super(expiration_date)\n\n self.expired = expiration_date.nil? || (expiration_date == '') || expiration_date.past?\n end",
"def expire=(_); end",
"def default_ttl=(interval)\n @default_ttl = Core::Utils::Interval.try_convert(interval)\n end",
"def default_expiration= new_default_expiration\n patch_gapi! default_expiration: new_default_expiration\n end",
"def default_expires\n @default_expires ||= 3600\n end",
"def create_expirations(params = nil)\n\t\tself.class.expirations.each_with_index do |sym, index|\n\t\t\tklass = self.namespaced_class(sym)\n\t\t\texpiration = klass.new \n\t\t\texpiration.offset = params.nil? ? klass::DEFAULT_OFFSET : params[:offset]\n\t\t\texpiration.offset_units = params.nil? \\\n\t\t\t\t? klass::DEFAULT_OFFSET_UNITS : params[:offset_units]\n\t\t\texpiration.tranzaction = self\n\t\t\texpiration.save!\n\t\tend\n\tend",
"def expiry= new_expiry\n @expiry = new_expiry ? new_expiry.to_i : nil\n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n end",
"def set_policy_override_expiration(id, opts = {})\n data, _status_code, _headers = set_policy_override_expiration_with_http_info(id, opts)\n data\n end",
"def assign_default_role\n self.add_role(:newuser) if self.roles.blank?\n end",
"def assign_default_role\n self.add_role(:newuser) if self.roles.blank?\n end",
"def set_expiration_date\n self.expiry_date = Date.today + 365.days\n end",
"def default_expire; @@default_expire; end",
"def expiry_days\n @expiry_days || DEFAULT_EXPIRY_DAYS\n end",
"def expires_after\n @expires_after ||=\n if Flipper.enabled?(:in_progress_form_custom_expiration)\n custom_expires_after\n else\n default_expires_after\n end\n end",
"def initialize(key, expiration_time = 10.minutes)\n @key = key\n @expiration_time = expiration_time\n end",
"def initialize\n EM.add_periodic_timer(5) {\n check_expired_resources\n }\n check_expired_resources\n end",
"def default_expire=(value)\n raise ArgumentError, \"#{name}.default_expire value must be greater than 0\" unless (value = value.to_f) > 0\n @@default_expire = value\n end",
"def set_cookie_expiration(opts)\n opts = check_params(opts,[:expirations])\n super(opts)\n end",
"def cache_expiration_policy_object\n @low_card_model.low_card_cache_expiration_policy_object || LowCardTables.low_card_cache_expiration_policy_object\n end",
"def initialize(config_yml=\"\")\n yml = YAML.load config_yml rescue nil\n @config = yml || {}\n @default_ttl = @config[\"default_ttl\"] ? convert_time(@config[\"default_ttl\"]) : 60\n @config.delete \"default_ttl\"\n setup_action_caching\n end",
"def expiration_behavior=(value)\n @expiration_behavior = value\n end",
"def verify_expiration=(_arg0); end",
"def verify_expiration=(_arg0); end",
"def default_expires=(value)\n @default_expires = value\n end",
"def exec_before_validation\n if self.duree || self.duration\n self.expire_at = Time.current + (self.duree || self.duration)\n end\n end",
"def update!(**args)\n @max_supported_alarms = args[:max_supported_alarms] if args.key?(:max_supported_alarms)\n @max_supported_extended_timer_duration = args[:max_supported_extended_timer_duration] if args.key?(:max_supported_extended_timer_duration)\n @max_supported_timer_duration = args[:max_supported_timer_duration] if args.key?(:max_supported_timer_duration)\n @max_supported_timers = args[:max_supported_timers] if args.key?(:max_supported_timers)\n @preferred_stopwatch_provider = args[:preferred_stopwatch_provider] if args.key?(:preferred_stopwatch_provider)\n @restrict_alarms_to_next24h = args[:restrict_alarms_to_next24h] if args.key?(:restrict_alarms_to_next24h)\n end",
"def set_default_values\n self.base_exp ||= 0\n self.time_bonus_exp ||= 0\n self.extra_bonus_exp ||= 0\n end",
"def set_creation_defaults\n if self.max_days == 0\n self.max_days = nil\n self.end_date = nil\n else\n self.end_date = self.start_date + self.max_days\n end\n self.percent = 0\n end",
"def default_values \n self.credited_date = Time.now\n self.leave_period_id = 0 if self.leave_period_id.nil?\n end",
"def parse_expires\n expires = get_element('//t:RequestSecurityTokenResponse/t:Lifetime/wsu:Expires')\n @validation_errors << \"Expiration field is empty.\" and return if expires.nil?\n @validation_errors << \"Invalid format for expiration field.\" and return unless /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])T(2[0-3]|[0-1][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$/.match(expires)\n @validation_errors << \"Expiration date occurs in the past.\" unless Time.now.utc.iso8601 < Time.iso8601(expires).iso8601\n end",
"def set_defaults\n self.min_service_life_months ||= 0\n self.replacement_cost ||= 0\n self.lease_length_months ||= 0\n self.rehabilitation_service_month ||= 0\n self.rehabilitation_labor_cost ||= 0\n self.rehabilitation_parts_cost ||= 0\n self.extended_service_life_months ||= 0\n self.min_used_purchase_service_life_months ||= 0\n self.cost_fy_year ||= current_planning_year_year\n end",
"def init\n self.role ||= \"standard\" #will set the default value only if it's nil\n end",
"def next_expiration\n Berta::Entities::Expiration.new(next_expiration_id,\n Time.now.to_i + Berta::Settings.expiration_offset,\n Berta::Settings.expiration.action)\n end",
"def has_default_expiration?\n expiredate < Time.now+60*60+60 # The last 60seconds are for safety\n end",
"def setup_expiration\n self.expires_at = Time.now.utc + ::Simple::OAuth2.config.authorization_code_lifetime if expires_at.nil?\n end",
"def initialize(keys, expires_in)\n @value = keys\n @expires_in = expires_in\n @expires_at = Time.now.utc.to_i + @expires_in\n end",
"def new_expiration_score\n now + 3600\n end",
"def set_default\n self.state ||= :active\n self.validity_days ||= 14\n end",
"def set_default_role\n self.role ||= :standard\n end",
"def initialize(remaining_exp, tick_exp)\n @remaining_exp = remaining_exp\n @tick_exp = tick_exp\n end",
"def initialize(remaining_exp, tick_exp)\n @remaining_exp = remaining_exp\n @tick_exp = tick_exp\n end",
"def patrol_scrub_duration=(patrol_scrub_duration)\n pattern = Regexp.new(/^([5-9]|1\\d|2[0-3])$|^(platform-default)$/)\n if !patrol_scrub_duration.nil? && patrol_scrub_duration !~ pattern\n fail ArgumentError, \"invalid value for \\\"patrol_scrub_duration\\\", must conform to the pattern #{pattern}.\"\n end\n\n @patrol_scrub_duration = patrol_scrub_duration\n end",
"def expire_rates\n return unless ttl_in_seconds\n return if rates_expiration > Time.now\n\n refresh_rates if force_refresh_rate_on_expire\n update_rates\n refresh_rates_expiration\n end",
"def expiration_date\n unless self['expiration_date']\n month_days = [nil,31,28,31,30,31,30,31,31,30,31,30,31]\n begin \n month_days[2] = 29 if Date.leap?(@year)\n self['expiration_date'] = Time.parse(\"#{@month}/#{month_days[@month]}/#{@year} 23:59:59\")\n rescue\n end\n end \n self['expiration_date']\n end",
"def expiration_behavior\n return @expiration_behavior\n end",
"def schedule_recurring_jobs\n EmbargoAutoExpiryJob.perform_later(account)\n LeaseAutoExpiryJob.perform_later(account)\n end",
"def default_ttl\n Core::Utils::Interval.try_convert(@default_ttl)\n end",
"def initialize(details, quantity = nil)\n @quantity = quantity || details.max_quantity\n @item_id = details.item_id\n @item_type = details.item_type\n @sale_value = 0\n @sell_locked = details.sell_locked || false\n @replenishment_rate = details.repl_rate\n @rpg_article = details\n end",
"def create_or_renew_token()\n calculate_expiry_time()\n end",
"def default_params\n { session_validity: 10.minutes.from_now,\n recurring: false }\n end",
"def assign_default_role\n puts \"CREANDO USAURIO\"\n add_role(:customer) if roles.blank?\n unless self.phone.blank?\n CreateStripeCustomerJob.perform_later(self)\n puts \"ENVIANDO 2\"\n self.create_and_send_verification_code\n end\n end",
"def initialize(vals: nil, dimensions: nil, learning_rate: ,termination_type: , epoch_count: nil, termination_criteria: nil)\n @termination_type = termination_type\n if vals\n if @vals.is_a?(Matrix)\n @vals = vals\n else\n @vals = twod?(vals) ? Matrix[*vals] : Matrix[vals]\n end\n else\n @vals = self.class.random_matrix(dimensions, 0..10)\n end\n @learning_rate = learning_rate\n @epoch_count, @termination_criteria = epoch_count, termination_criteria\n end",
"def assign_default_role\n if self.roles.blank?\n self.add_role :Cursist\n end\n end",
"def default_expiration\n ensure_full_data!\n @gapi[\"defaultTableExpirationMs\"]\n end",
"def initialize(date)\n @expiration_date = date.strftime('%Y-%m-%dT00:00:00Z')\n end",
"def initialize(default_options={}, use_defaults=false)\n if default_options.keys.include? :exponential_retry\n @_exponential_retry = ExponentialRetryOptions.new(default_options[:exponential_retry])\n end\n super(default_options, use_defaults)\n end",
"def add_default_role \n\t\tempty_role_id = self.company.roles.find_by_designation(\"none\").id\n\t\tif self.employees.any? \n\t\t\tself.employees.each do |x| \n\t\t\t\tx.skip_password_validation = true\n\t\t\t\tx.update(role_id: empty_role_id)\n\t\t\tend\n\t\tend\n\tend",
"def set_default_role\n self.roles = [Role.find_by_name('user')]\n end",
"def initialize(rules = [])\n @rules = rules\n end",
"def cookie_expiration\n super\n end",
"def terms_expiration=(value)\n @terms_expiration = value\n end",
"def set_default_role\n update_attribute :roles, [UserRoles::CUSTOMER] if roles.empty?\n end",
"def initialize(redis, online_expiration_time=180)\n @online_expiration_time = 180\n @redis = redis\n # uses floating point division + ceiling to round up\n @slice_size = (online_expiration_time.to_f / SLICE_COUNT).ceil\n @active_bucket_count = (@online_expiration_time.to_f / @slice_size).ceil\n end",
"def default_ttl=(seconds)\n @default_ttl = seconds\n end",
"def build_expiry(t_expiry)\n self.expiry = \"#{t_expiry.strftime('%Y-%m-%dT%H:%M:%S+08:00')}\"\n end",
"def expires_at\n parse_date( super )\n rescue ArgumentError\n nil\n end",
"def set_default_role!\n clear!\n end",
"def set_default_role!\n clear!\n end",
"def set_default_role!\n clear!\n end",
"def expires_in= new_expires_in\n if !new_expires_in.nil?\n @issued_at = Time.now\n @expires_at = @issued_at + new_expires_in.to_i\n else\n @expires_at = nil\n @issued_at = nil\n end\n end",
"def create_default_roles\n if self.root?\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Campus Coordinator', _(:position, :ministry_role) => 2)\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Ministry Leader', _(:position, :ministry_role) => 4, :description => 'a student who oversees a campus, eg LINC leader')\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Missionary', _(:position, :ministry_role) => 3)\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Student Leader', _(:position, :ministry_role) => 5)\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Involved Student', _(:position, :ministry_role) => 6, :description => 'we are saying has been attending events for at least 6 months')\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Student', _(:position, :ministry_role) => 7)\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Registration Incomplete', _(:position, :ministry_role) => 8, :description => 'A leader has registered them, but user has not completed rego and signed the privacy policy')\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Approval Pending', _(:position, :ministry_role) => 9, :description => 'They have applied, but a leader has not verified their application yet')\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Honourary Member', _(:position, :ministry_role) => 10, :description => 'not a valid student or missionary, but we are giving them limited access anyway')\n self.ministry_roles << ::MinistryRole.create(_(:name, :ministry_role) => 'Admin', _(:position, :ministry_role) => 1)\n end\n true # otherwise subsequent after_create calls will fail\n end",
"def assign_default_role\n if User.count != 1\n add_role(:editor) if roles.blank?\n else\n add_role(:admin) if roles.blank?\n end\n end",
"def defaults!\n self.max_retries = 5\n self.retry_delay = 10\n end",
"def defaults!\n self.max_retries = 5\n self.retry_delay = 10\n end",
"def initialize(principal, *rates, &block)\n @principal = principal.to_d\n @rates = rates\n @block = block\n \n # compute the total duration from all of the rates.\n @periods = (rates.collect { |r| r.duration }).sum\n @period = 0\n\n compute\n end",
"def initialize (max_count=10, interval_seconds=120)\n raise ArgumentError, 'max_retries must be a valid integer' unless max_count.is_a?(Fixnum)\n raise ArgumentError, 'interval_seconds must be a valid integer' unless interval_seconds.is_a?(Fixnum)\n\n @count = 0\n @running_time = 0\n @max_count = max_count\n @interval_seconds = interval_seconds\n end",
"def create_default_roles\n # Create the default Rolesets\n Jak.rolesets.each do |role_set|\n my_role = roles.find_or_create_by(name: role_set.role_name, key: role_set.role_name.parameterize, company: self)\n my_role.permission_ids = role_set.permission_ids\n my_role.save!\n end\n end",
"def initialize(schedule)\n @result, @min, @hour, @day, @month, @wday = *schedule.match(CRON_REGEXP)\n validate\n end"
] | [
"0.5098749",
"0.5029767",
"0.49990115",
"0.49698284",
"0.49698284",
"0.48873985",
"0.48079443",
"0.47304365",
"0.47269452",
"0.47269452",
"0.47164595",
"0.47164595",
"0.47164595",
"0.47164595",
"0.46641845",
"0.46608317",
"0.46554548",
"0.46535292",
"0.46407995",
"0.4617505",
"0.4609223",
"0.45849013",
"0.45729068",
"0.45529923",
"0.45495218",
"0.4525461",
"0.4509894",
"0.44921887",
"0.44921887",
"0.44730246",
"0.44683796",
"0.44683796",
"0.444465",
"0.444464",
"0.44395077",
"0.4408748",
"0.44078577",
"0.43973944",
"0.43920106",
"0.436879",
"0.43652385",
"0.43534786",
"0.43325263",
"0.4323996",
"0.4323996",
"0.43182957",
"0.43170694",
"0.43160847",
"0.42816463",
"0.42665493",
"0.4257287",
"0.42443323",
"0.42288575",
"0.42255944",
"0.42178997",
"0.42167377",
"0.42162234",
"0.42145526",
"0.4203132",
"0.41917643",
"0.4189104",
"0.41881624",
"0.41881624",
"0.41843212",
"0.41821787",
"0.41817188",
"0.41739327",
"0.41666985",
"0.41613328",
"0.41541004",
"0.4151535",
"0.41491634",
"0.414794",
"0.4140221",
"0.41400546",
"0.4129008",
"0.4119925",
"0.4113396",
"0.4102711",
"0.41015977",
"0.40860978",
"0.4076375",
"0.40736002",
"0.407318",
"0.4072964",
"0.4071121",
"0.40594682",
"0.40422592",
"0.40401638",
"0.40401638",
"0.40401638",
"0.4039312",
"0.40392235",
"0.40362343",
"0.40337002",
"0.40337002",
"0.4032328",
"0.4027315",
"0.40271756",
"0.4025073"
] | 0.7127701 | 0 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"isExpirationRequired" => lambda {|n| @is_expiration_required = n.get_boolean_value() },
"maximumDuration" => lambda {|n| @maximum_duration = n.get_duration_value() },
})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"fileDetails\" => lambda {|n| @file_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n })\n end",
"def serialized_attributes\n read_inheritable_attribute(\"attr_serialized\") || { }\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"attribution\" => lambda {|n| @attribution = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImageInfo.create_from_discriminator_value(pn) }) },\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayText\" => lambda {|n| @display_text = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"detectionType\" => lambda {|n| @detection_type = n.get_string_value() },\n \"method\" => lambda {|n| @method = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resourceReference\" => lambda {|n| @resource_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceReference.create_from_discriminator_value(pn) }) },\n \"resourceVisualization\" => lambda {|n| @resource_visualization = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceVisualization.create_from_discriminator_value(pn) }) },\n \"weight\" => lambda {|n| @weight = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"maxImageSize\" => lambda {|n| @max_image_size = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"timeout\" => lambda {|n| @timeout = n.get_duration_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"applicationVersion\" => lambda {|n| @application_version = n.get_string_value() },\n \"headerValue\" => lambda {|n| @header_value = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"callEndSubReason\" => lambda {|n| @call_end_sub_reason = n.get_number_value() },\n \"callType\" => lambda {|n| @call_type = n.get_string_value() },\n \"calleeNumber\" => lambda {|n| @callee_number = n.get_string_value() },\n \"callerNumber\" => lambda {|n| @caller_number = n.get_string_value() },\n \"correlationId\" => lambda {|n| @correlation_id = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_number_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"failureDateTime\" => lambda {|n| @failure_date_time = n.get_date_time_value() },\n \"finalSipCode\" => lambda {|n| @final_sip_code = n.get_number_value() },\n \"finalSipCodePhrase\" => lambda {|n| @final_sip_code_phrase = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"inviteDateTime\" => lambda {|n| @invite_date_time = n.get_date_time_value() },\n \"mediaBypassEnabled\" => lambda {|n| @media_bypass_enabled = n.get_boolean_value() },\n \"mediaPathLocation\" => lambda {|n| @media_path_location = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"signalingLocation\" => lambda {|n| @signaling_location = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"successfulCall\" => lambda {|n| @successful_call = n.get_boolean_value() },\n \"trunkFullyQualifiedDomainName\" => lambda {|n| @trunk_fully_qualified_domain_name = n.get_string_value() },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"versionId\" => lambda {|n| @version_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"buildNumber\" => lambda {|n| @build_number = n.get_string_value() },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"versionNumber\" => lambda {|n| @version_number = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroups\" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroupsUrl\" => lambda {|n| @section_groups_url = n.get_string_value() },\n \"sections\" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"sectionsUrl\" => lambda {|n| @sections_url = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"imageFile\" => lambda {|n| @image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n \"parentProcessCreationDateTime\" => lambda {|n| @parent_process_creation_date_time = n.get_date_time_value() },\n \"parentProcessId\" => lambda {|n| @parent_process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"parentProcessImageFile\" => lambda {|n| @parent_process_image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"processCommandLine\" => lambda {|n| @process_command_line = n.get_string_value() },\n \"processCreationDateTime\" => lambda {|n| @process_creation_date_time = n.get_date_time_value() },\n \"processId\" => lambda {|n| @process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"userAccount\" => lambda {|n| @user_account = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityUserAccount.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::OperationStatus) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"progress\" => lambda {|n| @progress = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DataPolicyOperationStatus) },\n \"storageLocation\" => lambda {|n| @storage_location = n.get_string_value() },\n \"submittedDateTime\" => lambda {|n| @submitted_date_time = n.get_date_time_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"completedUnits\" => lambda {|n| @completed_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"progressObservationDateTime\" => lambda {|n| @progress_observation_date_time = n.get_date_time_value() },\n \"totalUnits\" => lambda {|n| @total_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"units\" => lambda {|n| @units = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"provisioningStepType\" => lambda {|n| @provisioning_step_type = n.get_enum_value(MicrosoftGraph::Models::ProvisioningStepType) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ProvisioningResult) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"downloadUri\" => lambda {|n| @download_uri = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fulfilledDateTime\" => lambda {|n| @fulfilled_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodEndDateTime\" => lambda {|n| @review_history_period_end_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodStartDateTime\" => lambda {|n| @review_history_period_start_date_time = n.get_date_time_value() },\n \"runDateTime\" => lambda {|n| @run_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::AccessReviewHistoryStatus) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"check32BitOn64System\" => lambda {|n| @check32_bit_on64_system = n.get_boolean_value() },\n \"comparisonValue\" => lambda {|n| @comparison_value = n.get_string_value() },\n \"fileOrFolderName\" => lambda {|n| @file_or_folder_name = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppFileSystemOperationType) },\n \"operator\" => lambda {|n| @operator = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppRuleOperator) },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n })\n end",
"def read_object\n if @version == 0\n return amf0_deserialize\n else\n return amf3_deserialize\n end\n end",
"def get_field_deserializers()\n return {\n \"destinationFileName\" => lambda {|n| @destination_file_name = n.get_string_value() },\n \"sourceFile\" => lambda {|n| @source_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"newText\" => lambda {|n| @new_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"numBytes\" => lambda {|n| @num_bytes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"oldText\" => lambda {|n| @old_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"startNum\" => lambda {|n| @start_num = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"audioDeviceName\" => lambda {|n| @audio_device_name = n.get_string_value() },\n \"bookingType\" => lambda {|n| @booking_type = n.get_enum_value(MicrosoftGraph::Models::BookingType) },\n \"building\" => lambda {|n| @building = n.get_string_value() },\n \"capacity\" => lambda {|n| @capacity = n.get_number_value() },\n \"displayDeviceName\" => lambda {|n| @display_device_name = n.get_string_value() },\n \"emailAddress\" => lambda {|n| @email_address = n.get_string_value() },\n \"floorLabel\" => lambda {|n| @floor_label = n.get_string_value() },\n \"floorNumber\" => lambda {|n| @floor_number = n.get_number_value() },\n \"isWheelChairAccessible\" => lambda {|n| @is_wheel_chair_accessible = n.get_boolean_value() },\n \"label\" => lambda {|n| @label = n.get_string_value() },\n \"nickname\" => lambda {|n| @nickname = n.get_string_value() },\n \"tags\" => lambda {|n| @tags = n.get_collection_of_primitive_values(String) },\n \"videoDeviceName\" => lambda {|n| @video_device_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"targetType\" => lambda {|n| @target_type = n.get_enum_value(MicrosoftGraph::Models::FeatureTargetType) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"platform\" => lambda {|n| @platform = n.get_enum_value(MicrosoftGraph::Models::DetectedAppPlatformType) },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"sizeInByte\" => lambda {|n| @size_in_byte = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"activationUrl\" => lambda {|n| @activation_url = n.get_string_value() },\n \"activitySourceHost\" => lambda {|n| @activity_source_host = n.get_string_value() },\n \"appActivityId\" => lambda {|n| @app_activity_id = n.get_string_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"contentInfo\" => lambda {|n| @content_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fallbackUrl\" => lambda {|n| @fallback_url = n.get_string_value() },\n \"historyItems\" => lambda {|n| @history_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ActivityHistoryItem.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::Status) },\n \"userTimezone\" => lambda {|n| @user_timezone = n.get_string_value() },\n \"visualElements\" => lambda {|n| @visual_elements = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::VisualInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"category\" => lambda {|n| @category = n.get_string_value() },\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"malwareIdentifier\" => lambda {|n| @malware_identifier = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"lastActionDateTime\" => lambda {|n| @last_action_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operation\" => lambda {|n| @operation = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"identityType\" => lambda {|n| @identity_type = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"dataLocationCode\" => lambda {|n| @data_location_code = n.get_string_value() },\n \"hostname\" => lambda {|n| @hostname = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Root.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"address\" => lambda {|n| @address = n.get_string_value() },\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"relevanceScore\" => lambda {|n| @relevance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"selectionLikelihood\" => lambda {|n| @selection_likelihood = n.get_enum_value(MicrosoftGraph::Models::SelectionLikelihoodInfo) },\n }\n end",
"def get_field_deserializers()\n return {\n \"hashes\" => lambda {|n| @hashes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Hashes.create_from_discriminator_value(pn) }) },\n \"mimeType\" => lambda {|n| @mime_type = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"processingMetadata\" => lambda {|n| @processing_metadata = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"configurationVersion\" => lambda {|n| @configuration_version = n.get_number_value() },\n \"errorCount\" => lambda {|n| @error_count = n.get_number_value() },\n \"failedCount\" => lambda {|n| @failed_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"notApplicableCount\" => lambda {|n| @not_applicable_count = n.get_number_value() },\n \"pendingCount\" => lambda {|n| @pending_count = n.get_number_value() },\n \"successCount\" => lambda {|n| @success_count = n.get_number_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"format\" => lambda {|n| @format = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookChartDataLabelFormat.create_from_discriminator_value(pn) }) },\n \"position\" => lambda {|n| @position = n.get_string_value() },\n \"separator\" => lambda {|n| @separator = n.get_string_value() },\n \"showBubbleSize\" => lambda {|n| @show_bubble_size = n.get_boolean_value() },\n \"showCategoryName\" => lambda {|n| @show_category_name = n.get_boolean_value() },\n \"showLegendKey\" => lambda {|n| @show_legend_key = n.get_boolean_value() },\n \"showPercentage\" => lambda {|n| @show_percentage = n.get_boolean_value() },\n \"showSeriesName\" => lambda {|n| @show_series_name = n.get_boolean_value() },\n \"showValue\" => lambda {|n| @show_value = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"errorDetails\" => lambda {|n| @error_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::GenericError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceId\" => lambda {|n| @source_id = n.get_string_value() },\n \"targetId\" => lambda {|n| @target_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"contentSource\" => lambda {|n| @content_source = n.get_string_value() },\n \"hitId\" => lambda {|n| @hit_id = n.get_string_value() },\n \"isCollapsed\" => lambda {|n| @is_collapsed = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"rank\" => lambda {|n| @rank = n.get_number_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resultTemplateId\" => lambda {|n| @result_template_id = n.get_string_value() },\n \"summary\" => lambda {|n| @summary = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedUserPrincipalName\" => lambda {|n| @assigned_user_principal_name = n.get_string_value() },\n \"groupTag\" => lambda {|n| @group_tag = n.get_string_value() },\n \"hardwareIdentifier\" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"importId\" => lambda {|n| @import_id = n.get_string_value() },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"serialNumber\" => lambda {|n| @serial_number = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"audioRoutingGroups\" => lambda {|n| @audio_routing_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AudioRoutingGroup.create_from_discriminator_value(pn) }) },\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_string_value() },\n \"callOptions\" => lambda {|n| @call_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallOptions.create_from_discriminator_value(pn) }) },\n \"callRoutes\" => lambda {|n| @call_routes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRoute.create_from_discriminator_value(pn) }) },\n \"callbackUri\" => lambda {|n| @callback_uri = n.get_string_value() },\n \"chatInfo\" => lambda {|n| @chat_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatInfo.create_from_discriminator_value(pn) }) },\n \"contentSharingSessions\" => lambda {|n| @content_sharing_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ContentSharingSession.create_from_discriminator_value(pn) }) },\n \"direction\" => lambda {|n| @direction = n.get_enum_value(MicrosoftGraph::Models::CallDirection) },\n \"incomingContext\" => lambda {|n| @incoming_context = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IncomingContext.create_from_discriminator_value(pn) }) },\n \"mediaConfig\" => lambda {|n| @media_config = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaConfig.create_from_discriminator_value(pn) }) },\n \"mediaState\" => lambda {|n| @media_state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallMediaState.create_from_discriminator_value(pn) }) },\n \"meetingInfo\" => lambda {|n| @meeting_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MeetingInfo.create_from_discriminator_value(pn) }) },\n \"myParticipantId\" => lambda {|n| @my_participant_id = n.get_string_value() },\n \"operations\" => lambda {|n| @operations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CommsOperation.create_from_discriminator_value(pn) }) },\n \"participants\" => lambda {|n| @participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Participant.create_from_discriminator_value(pn) }) },\n \"requestedModalities\" => lambda {|n| @requested_modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Modality.create_from_discriminator_value(pn) }) },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"source\" => lambda {|n| @source = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ParticipantInfo.create_from_discriminator_value(pn) }) },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::CallState) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"targets\" => lambda {|n| @targets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InvitationParticipantInfo.create_from_discriminator_value(pn) }) },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n \"toneInfo\" => lambda {|n| @tone_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ToneInfo.create_from_discriminator_value(pn) }) },\n \"transcription\" => lambda {|n| @transcription = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallTranscriptionInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"teacherNumber\" => lambda {|n| @teacher_number = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"key\" => lambda {|n| @key = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"thumbprint\" => lambda {|n| @thumbprint = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"usage\" => lambda {|n| @usage = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"allowMultipleLines\" => lambda {|n| @allow_multiple_lines = n.get_boolean_value() },\n \"appendChangesToExistingText\" => lambda {|n| @append_changes_to_existing_text = n.get_boolean_value() },\n \"linesForEditing\" => lambda {|n| @lines_for_editing = n.get_number_value() },\n \"maxLength\" => lambda {|n| @max_length = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"textType\" => lambda {|n| @text_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"assignCategories\" => lambda {|n| @assign_categories = n.get_collection_of_primitive_values(String) },\n \"copyToFolder\" => lambda {|n| @copy_to_folder = n.get_string_value() },\n \"delete\" => lambda {|n| @delete = n.get_boolean_value() },\n \"forwardAsAttachmentTo\" => lambda {|n| @forward_as_attachment_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"forwardTo\" => lambda {|n| @forward_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"markAsRead\" => lambda {|n| @mark_as_read = n.get_boolean_value() },\n \"markImportance\" => lambda {|n| @mark_importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"moveToFolder\" => lambda {|n| @move_to_folder = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"permanentDelete\" => lambda {|n| @permanent_delete = n.get_boolean_value() },\n \"redirectTo\" => lambda {|n| @redirect_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"stopProcessingRules\" => lambda {|n| @stop_processing_rules = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"acceptMappedClaims\" => lambda {|n| @accept_mapped_claims = n.get_boolean_value() },\n \"knownClientApplications\" => lambda {|n| @known_client_applications = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n \"oauth2PermissionScopes\" => lambda {|n| @oauth2_permission_scopes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PermissionScope.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preAuthorizedApplications\" => lambda {|n| @pre_authorized_applications = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PreAuthorizedApplication.create_from_discriminator_value(pn) }) },\n \"requestedAccessTokenVersion\" => lambda {|n| @requested_access_token_version = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdByAppId\" => lambda {|n| @created_by_app_id = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"level\" => lambda {|n| @level = n.get_number_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PageLinks.create_from_discriminator_value(pn) }) },\n \"order\" => lambda {|n| @order = n.get_number_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSection\" => lambda {|n| @parent_section = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"userTags\" => lambda {|n| @user_tags = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return {\n \"failedRuns\" => lambda {|n| @failed_runs = n.get_number_value() },\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulRuns\" => lambda {|n| @successful_runs = n.get_number_value() },\n \"totalRuns\" => lambda {|n| @total_runs = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_guid_value() },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"recommendedActions\" => lambda {|n| @recommended_actions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RecommendedAction.create_from_discriminator_value(pn) }) },\n \"resolvedTargetsCount\" => lambda {|n| @resolved_targets_count = n.get_number_value() },\n \"simulationEventsContent\" => lambda {|n| @simulation_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SimulationEventsContent.create_from_discriminator_value(pn) }) },\n \"trainingEventsContent\" => lambda {|n| @training_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TrainingEventsContent.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"hint\" => lambda {|n| @hint = n.get_string_value() },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"secretText\" => lambda {|n| @secret_text = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"isRequired\" => lambda {|n| @is_required = n.get_boolean_value() },\n \"locations\" => lambda {|n| @locations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LocationConstraintItem.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"suggestLocation\" => lambda {|n| @suggest_location = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"activityType\" => lambda {|n| @activity_type = n.get_string_value() },\n \"chainId\" => lambda {|n| @chain_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"previewText\" => lambda {|n| @preview_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"recipient\" => lambda {|n| @recipient = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkNotificationRecipient.create_from_discriminator_value(pn) }) },\n \"templateParameters\" => lambda {|n| @template_parameters = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValuePair.create_from_discriminator_value(pn) }) },\n \"topic\" => lambda {|n| @topic = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkActivityTopic.create_from_discriminator_value(pn) }) },\n }\n end",
"def metadata\n self.class.metadata\n end",
"def get_field_deserializers()\n return {\n \"activityIdentifier\" => lambda {|n| @activity_identifier = n.get_string_value() },\n \"countEntitled\" => lambda {|n| @count_entitled = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEntitledForProvisioning\" => lambda {|n| @count_entitled_for_provisioning = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowed\" => lambda {|n| @count_escrowed = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowedRaw\" => lambda {|n| @count_escrowed_raw = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExported\" => lambda {|n| @count_exported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExports\" => lambda {|n| @count_exports = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImported\" => lambda {|n| @count_imported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedDeltas\" => lambda {|n| @count_imported_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedReferenceDeltas\" => lambda {|n| @count_imported_reference_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::SynchronizationTaskExecutionResult) },\n \"timeBegan\" => lambda {|n| @time_began = n.get_date_time_value() },\n \"timeEnded\" => lambda {|n| @time_ended = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"content\" => lambda {|n| @content = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"transportKey\" => lambda {|n| @transport_key = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"activeDeviceCount\" => lambda {|n| @active_device_count = n.get_number_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"modelAppHealthScore\" => lambda {|n| @model_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceAccess\" => lambda {|n| @resource_access = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceAccess.create_from_discriminator_value(pn) }) },\n \"resourceAppId\" => lambda {|n| @resource_app_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end",
"def get_field_deserializers()\n return {\n \"anchor\" => lambda {|n| @anchor = n.get_boolean_value() },\n \"apiExpressions\" => lambda {|n| @api_expressions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::StringKeyStringValuePair.create_from_discriminator_value(pn) }) },\n \"caseExact\" => lambda {|n| @case_exact = n.get_boolean_value() },\n \"defaultValue\" => lambda {|n| @default_value = n.get_string_value() },\n \"flowNullValues\" => lambda {|n| @flow_null_values = n.get_boolean_value() },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeDefinitionMetadataEntry.create_from_discriminator_value(pn) }) },\n \"multivalued\" => lambda {|n| @multivalued = n.get_boolean_value() },\n \"mutability\" => lambda {|n| @mutability = n.get_enum_value(MicrosoftGraph::Models::Mutability) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"referencedObjects\" => lambda {|n| @referenced_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ReferencedObject.create_from_discriminator_value(pn) }) },\n \"required\" => lambda {|n| @required = n.get_boolean_value() },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::AttributeType) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"averageBlueScreens\" => lambda {|n| @average_blue_screens = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"averageRestarts\" => lambda {|n| @average_restarts = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"blueScreenCount\" => lambda {|n| @blue_screen_count = n.get_number_value() },\n \"bootScore\" => lambda {|n| @boot_score = n.get_number_value() },\n \"coreBootTimeInMs\" => lambda {|n| @core_boot_time_in_ms = n.get_number_value() },\n \"coreLoginTimeInMs\" => lambda {|n| @core_login_time_in_ms = n.get_number_value() },\n \"deviceCount\" => lambda {|n| @device_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"diskType\" => lambda {|n| @disk_type = n.get_enum_value(MicrosoftGraph::Models::DiskType) },\n \"groupPolicyBootTimeInMs\" => lambda {|n| @group_policy_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyLoginTimeInMs\" => lambda {|n| @group_policy_login_time_in_ms = n.get_number_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"loginScore\" => lambda {|n| @login_score = n.get_number_value() },\n \"manufacturer\" => lambda {|n| @manufacturer = n.get_string_value() },\n \"model\" => lambda {|n| @model = n.get_string_value() },\n \"modelStartupPerformanceScore\" => lambda {|n| @model_startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"operatingSystemVersion\" => lambda {|n| @operating_system_version = n.get_string_value() },\n \"responsiveDesktopTimeInMs\" => lambda {|n| @responsive_desktop_time_in_ms = n.get_number_value() },\n \"restartCount\" => lambda {|n| @restart_count = n.get_number_value() },\n \"startupPerformanceScore\" => lambda {|n| @startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"connectingIP\" => lambda {|n| @connecting_i_p = n.get_string_value() },\n \"deliveryAction\" => lambda {|n| @delivery_action = n.get_string_value() },\n \"deliveryLocation\" => lambda {|n| @delivery_location = n.get_string_value() },\n \"directionality\" => lambda {|n| @directionality = n.get_string_value() },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"messageFingerprint\" => lambda {|n| @message_fingerprint = n.get_string_value() },\n \"messageReceivedDateTime\" => lambda {|n| @message_received_date_time = n.get_date_time_value() },\n \"messageSubject\" => lambda {|n| @message_subject = n.get_string_value() },\n \"networkMessageId\" => lambda {|n| @network_message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"application\" => lambda {|n| @application = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preventsDownload\" => lambda {|n| @prevents_download = n.get_boolean_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"webHtml\" => lambda {|n| @web_html = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"uploadUrl\" => lambda {|n| @upload_url = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceCountWithCrashes\" => lambda {|n| @device_count_with_crashes = n.get_number_value() },\n \"isLatestUsedVersion\" => lambda {|n| @is_latest_used_version = n.get_boolean_value() },\n \"isMostUsedVersion\" => lambda {|n| @is_most_used_version = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"attributeMappings\" => lambda {|n| @attribute_mappings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeMapping.create_from_discriminator_value(pn) }) },\n \"enabled\" => lambda {|n| @enabled = n.get_boolean_value() },\n \"flowTypes\" => lambda {|n| @flow_types = n.get_enum_value(MicrosoftGraph::Models::ObjectFlowTypes) },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ObjectMappingMetadataEntry.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Filter.create_from_discriminator_value(pn) }) },\n \"sourceObjectName\" => lambda {|n| @source_object_name = n.get_string_value() },\n \"targetObjectName\" => lambda {|n| @target_object_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionLinks.create_from_discriminator_value(pn) }) },\n \"pages\" => lambda {|n| @pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenotePage.create_from_discriminator_value(pn) }) },\n \"pagesUrl\" => lambda {|n| @pages_url = n.get_string_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appHangCount\" => lambda {|n| @app_hang_count = n.get_number_value() },\n \"crashedAppCount\" => lambda {|n| @crashed_app_count = n.get_number_value() },\n \"deviceAppHealthScore\" => lambda {|n| @device_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"messageId\" => lambda {|n| @message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"replyChainMessageId\" => lambda {|n| @reply_chain_message_id = n.get_string_value() },\n \"threadId\" => lambda {|n| @thread_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ExtensionSchemaProperty.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n \"targetTypes\" => lambda {|n| @target_types = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return {\n \"bargeInAllowed\" => lambda {|n| @barge_in_allowed = n.get_boolean_value() },\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"initialSilenceTimeoutInSeconds\" => lambda {|n| @initial_silence_timeout_in_seconds = n.get_number_value() },\n \"maxRecordDurationInSeconds\" => lambda {|n| @max_record_duration_in_seconds = n.get_number_value() },\n \"maxSilenceTimeoutInSeconds\" => lambda {|n| @max_silence_timeout_in_seconds = n.get_number_value() },\n \"playBeep\" => lambda {|n| @play_beep = n.get_boolean_value() },\n \"prompts\" => lambda {|n| @prompts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Prompt.create_from_discriminator_value(pn) }) },\n \"stopTones\" => lambda {|n| @stop_tones = n.get_collection_of_primitive_values(String) },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"response\" => lambda {|n| @response = n.get_enum_value(MicrosoftGraph::Models::ResponseType) },\n \"time\" => lambda {|n| @time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"driveId\" => lambda {|n| @drive_id = n.get_string_value() },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n \"shareId\" => lambda {|n| @share_id = n.get_string_value() },\n \"sharepointIds\" => lambda {|n| @sharepoint_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"siteId\" => lambda {|n| @site_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"activeMalwareDetectionCount\" => lambda {|n| @active_malware_detection_count = n.get_number_value() },\n \"category\" => lambda {|n| @category = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareCategory) },\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"distinctActiveMalwareCount\" => lambda {|n| @distinct_active_malware_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"issuerName\" => lambda {|n| @issuer_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CertificateStatus) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"subjectName\" => lambda {|n| @subject_name = n.get_string_value() },\n \"uploadDateTime\" => lambda {|n| @upload_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"servicePrincipalId\" => lambda {|n| @service_principal_id = n.get_string_value() },\n \"servicePrincipalName\" => lambda {|n| @service_principal_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"riskDetections\" => lambda {|n| @risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskDetection.create_from_discriminator_value(pn) }) },\n \"riskyServicePrincipals\" => lambda {|n| @risky_service_principals = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyServicePrincipal.create_from_discriminator_value(pn) }) },\n \"riskyUsers\" => lambda {|n| @risky_users = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyUser.create_from_discriminator_value(pn) }) },\n \"servicePrincipalRiskDetections\" => lambda {|n| @service_principal_risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ServicePrincipalRiskDetection.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return {\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"failedUsers\" => lambda {|n| @failed_users = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulUsers\" => lambda {|n| @successful_users = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"durationInSeconds\" => lambda {|n| @duration_in_seconds = n.get_number_value() },\n \"joinDateTime\" => lambda {|n| @join_date_time = n.get_date_time_value() },\n \"leaveDateTime\" => lambda {|n| @leave_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"actionName\" => lambda {|n| @action_name = n.get_string_value() },\n \"actionState\" => lambda {|n| @action_state = n.get_enum_value(MicrosoftGraph::Models::ActionState) },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"azureAdUserId\" => lambda {|n| @azure_ad_user_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"domainName\" => lambda {|n| @domain_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n \"userSid\" => lambda {|n| @user_sid = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DocumentSetVersionItem.create_from_discriminator_value(pn) }) },\n \"shouldCaptureMinorVersion\" => lambda {|n| @should_capture_minor_version = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_guid_value() },\n \"cloudServiceDeploymentEnvironment\" => lambda {|n| @cloud_service_deployment_environment = n.get_string_value() },\n \"cloudServiceDeploymentId\" => lambda {|n| @cloud_service_deployment_id = n.get_string_value() },\n \"cloudServiceInstanceName\" => lambda {|n| @cloud_service_instance_name = n.get_string_value() },\n \"cloudServiceName\" => lambda {|n| @cloud_service_name = n.get_string_value() },\n \"deviceDescription\" => lambda {|n| @device_description = n.get_string_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"mediaLegId\" => lambda {|n| @media_leg_id = n.get_guid_value() },\n \"mediaQualityList\" => lambda {|n| @media_quality_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeleconferenceDeviceMediaQuality.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"participantId\" => lambda {|n| @participant_id = n.get_guid_value() },\n }\n end",
"def _before_validation\n serialize_deserialized_values\n super\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"kind\" => lambda {|n| @kind = n.get_string_value() },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"color\" => lambda {|n| @color = n.get_string_value() },\n \"criterion1\" => lambda {|n| @criterion1 = n.get_string_value() },\n \"criterion2\" => lambda {|n| @criterion2 = n.get_string_value() },\n \"dynamicCriteria\" => lambda {|n| @dynamic_criteria = n.get_string_value() },\n \"filterOn\" => lambda {|n| @filter_on = n.get_string_value() },\n \"icon\" => lambda {|n| @icon = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookIcon.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operator\" => lambda {|n| @operator = n.get_string_value() },\n \"values\" => lambda {|n| @values = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end"
] | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.61200523",
"0.6089013",
"0.60869795",
"0.6079146",
"0.60785794",
"0.6070405",
"0.6063533",
"0.60625833",
"0.6061235",
"0.60584134",
"0.6055769",
"0.6051312",
"0.60465735",
"0.6046329",
"0.6031944",
"0.6029311",
"0.6028314",
"0.60255736",
"0.6022033",
"0.60210633",
"0.6009887",
"0.5988654",
"0.59844214",
"0.59793943",
"0.5975247",
"0.5969614",
"0.596824",
"0.5966432",
"0.5965554",
"0.596292",
"0.5951651",
"0.5950895",
"0.59456754",
"0.59448177",
"0.593984",
"0.59362113",
"0.5935833",
"0.59319806",
"0.59312665",
"0.59307545",
"0.5930406",
"0.5926444",
"0.5926136",
"0.59240156",
"0.5922303",
"0.591605",
"0.591336",
"0.5913327",
"0.59130335",
"0.5910617",
"0.5906052",
"0.5906045",
"0.59042066",
"0.5903306",
"0.5902868",
"0.59027255",
"0.5902389",
"0.5902219",
"0.5901496",
"0.58978146",
"0.5891392",
"0.5890228",
"0.5885622",
"0.5885429",
"0.5884738",
"0.5883899",
"0.5883899",
"0.5883899",
"0.58811784",
"0.5878516",
"0.5877111",
"0.5869185",
"0.5844199",
"0.58430207",
"0.58408237",
"0.58383596",
"0.58362466",
"0.5836192",
"0.5835942",
"0.5834559",
"0.583357"
] | 0.0 | -1 |
Gets the isExpirationRequired property value. Indicates whether expiration is required or if it's a permanently active assignment or eligibility. | def is_expiration_required
return @is_expiration_required
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_expiration_required=(value)\n @is_expiration_required = value\n end",
"def expiration_behavior\n return @expiration_behavior\n end",
"def can_expire?\n return !!@expiry\n end",
"def expiration\n return @expiration\n end",
"def expires?\n self.duration.present?\n end",
"def expired?\n Time.now > @expiration if @expiration\n end",
"def can_expire?\n return !!self.expires_in && !!self.time_created\n end",
"def expired?\n self.expiration.past? || self[:expired]\n end",
"def expired?\n return @expired\n end",
"def expired?\n can_expire? && @expiry < Time.now.to_i\n end",
"def expired?\n @expired\n end",
"def expires?\n !!@expires_at\n end",
"def expired?\n Time.now > expiration if expiration\n end",
"def can_expire?\n false\n end",
"def expiration_behavior=(value)\n @expiration_behavior = value\n end",
"def expires?\n !!@expires_at\n end",
"def expired?\n expiration_date <= Time.now\n end",
"def has_default_expiration?\n expiredate < Time.now+60*60+60 # The last 60seconds are for safety\n end",
"def terms_expiration\n return @terms_expiration\n end",
"def expired?\n self.class.ttl_in_seconds && self.class.rates_expiration <= Time.now\n end",
"def expired?\n expires? && (Time.now > expires_at)\n end",
"def expiration_must_be_future\n return if expiration.nil?\n errors.add(:expiration, 'is in the past') unless expiration.future?\n end",
"def expired?\n !expires_at.nil? && Time.now >= expires_at\n end",
"def expired?\n false\n end",
"def expired?\n if expires?\n Time.now >= expires_at\n else\n false\n end\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expiration_date_time\n return @expiration_date_time\n end",
"def expired?\n expires? && (expires_at < Time.now.to_i)\n end",
"def expired?\n can_expire? && (self.expires_in + self.time_created) < Time.now.to_i\n end",
"def expiration\n unless @expiration\n conf = Grape::Jwt::Authentication.configuration\n return conf.rsa_public_key_expiration\n end\n @expiration\n end",
"def expired?\n !expiration_date || expiration_date <= Date.today\n end",
"def expired?\n config['expired'] || false\n end",
"def has_expired?\n self.expires_at ? self.expires_at < Time.now.utc : false\n end",
"def has_expired?\n self.expires_at ? self.expires_at < Time.now.utc : false\n end",
"def not_expired?\n self.expires_at && Time.now <= self.expires_at\n end",
"def expired?\n !respond_to?(:expires_at) || expires_at < Time.current\n end",
"def expiry_on?\n :on == self.expiry_option\n end",
"def expired?\n expires_at && expires_at <= Time.now\n end",
"def has_not_expired?\n self.expires_at ? self.expires_at > Time.now.utc : true\n end",
"def has_not_expired?\n self.expires_at ? self.expires_at > Time.now.utc : true\n end",
"def getExpiration; @expires; end",
"def expires?\n !!expires_at\n end",
"def expired?\n @expires_at <= Time.now\n end",
"def expiry_option\n @expiry_option || :in\n end",
"def active?\n self.expires_at > Time.now\n end",
"def expired?\n expires && expires < Time.now\n end",
"def expired?\n @expiry_time < Time.now\n end",
"def expired?\n expires_at && Time.now > expires_at\n end",
"def expiration=(value)\n @expiration = value\n end",
"def expired?\n self.expires_at && Time.now > self.expires_at\n end",
"def expired?\n Time.now > @expires\n end",
"def password_expires?\n @password_expires\n end",
"def expired?\n DateTime.now > @expires\n end",
"def expired?\n self.expires_on? and self.expires_on < Time.now\n end",
"def expired?\n not valid?\n end",
"def expired?\n return false unless expires_at\n expires_at < Time.now\n end",
"def expired?\n Time.current >= expires_at\n end",
"def expired?\n self.expires_at && Time.now.utc > self.expires_at\n end",
"def expired?\n return true if expires - Time.now <= 0\n return false\n end",
"def is_required\n return @is_required\n end",
"def has_infinite_expiration?\n expiredate > Time.now+60*60\n end",
"def expiration\n @expiration ||= 60 * 60 * 24 * 30 # 30 days\n end",
"def expiration_date_valid?\n expiration_date.is_a? Date\n end",
"def expired?\n expires_at.to_time <= Time.now.utc\n end",
"def expired?\n expires_at.to_time <= Time.now.utc\n end",
"def is_valid?\n DateTime.now < self.expires_at\n end",
"def active?\n self.expires_on > Date.today\n end",
"def expired?\n @expires_in && @created_at + @expires_in <= Time.now.to_f\n end",
"def expired?\n return if missing?\n\n validity < (reference_time - time)\n end",
"def required?()\n return @is_required\n end",
"def expired?(grace_period = 60)\n Time.now > read_attribute(:created_at) + read_attribute(:expires_in) - grace_period\n end",
"def expired?\n return self.expires_on < Date.today if self.expires_on\n true\n end",
"def default_expiration\n expirations\n .find_all { |exp| exp.default_action? && exp.in_expiration_interval? }\n .min { |exp| exp.time.to_i }\n end",
"def default_expiration\n expirations\n .find_all { |exp| exp.default_action? && exp.in_expiration_interval? }\n .min { |exp| exp.time.to_i }\n end",
"def expired?(expiration_date)\n Date.today.beginning_of_day >= expiration_date.beginning_of_day\n end",
"def expired?\n remaining.zero?\n end",
"def expired?\n DateTime.now.utc >= self.expires_at\n end",
"def expired?\n overdue_days > 0\n end",
"def is_valid?\n \tDateTime.now < self.expires_at\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def password_expiration_days\n return @password_expiration_days\n end",
"def expired?\n Time.now - @created_time > @ttl\n end",
"def expired?\n Time.now.in_time_zone > expires_at\n end",
"def expire_password_on_demand?\n expire_password_after.present? && expire_password_after == true\n end",
"def expiry_in?\n :in == self.expiry_option\n end",
"def duration_allowed?\n max_duration = equipment_model.category.maximum_checkout_length\n if max_duration == \"unrestricted\" || (self.class == Reservation && self.checked_in)\n return true\n elsif self.duration > max_duration\n errors.add(:base, equipment_model.name + \"cannot be reserved for more than \" + max_duration.to_s + \" days at a time.\\n\")\n return false\n else\n return true\n end\n end",
"def expiring?\n return true if expires - Time.now < 60\n return false\n end",
"def required?\n unless @required\n @required = options_by_type(:required)\n @required = true if @required.nil?\n end\n return @required\n end",
"def allowed_to_pay_renewal_member_fee?\n return false if admin?\n\n (current_member? || in_grace_period?) &&\n RequirementsForRenewal.requirements_excluding_payments_met?(self)\n end",
"def expired?\n !self.active?\n end",
"def expired?\n Time.zone.today > expires_at\n end",
"def expiry\n @expiry\n end",
"def expired?\n Date.today > self.expires_on\n end",
"def expiration_intent\n read_integer('expiration_intent')\n end"
] | [
"0.77053386",
"0.6665872",
"0.6395092",
"0.61893505",
"0.61705333",
"0.6162824",
"0.614428",
"0.6097486",
"0.608558",
"0.6029967",
"0.5965881",
"0.59582055",
"0.5946574",
"0.59443855",
"0.5938723",
"0.5925991",
"0.59085464",
"0.5901934",
"0.5898379",
"0.58736587",
"0.587226",
"0.5863316",
"0.58271873",
"0.580834",
"0.58024573",
"0.57955146",
"0.57955146",
"0.57955146",
"0.57955146",
"0.57955146",
"0.57955146",
"0.5789357",
"0.57797825",
"0.5757682",
"0.5756902",
"0.5756283",
"0.57459414",
"0.57459414",
"0.57426393",
"0.57417184",
"0.5737179",
"0.572571",
"0.5724766",
"0.5724766",
"0.57103616",
"0.5707459",
"0.57038665",
"0.5690149",
"0.5688984",
"0.5685998",
"0.5675769",
"0.5670259",
"0.5645519",
"0.56196034",
"0.56158125",
"0.5604732",
"0.559944",
"0.5593998",
"0.55937153",
"0.5592003",
"0.5583431",
"0.5578716",
"0.5572956",
"0.5560371",
"0.5559501",
"0.55496037",
"0.5545512",
"0.5532167",
"0.5532167",
"0.5520416",
"0.5509367",
"0.5503448",
"0.54935217",
"0.54716545",
"0.5469963",
"0.54649514",
"0.5464762",
"0.5464762",
"0.5459769",
"0.5429323",
"0.54280764",
"0.54223245",
"0.54194945",
"0.5410132",
"0.5410132",
"0.5410132",
"0.5410132",
"0.54084074",
"0.5402261",
"0.5400336",
"0.5399101",
"0.5376519",
"0.5370039",
"0.53612465",
"0.5358118",
"0.53413993",
"0.5339074",
"0.533842",
"0.5333512",
"0.53317785"
] | 0.8223862 | 0 |
Sets the isExpirationRequired property value. Indicates whether expiration is required or if it's a permanently active assignment or eligibility. | def is_expiration_required=(value)
@is_expiration_required = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_expiration_required\n return @is_expiration_required\n end",
"def expiration_behavior=(value)\n @expiration_behavior = value\n end",
"def expiration=(value)\n @expiration = value\n end",
"def is_required=(value)\n @is_required = value\n end",
"def set_ExpirationDate(value)\n set_input(\"ExpirationDate\", value)\n end",
"def expiration_must_be_future\n return if expiration.nil?\n errors.add(:expiration, 'is in the past') unless expiration.future?\n end",
"def terms_expiration=(value)\n @terms_expiration = value\n end",
"def expiration=(expiration_date)\n unless self.new_record?\n logger.warn(\"Attempted to set expiration on existing record: access_token id=#{self.id}. Update ignored\")\n return\n end\n super(expiration_date)\n\n self.expired = expiration_date.nil? || (expiration_date == '') || expiration_date.past?\n end",
"def set_expiration_date(expiration_date)\n return unless Trebuchet.backend.respond_to?(:set_expiration_date)\n Trebuchet.backend.set_expiration_date(self.name, expiration_date)\n end",
"def set_expiration_date\n self.expiry_date = Date.today + 365.days\n end",
"def required=(value)\n @required = value\n end",
"def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"def set_invitation_flags\n self.invitation_required = false\n true\n end",
"def is_approval_required_for_add=(value)\n @is_approval_required_for_add = value\n end",
"def expires=(value)\n @expires = value\n @expires_in = nil\n end",
"def set_expired\n self.expired = false\n true\n end",
"def can_expire?\n false\n end",
"def set_expires_at\n self[:expires_at] = case self.expiry_option \n when :in then Time.now.utc + (self.expiry_days || DEFAULT_EXPIRY_DAYS).days\n when :on then self[:expires_at]\n else self[:expires_at]\n end\n end",
"def set_required(boolean)\n\t\tself.preferences ||= Hash.new\n\t\tself.preferences[:required] = boolean\n\tend",
"def set_expires_at\n self[:expires_at] = case self.expiry_option \n when :in then Time.now.utc + (self.expiry_days || 3).days\n when :on then self[:expires_at]\n else self[:expires_at]\n end\n end",
"def expires_at=(time)\n self.expiry_option = :on\n self[:expires_at] = time\n end",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def password_expiration_days=(value)\n @password_expiration_days = value\n end",
"def default_expires=(value)\n @default_expires = value\n end",
"def is_delivery_receipt_requested=(value)\n @is_delivery_receipt_requested = value\n end",
"def has_default_expiration?\n expiredate < Time.now+60*60+60 # The last 60seconds are for safety\n end",
"def expiration_behavior\n return @expiration_behavior\n end",
"def expiry_option\n @expiry_option || :in\n end",
"def passcode_expiration_days=(value)\n @passcode_expiration_days = value\n end",
"def expire_password_on_demand?\n expire_password_after.present? && expire_password_after == true\n end",
"def can_expire?\n return !!self.expires_in && !!self.time_created\n end",
"def set_cookie_expiration(opts)\n opts = check_params(opts,[:expirations])\n super(opts)\n end",
"def can_expire?\n return !!@expiry\n end",
"def expired?\n self.expiration.past? || self[:expired]\n end",
"def required(required)\n state_depth_must_be(States::ATTRIBUTE)\n raise 'required already defined' if @current_attribute.required\n required = required.strip.downcase\n raise 'must be boolean' unless %w[true false].include?(required)\n r = (required == 'true')\n @current_attribute.required = r\n end",
"def is_approval_required_for_update=(value)\n @is_approval_required_for_update = value\n end",
"def is_approver_justification_required=(value)\n @is_approver_justification_required = value\n end",
"def expired?\n Time.now > @expiration if @expiration\n end",
"def expires_at=(value)\n self[:expires_at] = value\n end",
"def have_expiration(expires_in = DirectUploader.upload_expiration)\n be_within(1.second).of (Time.now + expires_in)\n end",
"def default_expiration= new_default_expiration\n patch_gapi! default_expiration: new_default_expiration\n end",
"def set_eligibility\n update_attribute_without_callbacks(:eligible,\n mandatory ||\n (amount != 0 && eligible_for_originator?))\n end",
"def expiration_date_after_today\n errors.add(:expiration_date, 'must be after today') if expiration_date <= Time.now\n end",
"def work_profile_password_expiration_days=(value)\n @work_profile_password_expiration_days = value\n end",
"def expires?\n !!@expires_at\n end",
"def expires?\n !!@expires_at\n end",
"def expired?\n !expiration_date || expiration_date <= Date.today\n end",
"def expiry_date_is_in_the_future\n errors.add(:expiry_date, \"can't be in the past or be today\") if\n !expiry_date.blank? and expiry_date <= Date.today\n end",
"def default_expire=(value)\n raise ArgumentError, \"#{name}.default_expire value must be greater than 0\" unless (value = value.to_f) > 0\n @@default_expire = value\n end",
"def expiry_option=(value)\n @expiry_option = value.to_sym if value\n end",
"def expires?\n self.duration.present?\n end",
"def expiration_date_cannot_be_in_the_past\n if expiration_date.present? && expiration_date < Date.today\n errors.add(:expiration_date, \"can't be in the past\")\n end\n end",
"def allowed_to_pay_renewal_member_fee?\n return false if admin?\n\n (current_member? || in_grace_period?) &&\n RequirementsForRenewal.requirements_excluding_payments_met?(self)\n end",
"def expiration_date_valid?\n expiration_date.is_a? Date\n end",
"def expiration\n @expiration ||= 60 * 60 * 24 * 30 # 30 days\n end",
"def expired?\n expiration_date <= Time.now\n end",
"def expires_in=(duration)\n self.expires_at = duration.from_now\n end",
"def set_expiring_date\n self.expires_at = self.created_at + 10.minutes\n self.save\n end",
"def expired?\n self.expired = false unless self.deadline > DateTime.now\n end",
"def set_expire_at_date\n self[:expire_at] = valid_at + 1.year\n end",
"def enforce_future_date_for_lease?\n false\n end",
"def required\n @optional = false\n end",
"def not_expired?\n self.expires_at && Time.now <= self.expires_at\n end",
"def expired?\n Time.now > expiration if expiration\n end",
"def is_required?\n return self.schedule_status == 'reschedule' ? true : false\n end",
"def expires_in=(value)\n @expires_in = value\n @expires = nil\n end",
"def optional_claims=(value)\n @optional_claims = value\n end",
"def start_expiry_period!\n self.update_attribute(:access_token_expires_at, 2.days.from_now)\n end",
"def is_valid?\n DateTime.now < self.expires_at\n end",
"def has_not_expired?\n self.expires_at ? self.expires_at > Time.now.utc : true\n end",
"def has_not_expired?\n self.expires_at ? self.expires_at > Time.now.utc : true\n end",
"def start_expiry_period!\n self.update_attribute(:access_token_expires_at, Time.now + Devise.timeout_in)\n end",
"def expired?\n can_expire? && @expiry < Time.now.to_i\n end",
"def expiry=(expiry)\n self.expires_on = Date.strptime(expiry, '%m/%y') +1.month\n end",
"def is_valid?\n \tDateTime.now < self.expires_at\n end",
"def activate_exemption\n self.registered_on = Date.today\n\n self.expires_on = if transient_registration.is_a? WasteExemptionsEngine::RenewingRegistration\n transient_registration.registration.expires_on +\n WasteExemptionsEngine.configuration.years_before_expiry.years\n else\n Date.today + (WasteExemptionsEngine.configuration.years_before_expiry.years - 1.day)\n end\n\n save!\n end",
"def set_expired_plans_to_inactive_if_autorenew_is_off billables\n change_plan_status(billables, renew: false)\n end",
"def expiry= new_expiry\n @expiry = new_expiry ? new_expiry.to_i : nil\n end",
"def expired?\n false\n end",
"def expired?\n !expires_at.nil? && Time.now >= expires_at\n end",
"def expiry_on?\n :on == self.expiry_option\n end",
"def expired?\n @expires_at <= Time.now\n end",
"def expired?\n expires? && (Time.now > expires_at)\n end",
"def date_auth_expires=(value)\n @children['date-auth-expires'][:value] = value\n end",
"def is_scheduling_enabled=(value)\n @is_scheduling_enabled = value\n end",
"def expired?\n expires && expires < Time.now\n end",
"def has_expired?\n self.expires_at ? self.expires_at < Time.now.utc : false\n end",
"def has_expired?\n self.expires_at ? self.expires_at < Time.now.utc : false\n end",
"def expired?\n if expires?\n Time.now >= expires_at\n else\n false\n end\n end",
"def expires?\n !!expires_at\n end",
"def expired?(expiration_date)\n Date.today.beginning_of_day >= expiration_date.beginning_of_day\n end",
"def expired?\n expires? && (expires_at < Time.now.to_i)\n end",
"def auth_expires=(value)\n @children['auth-expires'][:value] = value\n end"
] | [
"0.68301517",
"0.60498744",
"0.59132427",
"0.58651066",
"0.57569396",
"0.5736499",
"0.5593959",
"0.5581465",
"0.53682905",
"0.53637195",
"0.53589004",
"0.5325741",
"0.5325741",
"0.5325741",
"0.5325741",
"0.5325741",
"0.5325741",
"0.5293934",
"0.5285521",
"0.51977193",
"0.519472",
"0.5189363",
"0.5179056",
"0.51618826",
"0.5140086",
"0.51285917",
"0.51232255",
"0.51232255",
"0.51232255",
"0.51232255",
"0.51122767",
"0.5102564",
"0.5052113",
"0.5023345",
"0.4998271",
"0.49928507",
"0.49858198",
"0.49748826",
"0.49699116",
"0.49692586",
"0.4911237",
"0.49086633",
"0.49075595",
"0.48998064",
"0.48978716",
"0.48942614",
"0.48842505",
"0.48788863",
"0.48652098",
"0.48577577",
"0.4850495",
"0.48352638",
"0.48315024",
"0.482088",
"0.48002705",
"0.4794814",
"0.47928745",
"0.4790691",
"0.47850275",
"0.47794396",
"0.47787645",
"0.4775544",
"0.47752845",
"0.47744",
"0.47680116",
"0.47665206",
"0.4765984",
"0.47611153",
"0.47445676",
"0.47428358",
"0.47421393",
"0.47416738",
"0.47382256",
"0.47325784",
"0.4724817",
"0.47171825",
"0.46977362",
"0.46977362",
"0.46942136",
"0.46755666",
"0.4674964",
"0.46746144",
"0.4668627",
"0.46569663",
"0.46563682",
"0.4647242",
"0.46443847",
"0.46436974",
"0.46402285",
"0.46314874",
"0.4628703",
"0.46206617",
"0.46130887",
"0.46125725",
"0.46125725",
"0.461132",
"0.46048358",
"0.45984736",
"0.45899183",
"0.4586144"
] | 0.8102894 | 0 |
Gets the maximumDuration property value. The maximum duration allowed for eligibility or assignment which is not permanent. Required when isExpirationRequired is true. | def maximum_duration
return @maximum_duration
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maximum_duration=(value)\n @maximum_duration = value\n end",
"def max_record_duration_in_seconds\n return @max_record_duration_in_seconds\n end",
"def max_record_duration_in_seconds=(value)\n @max_record_duration_in_seconds = value\n end",
"def max_duration\n if start_time && end_time && (end_time - start_time) > 2.years\n errors.add :end_time, I18n.t('activerecord.errors.models.membership.attributes.end_time.max_duration_error')\n end\n end",
"def max_time\n @max_time ||= defaults[:max_time]\n end",
"def max_time\n @max_time ||= 0.2\n end",
"def lifetime_in_minutes\n return @lifetime_in_minutes\n end",
"def max_size_in_megabytes\n to_i description['MaxSizeInMegabytes']\n end",
"def max_session_duration \n @max_session_duration ||= 15.minutes\n end",
"def max_interval\n MAX_INTERVAL\n end",
"def getDurationMinutes\r\n\t\t\t\t\treturn @durationMinutes\r\n\t\t\t\tend",
"def getDuration\r\n\t\t\t\t\treturn @duration\r\n\t\t\t\tend",
"def max_speed\n @max_speed ||= read_attribute('max_speed').to_i\n end",
"def max_age\n @grpc.max_age.seconds if @grpc.max_age\n end",
"def duration\n @abs_duration ||= @duration.abs\n end",
"def max_timeout\n self.device.max_timeout\n end",
"def maxage\n @attributes[:maxage]\n end",
"def max_wait_time\n @data[\"max_wait_time\"]\n end",
"def maximum\n return @maximum\n end",
"def max_idle_time\n @max_idle_time ||= options[:max_idle_time]\n end",
"def s_maxage\n\t\t\t\t\tfind_integer_value(S_MAXAGE)\n\t\t\t\tend",
"def max_length\n return @max_length\n end",
"def max_age\n\t\t\t\t\tfind_integer_value(MAX_AGE)\n\t\t\t\tend",
"def media_duration=(value)\n @media_duration = value\n end",
"def durationInMinutes\n @duration/60.0 #Force floating pt.\n end",
"def max\n if valid?\n max_value\n end\n end",
"def maxvalue\n MAXVALUE\n end",
"def max_length\n MAX_LENGTH\n end",
"def duration_before_automatic_denial\n return @duration_before_automatic_denial\n end",
"def max_age\n cache_control.reverse_max_age ||\n cache_control.shared_max_age ||\n cache_control.max_age ||\n (expires && (expires - date))\n end",
"def duration()\n\t\t\treturn @duration\n\t\tend",
"def media_duration\n return @media_duration\n end",
"def durationInMinutes=( value)\r\n @duration = (value * 60).to_i\r\n end",
"def max_reserved_time\n @max_reserved_time_s && ( @max_reserved_time_s * 1000.0 ).round\n end",
"def maximum_capacity\n read_attribute(:maximum_capacity) || room.try(:capacity)\n end",
"def timeout_in_minutes\n data[:timeout_in_minutes]\n end",
"def max_age=( delta_seconds )\n\t\tif delta_seconds.nil?\n\t\t\t@max_age = nil\n\t\telse\n\t\t\t@max_age = Integer( delta_seconds )\n\t\tend\n\tend",
"def effective_maximum\n maximum_bound ? maximum_bound.value : Infinity\n end",
"def duration\n @duration\n end",
"def maximal_length\n if !self.value.blank? && self.maxLength\n errors.add(:value, 'is too long!') if self.value.length > self.maxLength\n end\n end",
"def maximum_value\n @maximum_value || store.max\n end",
"def max_size\n @max_size ||= options[:max_size] || [DEFAULT_MAX_SIZE, min_size].max\n end",
"def duration_in_days\n return @duration_in_days\n end",
"def max_delivery_count\n to_i description['MaxDeliveryCount']\n end",
"def autosizedMaximumFlowRate\n\n return self.model.getAutosizedValue(self, 'Design Size Maximum Flow Rate', 'm3/s')\n \n end",
"def duration=(value)\n @duration = value\n end",
"def duration=(value)\n @duration = value\n end",
"def to_ri_cal_duration_value\n RiCal::PropertyValue::Duration.from_string(self)\n end",
"def max_key_age()\n\t\t\treturn @metadata.attributes[:max_key_age].to_i\n\t\tend",
"def duration\n return @duration\n end",
"def duration\n return @duration\n end",
"def max_seconds_between_posts\n self.class.max_seconds_between_posts\n end",
"def new_duration\n @duration\n end",
"def max_allowed_deadline_date\n @deadline_calculator.max_allowed_deadline_date(max_time_limit)\n end",
"def duration=(value)\n\t\t\t@duration = value\n\t\tend",
"def duration_in_seconds\n return @duration_in_seconds\n end",
"def get_max\n @max\n end",
"def max_duration=(duration)\n nodes = @nodes.to_a\n add_edge(nodes.last, nodes.first, -duration)\n duration\n end",
"def duration\n if properties.is_a?(String)\n JSON.parse(properties)['duration']\n else\n properties.with_indifferent_access[:duration]\n end\n end",
"def effective_duration\n if start_time.nil?\n accommodated_duration\n else\n effective_end_time - start_time\n end\n end",
"def lifetime_in_minutes=(value)\n @lifetime_in_minutes = value\n end",
"def meeting_duration\n return @meeting_duration\n end",
"def max\n @max ||= define_min_and_max && @max\n end",
"def autosizedMaximumOutdoorAirFlowRate\n\n return self.model.getAutosizedValue(self, 'Maximum Outdoor Air Flow Rate', 'm3/s')\n \n end",
"def get_duration\n duration_instance.span\n end",
"def duration_allowed?\n max_duration = equipment_model.category.maximum_checkout_length\n if max_duration == \"unrestricted\" || (self.class == Reservation && self.checked_in)\n return true\n elsif self.duration > max_duration\n errors.add(:base, equipment_model.name + \"cannot be reserved for more than \" + max_duration.to_s + \" days at a time.\\n\")\n return false\n else\n return true\n end\n end",
"def file_size_max\n if Rails.configuration.fileSizeMax == nil\n 5 * 1024 * 1024\n else\n Rails.configuration.fileSizeMax # or get it from the config\n end\n end",
"def duration\n @duration ||= timestamp_delta / 256.0\n end",
"def max_length=(value)\n @max_length = value\n end",
"def max_age_seconds(maxAgeSeconds=nil)\n if maxAgeSeconds.class == Fixnum && !block_given?\n @j_del.java_method(:maxAgeSeconds, [Java::int.java_class]).call(maxAgeSeconds)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling max_age_seconds(maxAgeSeconds)\"\n end",
"def duration\n raw_duration.to_f/time_scale\n end",
"def duration\n raw_duration.to_f/time_scale\n end",
"def duration\n duration = data(\"duration\")\n duration_to_seconds(duration.to_f) if duration\n end",
"def maximum=(value)\n @maximum = value\n end",
"def max_age= age\n @grpc.max_age = Convert.number_to_duration(age)\n end",
"def max\n\t\t@max || nil\n\tend",
"def queued_max_age\n max_age = 0\n \n @collection.find(status: 'QUEUED').each do |item|\n age = Time.now - item[\"queue_time\"]\n if age > max_age\n max_age = age\n end\n end\n\n return max_age\n end",
"def max_age; end",
"def duration_block_in_minutes\n 180\n end",
"def maximum_frame_size\n\t\t\t\t@remote_settings.maximum_frame_size\n\t\t\tend",
"def max_silence_timeout_in_seconds\n return @max_silence_timeout_in_seconds\n end",
"def length\n [default&.length, max_content_length].compact.max\n end",
"def meeting_duration=(value)\n @meeting_duration = value\n end",
"def days_remaining_until_password_expire\n @attributes[:days_remaining_until_password_expire]\n end",
"def timeout\n @attributes[:timeout]\n end",
"def max_frame_size\n defined?(@max_frame_size) ? @max_frame_size : WebSocket.max_frame_size\n end",
"def max(value)\n opts[:max] = value\n end",
"def text_field_max\n return nil unless hidden_field_max\n hidden_field_max.divmod(hidden_field_step).first * text_field_step\n # fetch_options('max', text_field_name) # default)\n end",
"def duration_before_escalation\n return @duration_before_escalation\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def get_max\n @max ||= calculate_max\n end",
"def expiration\n return @expiration\n end",
"def minimum_duration(duration = nil)\n if @headers['EXT-X-TARGETDURATION'].empty?\n return duration if duration\n return 999_999_999 # TODO: Infinity or Zero?\n end\n\n # see\n # http://tools.ietf.org/html/draft-pantos-http-live-streaming-13\n # #section-6.2.2\n spec_min = Integer(@headers['EXT-X-TARGETDURATION'][0].value) * 3\n return duration if duration && duration > spec_min\n spec_min\n end",
"def max_file_size\n 35.megabytes\n end",
"def maximum_outbound_round_trip_delay\n return @maximum_outbound_round_trip_delay\n end",
"def length\n @duration.length\n end"
] | [
"0.8067252",
"0.74787444",
"0.70436144",
"0.67879844",
"0.6765356",
"0.6577147",
"0.641355",
"0.63824296",
"0.63730973",
"0.6370917",
"0.63244295",
"0.631829",
"0.6298791",
"0.6234084",
"0.621521",
"0.6188506",
"0.6172675",
"0.61421794",
"0.613132",
"0.6121068",
"0.6100329",
"0.6082046",
"0.60784984",
"0.60773516",
"0.6047646",
"0.601247",
"0.60060203",
"0.5994431",
"0.59941274",
"0.5984518",
"0.5959977",
"0.59539545",
"0.5951695",
"0.59474987",
"0.59284294",
"0.5922114",
"0.5919819",
"0.59010094",
"0.5882185",
"0.5879767",
"0.58793104",
"0.5872795",
"0.5855967",
"0.5853069",
"0.5840883",
"0.5840469",
"0.5840469",
"0.58200306",
"0.5805057",
"0.58038867",
"0.58038867",
"0.5781157",
"0.5775437",
"0.5773009",
"0.5766398",
"0.5730949",
"0.5709068",
"0.56894165",
"0.568676",
"0.5671804",
"0.5670413",
"0.5644083",
"0.5637776",
"0.5628107",
"0.56229395",
"0.5620572",
"0.5610488",
"0.55894065",
"0.5587162",
"0.5579379",
"0.55780715",
"0.55780715",
"0.55710447",
"0.55603755",
"0.5558123",
"0.5556665",
"0.5549791",
"0.5545939",
"0.5541848",
"0.5537138",
"0.5531197",
"0.5529611",
"0.5519048",
"0.5511965",
"0.5510059",
"0.5508637",
"0.5505653",
"0.55050695",
"0.5501544",
"0.54862916",
"0.54862916",
"0.54862916",
"0.54862916",
"0.54862916",
"0.5484621",
"0.54844195",
"0.54814315",
"0.5476428",
"0.546655",
"0.546148"
] | 0.8593823 | 0 |
Sets the maximumDuration property value. The maximum duration allowed for eligibility or assignment which is not permanent. Required when isExpirationRequired is true. | def maximum_duration=(value)
@maximum_duration = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_record_duration_in_seconds=(value)\n @max_record_duration_in_seconds = value\n end",
"def maximum_duration\n return @maximum_duration\n end",
"def set_VideoDuration(value)\n set_input(\"VideoDuration\", value)\n end",
"def max_age= max_age\n self[:max_age] = max_age\n end",
"def max_duration\n if start_time && end_time && (end_time - start_time) > 2.years\n errors.add :end_time, I18n.t('activerecord.errors.models.membership.attributes.end_time.max_duration_error')\n end\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def set_Duration(value)\n set_input(\"Duration\", value)\n end",
"def max_timeout=(timeout)\n self.device.max_timeout = timeout\n end",
"def max_age=( delta_seconds )\n\t\tif delta_seconds.nil?\n\t\t\t@max_age = nil\n\t\telse\n\t\t\t@max_age = Integer( delta_seconds )\n\t\tend\n\tend",
"def max_length=(value)\n @max_length = value\n end",
"def duration=(value)\n\t\t\t@duration = value\n\t\tend",
"def max_time\n @max_time ||= defaults[:max_time]\n end",
"def duration=(value)\n @duration = value\n end",
"def duration=(value)\n @duration = value\n end",
"def maximum=(value)\n @maximum = value\n end",
"def duration=(int)\n @duration = int\n set_ends_at\n end",
"def with_max_timeout(max_timeout)\n @max_timeout = max_timeout\n self\n end",
"def durationInMinutes=( value)\r\n @duration = (value * 60).to_i\r\n end",
"def media_duration=(value)\n @media_duration = value\n end",
"def max_record_duration_in_seconds\n return @max_record_duration_in_seconds\n end",
"def setDuration(duration)\r\n\t\t\t\t\t@duration = duration\r\n\t\t\t\tend",
"def SetDuration(duration)\n @duration=duration\n end",
"def max(value)\n opts[:max] = value\n end",
"def max_silence_timeout_in_seconds=(value)\n @max_silence_timeout_in_seconds = value\n end",
"def setDurationMinutes(durationMinutes) \r\n\t\t\t\t\t@durationMinutes = durationMinutes\r\n\t\t\t\tend",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_max(max)\n self[:max] = (max > 0 ? max : 1)\n end",
"def duration=(duration)\n\t\t@duration = duration if duration.present?\n\tend",
"def max_duration=(duration)\n nodes = @nodes.to_a\n add_edge(nodes.last, nodes.first, -duration)\n duration\n end",
"def lifetime_in_minutes=(value)\n @lifetime_in_minutes = value\n end",
"def max_session_duration \n @max_session_duration ||= 15.minutes\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_max( max )\n if IntegerOption.bounds_ok?( @min, max )\n @max = max\n else\n @max = nil\n raise \"invalid upper bound: #{ max.to_s }\"\n end\n end",
"def meeting_duration=(value)\n @meeting_duration = value\n end",
"def max_time\n @max_time ||= 0.2\n end",
"def set_duration\n if self.end_time\n # self.duration = (end_time - start_time).to_i\n self.duration = (end_time - start_time).to_i\n else\n self.duration = DEFAULT_DURATION\n self.end_time = self.start_time + self.duration\n end\n end",
"def max_idle_time\n @max_idle_time ||= options[:max_idle_time]\n end",
"def SetMaxQueryTime(max)\n assert { max.instance_of? Fixnum }\n assert { max >= 0 }\n @maxquerytime = max\n end",
"def expires_in=(duration)\n self.expires_at = duration.from_now\n end",
"def set_Maximum(value)\n set_input(\"Maximum\", value)\n end",
"def set_max_wait_time\n q = 'Set the MAX WAIT TIME after executing the RESTART command ' \\\n '(>= 180 secs): '\n until @max_wait && @max_wait.to_i > 179\n @max_wait = Utils.qna(q.cyan, true)\n end\n end",
"def max_age= age\n @grpc.max_age = Convert.number_to_duration(age)\n end",
"def maxage=(maxage)\n\t\t# {{{\n\t\tif maxage.class == Time\n\t\t\tmaxage = maxage - Time.now\n\t\telsif maxage.class.superclass == Integer || !maxage == nil\n\t\t\traise TypeError, \"The maxage of a cookie must be an Interger or Time object or nil.\", caller\n\t\tend\n\t\t@maxage = maxage\n\t\t# }}}\n\tend",
"def max_age=(value)\n self.cache_control = cache_control.merge('max-age' => value.to_s)\n end",
"def set_DailyDuration(value)\n set_input(\"DailyDuration\", value)\n end",
"def max_age_seconds(maxAgeSeconds=nil)\n if maxAgeSeconds.class == Fixnum && !block_given?\n @j_del.java_method(:maxAgeSeconds, [Java::int.java_class]).call(maxAgeSeconds)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling max_age_seconds(maxAgeSeconds)\"\n end",
"def timeout=(new_timeout)\n if new_timeout && new_timeout.to_f < 0\n raise ArgumentError, \"Timeout must be a positive number\"\n end\n @timeout = new_timeout.to_f\n end",
"def set_max_file_size\n @video_files.each do |file, size|\n if size >= FOUR_GIGABYTES\n @max_file_size = FOUR_GIGABYTES\n break\n end\n end\n end",
"def maximum_outbound_round_trip_delay=(value)\n @maximum_outbound_round_trip_delay = value\n end",
"def duration_in_seconds=(value)\n @duration_in_seconds = value\n end",
"def duration_before_automatic_denial=(value)\n @duration_before_automatic_denial = value\n end",
"def expiration=(value)\n @expiration = value\n end",
"def max_size\n @max_size ||= options[:max_size] || [DEFAULT_MAX_SIZE, min_size].max\n end",
"def set_MaxUploadDate(value)\n set_input(\"MaxUploadDate\", value)\n end",
"def set_MaxUploadDate(value)\n set_input(\"MaxUploadDate\", value)\n end",
"def set_MaxUploadDate(value)\n set_input(\"MaxUploadDate\", value)\n end",
"def set_MaxUploadDate(value)\n set_input(\"MaxUploadDate\", value)\n end",
"def set_MaxUploadDate(value)\n set_input(\"MaxUploadDate\", value)\n end",
"def set_MaxUploadDate(value)\n set_input(\"MaxUploadDate\", value)\n end",
"def max=(length)\n @string_rule.max = length\n end",
"def max_image_size=(value)\n @max_image_size = value\n end",
"def timeout=(timeout)\n @timeout = timeout.to_f/1000 * 60\n end",
"def max_speed\n @max_speed ||= read_attribute('max_speed').to_i\n end",
"def max=(value)\r\n @max = value\r\n shift while @store.length > @max\r\n end",
"def set_duration_override(duration)\n @duration = colon_time_to_seconds(duration)\n end",
"def validates_max_length(max, atts, opts={})\n validatable_attributes(atts, opts){|a,v,m| (m || \"is longer than #{max} characters\") unless v && v.length <= max}\n end",
"def maximal_length\n if !self.value.blank? && self.maxLength\n errors.add(:value, 'is too long!') if self.value.length > self.maxLength\n end\n end",
"def grace_duration=(grace_duration)\n\n if !grace_duration.nil? && grace_duration < 0\n fail ArgumentError, \"invalid value for 'grace_duration', must be greater than or equal to 0.\"\n end\n\n @grace_duration = grace_duration\n end",
"def adjust_duration\n # convert minutes into seconds\n self.duration = duration.to_i * 60\n end",
"def reverse_max_age=(value)\n self.cache_control = cache_control.merge('r-maxage' => value.to_s)\n end",
"def item_max=(value)\n @item_max = value\n end",
"def maximum_advance=(value)\n @maximum_advance = value\n end",
"def set_maxsize(options)\n if options.has_key?(:maxsize) || options.has_key?('maxsize')\n maxsize = options[:maxsize] || options['maxsize']\n\n multiplier = 1\n if (maxsize =~ /\\d+KB/)\n multiplier = 1024\n elsif (maxsize =~ /\\d+MB/)\n multiplier = 1024 * 1024\n elsif (maxsize =~ /\\d+GB/)\n multiplier = 1024 * 1024 * 1024\n end\n\n _maxsize = maxsize.to_i * multiplier\n\n if _maxsize.class != Fixnum and _maxsize.class != Bignum\n raise TypeError, \"Argument 'maxsize' must be an Fixnum\", caller\n end\n if _maxsize == 0\n raise TypeError, \"Argument 'maxsize' must be > 0\", caller\n end\n @maxsize = _maxsize\n else\n @maxsize = 0\n end\n end",
"def ttl=(seconds)\n self.shared_max_age = age + seconds\n end",
"def set_MaxLongitude(value)\n set_input(\"MaxLongitude\", value)\n end",
"def set_MaxLongitude(value)\n set_input(\"MaxLongitude\", value)\n end",
"def set_timeout(value)\n if value.nil?\n @timeout = 2\n else\n return skip_resource 'timeout is not numeric' unless value.to_s =~ /^\\d+$/\n @timeout = value\n end\n end",
"def timeout=(value)\n @timeout = value\n end",
"def set_EndSleepTime(value)\n set_input(\"EndSleepTime\", value)\n end",
"def add_max_time(current_string)\n add_if_present(@max_time, current_string, \" -max-time #{@max_time} \")\n end",
"def timeout=(value)\n @transfer[:timeout] = value\n end",
"def max_size_bytes=(value)\n @children['max-size-bytes'][:value] = value\n end",
"def max_interval\n MAX_INTERVAL\n end",
"def max_recv_speed_large=(value)\n Curl.set_option(:max_recv_speed_large, value_for(value, :int), handle)\n end",
"def max_size_in_megabytes\n to_i description['MaxSizeInMegabytes']\n end",
"def set_idle_time_limit(opts)\n opts = check_params(opts,[:time_limits])\n super(opts)\n end"
] | [
"0.7354659",
"0.70358676",
"0.6625368",
"0.6619562",
"0.661018",
"0.659481",
"0.659481",
"0.659481",
"0.659481",
"0.659481",
"0.6467129",
"0.63928545",
"0.63776976",
"0.63632476",
"0.633555",
"0.6335292",
"0.6335292",
"0.6314366",
"0.628917",
"0.6260467",
"0.621436",
"0.6213668",
"0.6184139",
"0.6179088",
"0.6160653",
"0.6158376",
"0.61043924",
"0.6098939",
"0.6059697",
"0.6059697",
"0.6059697",
"0.6059697",
"0.6028429",
"0.6015188",
"0.60144824",
"0.60104686",
"0.5988759",
"0.5917085",
"0.5917085",
"0.5917085",
"0.5917085",
"0.5917085",
"0.5917085",
"0.5917085",
"0.5917085",
"0.5917085",
"0.59102595",
"0.58973765",
"0.5895633",
"0.58797354",
"0.5878797",
"0.58751154",
"0.579291",
"0.57799786",
"0.5772518",
"0.57710123",
"0.5753529",
"0.5740924",
"0.57139826",
"0.5695563",
"0.56486034",
"0.5629247",
"0.5620635",
"0.5603637",
"0.55694073",
"0.5561452",
"0.5559408",
"0.5551795",
"0.5551795",
"0.5551795",
"0.5551795",
"0.5551795",
"0.5551795",
"0.55405915",
"0.5530682",
"0.55108327",
"0.5482838",
"0.546946",
"0.5467778",
"0.5465424",
"0.5460167",
"0.5454391",
"0.54517585",
"0.5446362",
"0.544447",
"0.5434334",
"0.5406699",
"0.539954",
"0.53940296",
"0.53940296",
"0.5384292",
"0.53820425",
"0.53819156",
"0.537072",
"0.53694934",
"0.5356011",
"0.53419507",
"0.53376603",
"0.5327156",
"0.53145194"
] | 0.86637014 | 0 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_boolean_value("isExpirationRequired", @is_expiration_required)
writer.write_duration_value("maximumDuration", @maximum_duration)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
"def serialize\n self.to_hash.to_json\n end",
"def serialized\n serializer_class.new(self).serializable_hash\n end",
"def serialize\n @raw_data\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"identityType\", @identity_type)\n end",
"def serialize\n @serializer.serialize(self.output)\n end",
"def serialize(_object, data); end",
"def serialize(_object, data); end",
"def to_json\n\t\t\tself.instance_variable_hash\n\t\tend",
"def serializer; end",
"def serialize!\n end",
"def serialize(object)\n object.serializable_hash\n end",
"def serialize(object)\n object.to_s\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"device\", @device)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"keyStrength\", @key_strength)\n end",
"def marshal\n Marshal.dump self\n end",
"def marshal\n Marshal.dump self\n end",
"def marshal\n Marshal.dump self\n end",
"def inspect\n serialize.to_s\n end",
"def serialize\n YAML::dump(self)\n end",
"def inspect()\n serialize.to_s()\n end",
"def inspect()\n serialize.to_s()\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_collection_of_object_values(\"answers\", @answers)\n writer.write_object_value(\"assignment\", @assignment)\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionCalloutInstances\", @custom_extension_callout_instances)\n writer.write_enum_value(\"requestType\", @request_type)\n writer.write_object_value(\"requestor\", @requestor)\n writer.write_object_value(\"schedule\", @schedule)\n writer.write_enum_value(\"state\", @state)\n writer.write_string_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"initiator\", @initiator)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_date_time_value(\"visibleHistoryStartDateTime\", @visible_history_start_date_time)\n end",
"def inspect\n fields = serializable_hash.map { |k, v| \"#{k}=#{v}\" }\n \"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end",
"def serialize(object, data); end",
"def serialize\n JSON.generate(to_h)\n end",
"def serialiaze\n Logger.d(\"Serializing the User object\")\n save_to_shared_prefs(@context, self.class, self)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"life\", @life)\n writer.write_object_value(\"per\", @per)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end",
"def inspect\n id_string = (respond_to?(:id) && !id.nil?) ? \" id=#{id}\" : ''\n \"#<#{self.class}:0x#{object_id.to_s(16)}#{id_string}> JSON: \" +\n Clever::JSON.dump(@values, pretty: true)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"owner\", @owner)\n writer.write_collection_of_object_values(\"properties\", @properties)\n writer.write_string_value(\"status\", @status)\n writer.write_collection_of_primitive_values(\"targetTypes\", @target_types)\n end",
"def write\n hash = attributes_hash\n write_value(serializer_class.dump(hash))\n @_cache = hash # set @_cache after the write\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"dataType\", @data_type)\n writer.write_boolean_value(\"isSyncedFromOnPremises\", @is_synced_from_on_premises)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_primitive_values(\"targetObjects\", @target_objects)\n end",
"def instance_to_json\n\t\t# byebug\n\t\t{\n\t\tid: self.id,\n\t\tname: self.name,\n\t\theight: self.height,\n\t\tlast_watered: self.last_watered,\n\t\tlast_watered_amount: self.last_watered_amount,\n\t\tgrow_zone: self.grow_zone,\n\t\tnotes: self.notes,\n\t\tplanted_date: self.planted_date,\n\t\tfarm: self.farm,\t\n\t\tsensor: self.sensor\n\t\t# farm: { \n\t\t# \tfarm: self.farm.name,\n\t\t# \tfarm: self.farm.id,\n\t\t# },\n\t\t}\n\tend",
"def _dump(depth)\n scrooge_fetch_remaining\n scrooge_invalidate_updateable_result_set\n scrooge_dump_flag_this\n str = Marshal.dump(self)\n scrooge_dump_unflag_this\n str\n end",
"def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end",
"def to_dump\n @time = Time.now\n Base64.encode64(Marshal.dump(self))\n end",
"def dump\n\t\t\t\tflatten!\n\t\t\t\t\n\t\t\t\tMessagePack.dump(@attributes)\n\t\t\tend",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def serialize(options={})\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"apiConnectorConfiguration\", @api_connector_configuration)\n writer.write_collection_of_object_values(\"identityProviders\", @identity_providers)\n writer.write_collection_of_object_values(\"languages\", @languages)\n writer.write_collection_of_object_values(\"userAttributeAssignments\", @user_attribute_assignments)\n writer.write_collection_of_object_values(\"userFlowIdentityProviders\", @user_flow_identity_providers)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"clientContext\", @client_context)\n writer.write_object_value(\"resultInfo\", @result_info)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_number_value(\"memberCount\", @member_count)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_enum_value(\"tagType\", @tag_type)\n writer.write_string_value(\"teamId\", @team_id)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_object_value(\"resource\", @resource)\n writer.write_object_value(\"weight\", @weight)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"comment\", @comment)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"deletedDateTime\", @deleted_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_boolean_value(\"hostOnly\", @host_only)\n writer.write_string_value(\"hostOrDomain\", @host_or_domain)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"path\", @path)\n writer.write_enum_value(\"sourceEnvironment\", @source_environment)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"category\", @category)\n writer.write_date_time_value(\"firstSeenDateTime\", @first_seen_date_time)\n writer.write_object_value(\"host\", @host)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"large\", @large)\n writer.write_object_value(\"medium\", @medium)\n writer.write_object_value(\"small\", @small)\n writer.write_object_value(\"source\", @source)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_enum_value(\"allowedTargetScope\", @allowed_target_scope)\n writer.write_object_value(\"automaticRequestSettings\", @automatic_request_settings)\n writer.write_object_value(\"catalog\", @catalog)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionStageSettings\", @custom_extension_stage_settings)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"expiration\", @expiration)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"questions\", @questions)\n writer.write_object_value(\"requestApprovalSettings\", @request_approval_settings)\n writer.write_object_value(\"requestorSettings\", @requestor_settings)\n writer.write_object_value(\"reviewSettings\", @review_settings)\n writer.write_collection_of_object_values(\"specificAllowedTargets\", @specific_allowed_targets)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"key\", @key)\n writer.write_enum_value(\"volumeType\", @volume_type)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"assignedTo\", @assigned_to)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"dataSubject\", @data_subject)\n writer.write_enum_value(\"dataSubjectType\", @data_subject_type)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_object_value(\"insight\", @insight)\n writer.write_date_time_value(\"internalDueDateTime\", @internal_due_date_time)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"regulations\", @regulations)\n writer.write_collection_of_object_values(\"stages\", @stages)\n writer.write_enum_value(\"status\", @status)\n writer.write_object_value(\"team\", @team)\n writer.write_enum_value(\"type\", @type)\n end",
"def serializable_hash\n self.attributes\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_string_value(\"joinWebUrl\", @join_web_url)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"modalities\", @modalities)\n writer.write_object_value(\"organizer\", @organizer)\n writer.write_collection_of_object_values(\"participants\", @participants)\n writer.write_collection_of_object_values(\"sessions\", @sessions)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_enum_value(\"type\", @type)\n writer.write_object_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"axes\", @axes)\n writer.write_object_value(\"dataLabels\", @data_labels)\n writer.write_object_value(\"format\", @format)\n writer.write_object_value(\"height\", @height)\n writer.write_object_value(\"left\", @left)\n writer.write_object_value(\"legend\", @legend)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_object_values(\"series\", @series)\n writer.write_object_value(\"title\", @title)\n writer.write_object_value(\"top\", @top)\n writer.write_object_value(\"width\", @width)\n writer.write_object_value(\"worksheet\", @worksheet)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"name\", @name)\n writer.write_enum_value(\"scenarios\", @scenarios)\n end",
"def serialize\n JSON.dump(@hash)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_boolean_value(\"isUsable\", @is_usable)\n writer.write_boolean_value(\"isUsableOnce\", @is_usable_once)\n writer.write_number_value(\"lifetimeInMinutes\", @lifetime_in_minutes)\n writer.write_string_value(\"methodUsabilityReason\", @method_usability_reason)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_string_value(\"temporaryAccessPass\", @temporary_access_pass)\n end",
"def to_s\r\n dump\r\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"callee\", @callee)\n writer.write_object_value(\"caller\", @caller)\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_object_value(\"failureInfo\", @failure_info)\n writer.write_collection_of_object_values(\"media\", @media)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"deviceCount\", @device_count)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"managedDevices\", @managed_devices)\n writer.write_enum_value(\"platform\", @platform)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_object_value(\"sizeInByte\", @size_in_byte)\n writer.write_string_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_string_value(\"roleTemplateId\", @role_template_id)\n writer.write_collection_of_object_values(\"scopedMembers\", @scoped_members)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"options\", @options)\n writer.write_boolean_value(\"protected\", @protected)\n end",
"def serialize(io)\n Encoder.encode(io, self)\n io\n end",
"def _dump() end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"authenticationConfiguration\", @authentication_configuration)\n writer.write_object_value(\"clientConfiguration\", @client_configuration)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"endpointConfiguration\", @endpoint_configuration)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"container\", @container)\n writer.write_string_value(\"containerId\", @container_id)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_object_value(\"member\", @member)\n writer.write_string_value(\"memberId\", @member_id)\n writer.write_enum_value(\"outlierContainerType\", @outlier_container_type)\n writer.write_enum_value(\"outlierMemberType\", @outlier_member_type)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"body\", @body)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"imageUrl\", @image_url)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_date_time_value(\"lastUpdatedDateTime\", @last_updated_date_time)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_string_value(\"title\", @title)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"progress\", @progress)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"storageLocation\", @storage_location)\n writer.write_date_time_value(\"submittedDateTime\", @submitted_date_time)\n writer.write_string_value(\"userId\", @user_id)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"accessPackages\", @access_packages)\n writer.write_enum_value(\"catalogType\", @catalog_type)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customWorkflowExtensions\", @custom_workflow_extensions)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isExternallyVisible\", @is_externally_visible)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"resourceRoles\", @resource_roles)\n writer.write_collection_of_object_values(\"resourceScopes\", @resource_scopes)\n writer.write_collection_of_object_values(\"resources\", @resources)\n writer.write_enum_value(\"state\", @state)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"bundles\", @bundles)\n writer.write_string_value(\"driveType\", @drive_type)\n writer.write_collection_of_object_values(\"following\", @following)\n writer.write_collection_of_object_values(\"items\", @items)\n writer.write_object_value(\"list\", @list)\n writer.write_object_value(\"owner\", @owner)\n writer.write_object_value(\"quota\", @quota)\n writer.write_object_value(\"root\", @root)\n writer.write_object_value(\"sharePointIds\", @share_point_ids)\n writer.write_collection_of_object_values(\"special\", @special)\n writer.write_object_value(\"system\", @system)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"feature\", @feature)\n writer.write_string_value(\"featureGroup\", @feature_group)\n writer.write_string_value(\"impactDescription\", @impact_description)\n writer.write_boolean_value(\"isResolved\", @is_resolved)\n writer.write_enum_value(\"origin\", @origin)\n writer.write_collection_of_object_values(\"posts\", @posts)\n writer.write_string_value(\"service\", @service)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"connectors\", @connectors)\n writer.write_boolean_value(\"hasPhysicalDevice\", @has_physical_device)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_date_time_value(\"registeredDateTime\", @registered_date_time)\n writer.write_collection_of_object_values(\"shares\", @shares)\n writer.write_collection_of_object_values(\"taskTriggers\", @task_triggers)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_collection_of_object_values(\"deviceStates\", @device_states)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_object_value(\"installSummary\", @install_summary)\n writer.write_object_value(\"largeCover\", @large_cover)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_date_time_value(\"publishedDateTime\", @published_date_time)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_collection_of_object_values(\"userStateSummary\", @user_state_summary)\n end",
"def inspect\n attributes = [\n \"name=#{name.inspect}\",\n \"key=#{key.inspect}\",\n \"data_type=#{data_type.inspect}\",\n ]\n \"#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_collection_of_object_values(\"categories\", @categories)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"developer\", @developer)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_object_value(\"largeIcon\", @large_icon)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"notes\", @notes)\n writer.write_string_value(\"owner\", @owner)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_enum_value(\"publishingState\", @publishing_state)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"platformType\", @platform_type)\n writer.write_number_value(\"settingCount\", @setting_count)\n writer.write_collection_of_object_values(\"settingStates\", @setting_states)\n writer.write_enum_value(\"state\", @state)\n writer.write_number_value(\"version\", @version)\n end",
"def _dump()\n #This is a stub, used for indexing\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"templateId\", @template_id)\n writer.write_collection_of_object_values(\"values\", @values)\n end",
"def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"containers\", @containers)\n writer.write_object_value(\"controller\", @controller)\n writer.write_collection_of_object_values(\"ephemeralContainers\", @ephemeral_containers)\n writer.write_collection_of_object_values(\"initContainers\", @init_containers)\n writer.write_object_value(\"labels\", @labels)\n writer.write_string_value(\"name\", @name)\n writer.write_object_value(\"namespace\", @namespace)\n writer.write_object_value(\"podIp\", @pod_ip)\n writer.write_object_value(\"serviceAccount\", @service_account)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"detectionStatus\", @detection_status)\n writer.write_object_value(\"imageFile\", @image_file)\n writer.write_string_value(\"mdeDeviceId\", @mde_device_id)\n writer.write_date_time_value(\"parentProcessCreationDateTime\", @parent_process_creation_date_time)\n writer.write_object_value(\"parentProcessId\", @parent_process_id)\n writer.write_object_value(\"parentProcessImageFile\", @parent_process_image_file)\n writer.write_string_value(\"processCommandLine\", @process_command_line)\n writer.write_date_time_value(\"processCreationDateTime\", @process_creation_date_time)\n writer.write_object_value(\"processId\", @process_id)\n writer.write_object_value(\"userAccount\", @user_account)\n end",
"def inspect\n self.to_hash.inspect\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"administrativeUnits\", @administrative_units)\n writer.write_collection_of_object_values(\"attributeSets\", @attribute_sets)\n writer.write_collection_of_object_values(\"customSecurityAttributeDefinitions\", @custom_security_attribute_definitions)\n writer.write_collection_of_object_values(\"deletedItems\", @deleted_items)\n writer.write_collection_of_object_values(\"federationConfigurations\", @federation_configurations)\n writer.write_collection_of_object_values(\"onPremisesSynchronization\", @on_premises_synchronization)\n end",
"def inspect\n \"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: \" +\n JSON.pretty_generate(@data)\n end",
"def encode\n raise Errors::SerializerNotConfigured if serializer_missing?\n\n serializer.encode(self)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"activationUrl\", @activation_url)\n writer.write_string_value(\"activitySourceHost\", @activity_source_host)\n writer.write_string_value(\"appActivityId\", @app_activity_id)\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_object_value(\"contentInfo\", @content_info)\n writer.write_string_value(\"contentUrl\", @content_url)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_string_value(\"fallbackUrl\", @fallback_url)\n writer.write_collection_of_object_values(\"historyItems\", @history_items)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"userTimezone\", @user_timezone)\n writer.write_object_value(\"visualElements\", @visual_elements)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"basis\", @basis)\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"datePurchased\", @date_purchased)\n writer.write_object_value(\"firstPeriod\", @first_period)\n writer.write_object_value(\"period\", @period)\n writer.write_object_value(\"rate\", @rate)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end",
"def serialize(writer) \n super\n writer.write_collection_of_primitive_values(\"categories\", @categories)\n writer.write_string_value(\"changeKey\", @change_key)\n writer.write_date_value(\"createdDateTime\", @created_date_time)\n writer.write_date_value(\"lastModifiedDateTime\", @last_modified_date_time)\n end"
] | [
"0.7951372",
"0.7645999",
"0.7579812",
"0.7579812",
"0.7440032",
"0.720861",
"0.720861",
"0.7207583",
"0.7016516",
"0.70007193",
"0.6992252",
"0.69838214",
"0.69723576",
"0.69666415",
"0.69666415",
"0.6942002",
"0.69417155",
"0.6933786",
"0.6913977",
"0.6891677",
"0.68810964",
"0.687664",
"0.687664",
"0.687664",
"0.6875119",
"0.68510306",
"0.68364877",
"0.68364877",
"0.6825542",
"0.6815931",
"0.68061364",
"0.68006235",
"0.67944074",
"0.67717844",
"0.67341864",
"0.67289317",
"0.66964674",
"0.66828746",
"0.6673492",
"0.6668077",
"0.6666333",
"0.6659732",
"0.6656788",
"0.66513675",
"0.6635875",
"0.66275525",
"0.66275525",
"0.66275525",
"0.6627384",
"0.66165835",
"0.66141444",
"0.6611379",
"0.6597342",
"0.65968686",
"0.6594517",
"0.6592636",
"0.6583964",
"0.6580536",
"0.65803635",
"0.6575503",
"0.65716475",
"0.65712893",
"0.6566952",
"0.6560253",
"0.65554273",
"0.65410006",
"0.65378475",
"0.65346783",
"0.6527361",
"0.6525178",
"0.65242875",
"0.65235287",
"0.65174305",
"0.65141636",
"0.6508169",
"0.6499713",
"0.6498714",
"0.6496881",
"0.6486202",
"0.6482482",
"0.64814615",
"0.6479782",
"0.6476621",
"0.6475453",
"0.64677024",
"0.64633876",
"0.64619535",
"0.6461202",
"0.6457243",
"0.64497435",
"0.6439583",
"0.6433183",
"0.643078",
"0.6424316",
"0.6420337",
"0.6420337",
"0.6420337",
"0.6420337",
"0.6420337",
"0.6418776",
"0.64156514"
] | 0.0 | -1 |
'strong parameters' allow us to specify which parameters are required and which are permitted | def user_params
params.require(:user).permit(:name, :email, :password, :password_confirmation)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_params; true; end",
"def valid_params?; end",
"def valid_params_request?; end",
"def optional_parameters\n must_be_defined_in_derived_class\n end",
"def parameter_rule?; end",
"def accepted_parameters\n required_parameters + optional_parameters\n end",
"def check_params\n true\n end",
"def requires!(hash, *params)\n params.each do |param|\n if param.is_a?(Array)\n raise ArgumentError.new(\"Missing required parameter: #{param.first}\") unless hash.has_key?(param.first) || hash.has_key?(param.first.to_s)\n\n valid_options = param[1..-1]\n raise ArgumentError.new(\"Parameter: #{param.first} must be one of #{valid_options.to_sentence(:words_connector => 'or')}\") unless valid_options.include?(hash[param.first]) || valid_options.include?(hash[param.first.to_s])\n else\n raise ArgumentError.new(\"Missing required parameter: #{param}\") unless hash.has_key?(param) || hash.has_key?(param.to_s)\n end\n end\n end",
"def validate_params!\n self.params ||= Hash.new\n self.class.instance_variable_get(:@__required_params).each do |e|\n raise ArgumentError, \"Insufficient parameters set (#{e} not supplied)\" if self.params[e].nil?\n end\n end",
"def validate_paramters\n raise Scorekeeper::MissingParameterException if @income.nil? || @zipcode.nil? || @age.nil?\n end",
"def ensure_params(*req)\n missing = []\n req.flatten.each do |param|\n if params[param].blank?\n missing << param.to_s\n end\n end\n if missing.empty?\n return false\n else\n msg = \"Following params are required but missing: \" + missing.join(\", \")\n render_api_error(11 , 400, 'params', msg)\n return true\n end\n end",
"def validate_params(params)\n # This will be implemented by Validators which take parameters\n end",
"def validate_params_present!\n raise ArgumentError, \"Please provide one or more of: #{ACCEPTED_PARAMS}\" if params.blank?\n end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def validate_parameters params = {}\n params.symbolize_keys!\n params.delete(:db) unless DBS.include?(params[:db].try(:to_sym))\n params.delete(:report_type) unless REPORT_TYPES.include?(params[:report_type].try(:to_sym))\n params.delete(:request_type) unless REQUEST_TYPES.include?(params[:request_type].try(:to_sym))\n @parameters = {:db => \"us\", :api_key => Semrush.api_key, :limit => \"\", :offset => \"\", :export_columns => \"\", :display_sort => \"\", :display_filter => \"\", :display_date => \"\"}.merge(@parameters).merge(params)\n raise Semrush::Exception::Nolimit.new(self, \"The limit parameter is missing: a limit is required.\") unless @parameters[:limit].present? && @parameters[:limit].to_i>0\n raise Semrush::Exception::BadArgument.new(self, \"Request parameter is missing: Domain name, URL, or keywords are required.\") unless @parameters[:request].present?\n raise Semrush::Exception::BadArgument.new(self, \"Bad db: #{@parameters[:db]}\") unless DBS.include?(@parameters[:db].try(:to_sym))\n raise Semrush::Exception::BadArgument.new(self, \"Bad report type: #{@parameters[:report_type]}\") unless REPORT_TYPES.include?(@parameters[:report_type].try(:to_sym))\n raise Semrush::Exception::BadArgument.new(self, \"Bad request type: #{@parameters[:request_type]}\") unless REQUEST_TYPES.include?(@parameters[:request_type].try(:to_sym))\n end",
"def optionalParameters(a,b,*c)\n #some code\nend",
"def validate_params?\n true # TODO: add validation\n end",
"def parameters(params)\n allowed = [:start,:num,:type,:id,:filter,:tagged,:search,:state,:email,:password]\n params.merge! defaults if defaults\n params.reject {|key,value| !allowed.include? key }\n end",
"def required_parameters\n must_be_defined_in_derived_class\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def validate_parameters?(op)\n temp_params = op.temporary[:plan_params]\n errors_noted = \"The following parameters for plan #{op.plan.id} have errors: \"\n er = false\n if temp_params[:fluorescent_marker]\n errors_noted.concat(\"dark_light invalid\") && er = true if !static_params[:dark_light_options].include? temp_params[:dark_light]\n errors_noted.concat(\"marker_type not supported\") && er = true if !static_params[:marker_type_options].include? temp_params[:marker_type]\n end\n op.error :invalid_parameters, errors_noted if er\n op.temporary[:valid_params?] = !er\n end",
"def requires!\n @required_params.each do |param| \n key = (param.is_a?(Array) ? param.first : param)\n verify_required_param(key)\n end\n end",
"def validate_parameters\n if (latitude.to_f == 0.0) || (longitude.to_f == 0.0)\n render :status=>401,\n :json=>{:Message=>\"The latitude and longitude parameters should be float values.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n if (location_lock != \"true\") || (location_lock != \"false\")\n render :status=>401,\n :json=>{:Message=>\"The location_lock should be either true or false.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n if proximity.to_i == 0\n render :status=>401,\n :json=>{:Message=>\"The proximity should be an integer.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n if page.to_i == 0\n render :status=>401,\n :json=>{:Message=>\"The page should be an integer.\",\n :Response => \"Fail\",\n :Data => nil} \n end\n end",
"def require_params *keys\n filter_strong_params :require, [:create, :update], keys\n end",
"def valid_for_params_auth?; end",
"def validateParams \r\n\t \r\n\t \tif !@data.nil? && !@key.nil? && !@cipher.nil?\r\n\t\t\treturn true\r\n\t \telse\r\n\t\t\treturn false \t\r\n\t \tend\r\n\t \t\r\n\t end",
"def assumption_params\n attribute_for_all = [:name, :description, :type,]\n array_for_all = {required_by_ids: [], model_ids: []}\n res = if (params[:query_assumption])\n params.require(:query_assumption).permit(attribute_for_all, :question, :argument_inverted, array_for_all)\n elsif (params[:blank_assumption])\n params.require(:blank_assumption).permit(attribute_for_all, :argument_inverted, array_for_all, assumption_ids: [])\n elsif (params[:test_assumption])\n params.require(:test_assumption).permit(attribute_for_all, :r_code, :argument_inverted, array_for_all, required_dataset_fields: [])\n elsif (params[:query_test_assumption])\n params.require(:query_test_assumption).permit(attribute_for_all, :r_code, :argument_inverted, :question, :argument_inverted, array_for_all, required_dataset_fields: [])\n else\n {}\n end\n res[:user] = current_user\n res\n end",
"def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"def check_required_params\n errors = required_params.map { |param, value| raise param_errors[param] if value.nil? }.compact\n raise errors.joins('; ') unless errors.empty?\n end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def validate_create_params!(params); end",
"def parameter_types; end",
"def expected_permitted_parameter_names; end",
"def validate_params\n validate_size\n validate_mine_density\n validate_first_click\n type_specific_checks\n end",
"def permitted_create_params\n fail NotImplementedError\n end",
"def generic_params\n params.require(:generic).permit(:name, :is_combination, :rxcui, :status_id, :food_id, :hepatic_id, :renal_imp_id, :release_status_id, :is_essential)\n end",
"def validate_required_params\n required_params.each do |param|\n unless options.send(param)\n error_msg = \"omniauth-dice error: #{param} is required\"\n fail RequiredCustomParamError, error_msg\n end\n end\n end",
"def student_params(*args) #is the helper method \n\n\t\tparams.require(:student).permit(*args)\n\t\t#uses .require and .permit methods as stronger params to prevent hacks through inspect element right click edit html \n\t\t#require restricts, permit allows, and *args is for the custom arguments\n\tend",
"def unpermitted_parameters\n fail 'Define me!'\n end",
"def parameters=(_); end",
"def validate_parameters\n check_for_valid_filepath if (@repository.parameters[:file])\n\n check_number_of_parameters(:coord, 2)\n check_number_of_parameters(:delta, 2)\n check_number_of_parameters(:time, 2)\n check_number_of_parameters(:range, 2)\n check_number_of_parameters(:section, 2)\n end",
"def requires!(hash, *params)\n params.each { |param| raise RateError, \"Missing Required Parameter #{param}\" if hash[param].nil? }\n end",
"def room_params\n permited = [:title,\n :description,\n :price,\n :lat,\n :lng,\n :zone_id,\n :category_id,\n :address,\n :currency,\n :phones,\n :services,\n photos: []]\n if params[:usealt] == true || params[:usealt] == \"true\"\n # When use alt don't require an json structured payload\n params.permit(permited)\n else\n params.require(:room).permit(permited)\n end\n end",
"def validate_required(*required_parameters)\n if self[:ensure] == :present\n required_parameters.each do |req_param|\n raise ArgumentError, \"parameter '#{req_param}' is required\" if self[req_param].nil?\n end\n end\n end",
"def validate_required(*required_parameters)\n if self[:ensure] == :present\n required_parameters.each do |req_param|\n raise ArgumentError, \"parameter '#{req_param}' is required\" if self[req_param].nil?\n end\n end\n end",
"def validate_required(*required_parameters)\n if self[:ensure] == :present\n required_parameters.each do |req_param|\n raise ArgumentError, \"parameter '#{req_param}' is required\" if self[req_param].nil?\n end\n end\n end",
"def requires(*values)\n @optional_params.concat(values)\n @required_params = values\n end",
"def params_condition\n params.permit(:needed_money_spent, :needed_stock, :offer_id)\n end",
"def mandatory_params\n return {}\n end",
"def in_kwarg; end",
"def validation_parameters\n query(['ticket', ticket],\n ['service', service],\n ['pgtUrl', proxy_callback_url])\n end",
"def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\nend",
"def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\nend",
"def validate_instance\n super\n # @wfd_show/edit_paramaeters must be arrays of symbols\n @wfd_show_parameters.each_with_index do |sp,i|\n unless sp.kind_of? Symbol then\n raise ArgumentError.new( \"permitted show parameter at [ #{ i } ] = #{ sp.to_s } is not a Symbol\" )\n end\n end\n @wfd_edit_parameters.each_with_index do |ep,i|\n unless ep.kind_of? Symbol then\n raise ArgumentError.new( \"permitted edit parameter at [ #{ i } ] = #{ ep.to_s } is not a Symbol\" )\n end\n end\n # @wfd_show/edit_parameters must not have duplicates\n dup_param1 = @wfd_show_parameters.detect {|e| @wfd_show_parameters.rindex(e) != @wfd_show_parameters.index(e) }\n unless dup_param1.nil? then\n raise ArgumentError.new( \"permitted show parameter #{ dup_param1 } occurs more than once.\")\n end\n dup_param1 = @wfd_edit_parameters.detect {|e| @wfd_edit_parameters.rindex(e) != @wfd_edit_parameters.index(e) }\n unless dup_param1.nil? then\n raise ArgumentError.new( \"permitted edit parameter #{ dup_param1 } occurs more than once.\")\n end\n # intersection of both arrays should be empty because at any time\n # a parameter can only be shown or editable...\n dup_params = @wfd_show_parameters & @wfd_edit_parameters\n unless dup_params.length == 0\n raise ArgumentError.new( \"parameters #{ dup_params.to_s } are defined to both show and edit\" )\n end\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def required_params(*param_names)\n param_names.each do |param_name|\n param_name = param_name.to_sym\n if empty_param?(param_name)\n raise \"Configuration Error in #{self.class.name}: No value for #{param_name}.\"\n else\n self.class.define_method(param_name.to_s) { params[param_name].strip }\n end\n end\n end",
"def params() @param_types end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def unsolved_params\n \n end",
"def complain_params\n#params.require(:complain).permit(:title, :description, :city, :state, :country, :company)\n params.permit(:title, :description, :city, :state, :country, :company)\n end",
"def opp_params #Purpose of the opp params is for security purposes against hackers these are strong parameters\n\t\tparams.require(:opp).permit(:title, :text)\n\tend",
"def _wrap_parameters(parameters); end",
"def requirements=(_arg0); end",
"def requirements=(_arg0); end",
"def parameter_control_params\n params.require(:parameter_control).permit(:result_no, :generate_no, :e_no, :cond, :day, :mod, :cvp, :pvp)\n end",
"def update_params\n fail 'unimplemented method update_params'\n end",
"def params\n raise NotImplementedError\n end",
"def query_parameters; end",
"def check_constraint_params\n\t\tparams.require(:constraint).permit(:travel_mean, :subject, :operator, :value)\n\tend",
"def validate_params\n\n categories.each() do |key, value|\n throw RuntimeError.new(\"ERROR: category '#{key}' contains more than #{maximum_numbers_per_category} parameters. Reduce parameter count.\") if value.size >maximum_numbers_per_category\n end\n\n keys=[]\n numbers=[]\n # slicer contains parameter with number 0... therefore valid parameter numbers starts at 0\n valid_param_numbers=SetupConfiguration.parameter_range()\n\n self.parameters().each() do |p|\n\n $stderr.puts \"WARNING: parameter number 404 is reserved for machine type. you are using it for '#{p.key}'.\" if p.number.eql?(404)\n throw RuntimeError.new(\"ERROR: parameter number '#{p.number}' not supported. Number must be in range #{valid_param_numbers}.\") unless valid_param_numbers.member?(p.number)\n\n if p.param?\n if keys.include? p.key\n raise RuntimeError.new(\"ERROR: parameter key '#{p.key}' defined more than once\")\n else\n keys << p.key\n end\n\n\n if numbers.include? p.number\n raise RuntimeError.new(\"ERROR: parameter number '#{p.number}' defined more than once\")\n else\n numbers << p.number\n end\n else\n assign_param_ref(p)\n end#p.param?\n\n end\n #force fresh sort of parameters\n @parameters = nil\n end",
"def request_parameters; end",
"def validate_parameters params = {}\n params.symbolize_keys!\n params.delete(:report_type) unless ANALYTIC_TYPES.include?(params[:report_type].try(:to_sym))\n params.delete(:target_type) unless @target_types.include?(params[:target_type].try(:to_sym)) unless params[:targets]\n @parameters = {:api_key => Semrush.api_key, :limit => \"\", :offset => \"\", :export_columns => \"\",\n :target => \"\", :target_type => \"\", :targets => \"\", :target_types => \"\",\n :display_sort => \"\", :display_filter => \"\", :display_date => \"\"}.merge(@parameters).merge(params)\n # When(if) we will have another method that use `targets` as an Array(like backlinks_comparison) improve this\n # and move validations from backlinks_comparison to here\n unless @parameters[:targets]\n raise Semrush::Exception::Nolimit.new(self, \"The limit parameter is missing: a limit is required.\") unless @parameters[:limit].present? && @parameters[:limit].to_i>0\n raise Semrush::Exception::BadArgument.new(self, \"Target parameter is missing: Domain name, URL.\") unless @parameters[:target].present?\n raise Semrush::Exception::BadArgument.new(self, \"Bad report_type: #{@parameters[:report_type]}\") unless ANALYTIC_TYPES.include?(@parameters[:report_type].try(:to_sym))\n raise Semrush::Exception::BadArgument.new(self, \"Bad target_type: #{@parameters[:target_type]}\") unless @target_types.include?(@parameters[:target_type].try(:to_sym))\n end\n end",
"def params=(_); end",
"def validateParameters(params)\n if (!params.has_key?('imageDirectory')) then raise 'No image directory parameter found.' else params['imageDirectory'] = params['imageDirectory'].chomp('/') end\n if (!params.has_key?('metadataServerURL')) then raise 'No metadata server parameter found.' end\n if (!params.has_key?('publishServerURL')) then raise 'No publish server parameter found.' end\n if (!File.directory?(params['imageDirectory'])) then raise 'Image directory parameter \"'+params['imageDirectory']+'\" is not a directory.' end\n if (!File.readable?(params['imageDirectory'])) then raise 'Image directory parameter \"'+params['imageDirectory']+'\" is not readable.' end\n if (!File.writable?(params['imageDirectory'])) then raise 'Image directory parameter \"'+params['imageDirectory']+'\" is not writable.' end\n if (params.has_key?('mapID'))\n if (!params['mapID'].is_int?) then raise 'Map ID is not an integer.' else params['mapID'] = params['mapID'].to_i end\n end\n if (params.has_key?('sleepDelay'))\n if (!params['sleepDelay'].is_int?) then raise 'Sleep delay is not an integer.' else params['sleepDelay'] = params['sleepDelay'].to_i end\n end\n params['metadataServerURL'] = URI.parse(params['metadataServerURL'])\n\n # At this point, everything should be validated and correct\n params\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def is_parm?(long_form)\n return !@parm_names[long_form].nil?\n end",
"def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end"
] | [
"0.74272096",
"0.74011904",
"0.7071272",
"0.6803203",
"0.6777842",
"0.67771035",
"0.6708466",
"0.66404945",
"0.6629609",
"0.6600598",
"0.6585277",
"0.6576207",
"0.6575225",
"0.65750796",
"0.65750796",
"0.65750796",
"0.65750796",
"0.65750796",
"0.65750796",
"0.65750796",
"0.65750796",
"0.65385264",
"0.65239453",
"0.6519952",
"0.65028524",
"0.6447814",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6432621",
"0.6411452",
"0.6400558",
"0.63977915",
"0.6385646",
"0.6381645",
"0.6378086",
"0.6371329",
"0.635926",
"0.6355336",
"0.6351256",
"0.63281107",
"0.63275015",
"0.6326257",
"0.6282882",
"0.6271932",
"0.6268302",
"0.62677366",
"0.62677324",
"0.62611926",
"0.62584066",
"0.62490815",
"0.62299633",
"0.62225795",
"0.6222362",
"0.62195057",
"0.6218899",
"0.6218899",
"0.620723",
"0.62047",
"0.6189836",
"0.6172123",
"0.61652344",
"0.61638665",
"0.6163793",
"0.6151624",
"0.6134625",
"0.6134281",
"0.61245686",
"0.612202",
"0.6118936",
"0.61105573",
"0.61105543",
"0.61092716",
"0.61090654",
"0.61090654",
"0.61053455",
"0.60926145",
"0.6081941",
"0.6080397",
"0.6071791",
"0.6069307",
"0.60586035",
"0.60518956",
"0.60418427",
"0.6027441",
"0.60249484",
"0.602382",
"0.60171086"
] | 0.0 | -1 |
Demote a child work to a file set. This deletes the child work. | def to_fileset
begin
parent_work = GenericWork.find(params['parentworkid'] )
child_work = GenericWork.find(params['childworkid'] )
rescue ActiveFedora::ObjectNotFoundError, Ldp::Gone, ActiveFedora::RecordInvalid
flash[:notice] = "This item no longer exists, so it can't be promoted to a child work."
redirect_to "/works/#{parent_work.id}"
return
end
if !self.class.can_demote_to_file_set?(current_user, parent_work, child_work)
flash[:notice] = "Sorry. \"#{child_work.title.first}\" can't be demoted to a file."
redirect_to "/works/#{child_work.id}"
return
end
WorkToFilesetCompletionJob.perform_later(parent_work.id, child_work_id: child_work.id)
file_set = child_work.members.first
flash[:notice] = "\"#{file_set.title.first}\" is IN PROCESS of being demoted to a file attached to \"#{parent_work.title.first}\". All metadata associated with the child work has been deleted. You can edit the file immediately if desired."
redirect_to "/concern/parent/#{parent_work.id}/file_sets/#{file_set.id}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unlink_from_work\n work = file_set.parent\n # monkey patch\n work.total_file_size_subtract_file_set! file_set\n # monkey patch\n return unless work && (work.thumbnail_id == file_set.id || work.representative_id == file_set.id || work.rendering_ids.include?(file_set.id))\n work.thumbnail = nil if work.thumbnail_id == file_set.id\n work.representative = nil if work.representative_id == file_set.id\n work.rendering_ids -= [file_set.id]\n work.save!\n end",
"def unlink_from_work\n work = parent_for(file_set: file_set)\n return unless work && (work.thumbnail_id == file_set.id || work.representative_id == file_set.id || work.rendering_ids.include?(file_set.id))\n work.thumbnail = nil if work.thumbnail_id == file_set.id\n work.representative = nil if work.representative_id == file_set.id\n work.rendering_ids -= [file_set.id]\n work.save!\n end",
"def unlink_from_work\n work = parent_for(file_set: file_set)\n return unless work && (work.thumbnail_id == file_set.id || work.representative_id == file_set.id || work.rendering_ids.include?(file_set.id))\n work.thumbnail = nil if work.thumbnail_id == file_set.id\n work.representative = nil if work.representative_id == file_set.id\n work.rendering_ids -= [file_set.id]\n work.save!\n end",
"def mark_children_for_removal\n work_graphics.each do |work_graphic|\n work_graphic.destroy\n end\n end",
"def remove_act\n # select rep_parent if it exists\n node = self\n if !self.rep_parent.nil?\n node = self.rep_parent\n end\n\n # outdent children in case remove_act doesn't delete\n node.children.each do |child|\n child.outdent\n child.remove_act\n end\n\n # hold parent in case it need be updated\n old_parent = node.parent\n \n node.repititions.destroy_all\n node.destroy\n\n if !old_parent.nil?\n old_parent.is_complete?\n end\n end",
"def remove_act\n # outdent children in case remove_act doesn't delete\n self.children.each do |child|\n child.outdent\n child.remove_act\n end\n \n # check if parent should update completeness\n old_parent = self.parent\n\n self.permissions.destroy_all\n self.destroy\n \n # refresh parent completeness\n if !old_parent.nil?\n old_parent.is_complete?\n end\n end",
"def remove_child(child)\n ActsAsDAG::HelperMethods.unlink(self, child)\n return child\n end",
"def af_perform(work)\n attribute_map = work.permissions.map(&:to_hash)\n work.file_sets.each do |file|\n # copy and removed access to the new access with the delete flag\n file.permissions.map(&:to_hash).each do |perm|\n unless attribute_map.include?(perm)\n perm[:_destroy] = true\n attribute_map << perm\n end\n end\n # apply the new and deleted attributes\n file.permissions_attributes = attribute_map\n file.save!\n end\n end",
"def forget (parent_exp, exp)\n\n exp, fei = fetch exp\n\n #ldebug { \"forget() forgetting #{fei}\" }\n\n return if not exp\n\n parent_exp.children.delete(fei)\n\n exp.parent_id = nil\n exp.dup_environment\n exp.store_itself\n\n onotify(:forget, exp)\n\n ldebug { \"forget() forgot #{fei}\" }\n end",
"def create_intermediary_child_work(parent, file_set)\n new_child_work = GenericWork.new(title: file_set.title, creator: [current_user.user_key])\n new_child_work.apply_depositor_metadata(current_user.user_key)\n # make original fileset a member of our new child work\n self.class.add_to_parent(new_child_work, file_set, 0, make_thumbnail: true, make_representative: true)\n\n # and set the child work's metadata based on the parent work.\n\n # bibliographic\n attrs_to_copy = parent.attributes.sort.map { |a| a[0] }\n attrs_to_copy -= ['id', \"title\", 'lease_id', 'embargo_id', 'head', 'tail', 'access_control_id', 'thumbnail_id', 'representative_id' ]\n attrs_to_copy.each do |a|\n new_child_work[a] = parent[a]\n end\n\n # permissions-related\n new_child_work.visibility = parent.visibility\n new_child_work.embargo_release_date = parent.embargo_release_date\n new_child_work.lease_expiration_date = parent.lease_expiration_date\n parent_permissions = parent.permissions.map(&:to_hash)\n\n # member HAS to be saved to set it's permission attributes, not sure why.\n # extra saves make things extra slow. :(\n new_child_work.save!\n if parent_permissions.present?\n new_child_work.permissions_attributes = parent_permissions\n end\n # But now everything seems to be properly saved without need for another save.\n return new_child_work\n end",
"def remove_child child\n @children.delete child\n end",
"def remove_child (child_fei)\n\n i = @children.index(child_fei)\n\n return unless i\n\n @children.delete_at(i)\n raw_children.delete_at(i)\n @raw_rep_updated = true\n\n store_itself\n end",
"def remove_act\n # outdent children in case remove_act doesn't delete\n self.children.each do |child|\n if child.type != 'GoalTracker'\n child.outdent\n child.remove_act\n end\n end\n \n # check if parent should update completeness\n old_parent = self.parent\n\n self.state = Activity::ABANDONED\n self.save!\n \n # refresh parent completeness\n if !old_parent.nil?\n old_parent.is_complete?\n end\n end",
"def remove_child(le)\n\t\t\t@children.delete le\n\t\t\tle.parent = nil\n\t\tend",
"def delete\n extract.children.to_a.each(&:extract)\n end",
"def prune\n @parent.gemset_prune\n end",
"def destroy\n super\n\n @children.each do |_child_name, child_group|\n child_group.each(&:destroy)\n end\n\n @children = {}\n end",
"def delete\n Mutagen::Util::delete_bytes(@fileobj, @size, @offset)\n @parent_chunk.resize(@parent_chunk.data_size - @size) unless @parent_chunk.nil?\n end",
"def delete(name)\n @parent.gemset_delete(name)\n end",
"def removing_plan_relation(transaction, parent, child, relations); end",
"def destroy_and_child\n materials.each do |material|\n material.destroy\n end\n measures.each do |measure|\n measure.destroy\n end\n destroy\n end",
"def hand_off_to!(other)\n verify_hand_off_to(other)\n other.children.replace children\n other.parent = parent\n @children = EmptyClass\n @parent = nil\n end",
"def unbranch\n @child\n end",
"def remove_fileset\n\n fileset = get_the_fileset\n if fileset.nil? == false\n works = fileset.in_works\n work_id = works.empty? ? 'unknown' : works[0].id\n\n # audit the information\n WorkAudit.audit( work_id, User.cid_from_email( @api_user.email), \"File #{fileset.label}/#{fileset.title[0]} deleted\" )\n\n file_actor = ::CurationConcerns::Actors::FileSetActor.new( fileset, @api_user )\n file_actor.destroy\n render_standard_response( :ok )\n else\n render_standard_response( :not_found, 'Fileset not available' )\n end\n\n end",
"def detach(filename); end",
"def removed_child_object(child, relations)\n\t super if defined? super\n\n if !task.invalidated_terminal_flag?\n if (relations.include?(EventStructure::Forwarding) || relations.include?(EventStructure::Signal)) && \n child.respond_to?(:task) && child.task == task\n\n task.invalidate_terminal_flag\n end\n end\n\tend",
"def remove_child(child)\n @children.delete(child.name)\n child.parent = nil\n child\n end",
"def perform_remove_child(batch_client, child_id)\n self.class.make_request(client, batch_client, :remove_child, scope_parameters.merge(\n self.class.primary_key_name => primary_key,\n child_id: child_id\n ))\n end",
"def forget_removed\n action = branch_merge ? :remove : :forget\n working_changeset.deleted.each do |file|\n act action, file unless target_changeset[file]\n end\n\n unless branch_merge\n working_changeset.removed.each do |file|\n forget file unless target_changeset[file]\n end\n end\n end",
"def remove_from_parent\n @__context__.executor << FlowFiber.new { @parent.remove(self) }\n end",
"def remove\n each { |x| x.parent.children.delete(x) }\n end",
"def remove_child(child)\n if @children.delete(child)\n child.parent = nil\n end\n end",
"def remove_child node, idx, opts={}\n no('no') unless node.children[idx]\n removed = node.children[idx]\n removed.parent_clear!\n tomb = Tombstone.build removed, opts\n node.children[idx] = tomb\n removed\n end",
"def perform(file_set_id)\n file_set = query_service.find_by(id: Valkyrie::ID.new(file_set_id))\n Valkyrie::DerivativeService.for(FileSetChangeSet.new(file_set)).cleanup_derivatives\n rescue Valkyrie::Persistence::ObjectNotFoundError\n Rails.logger.error \"Unable to find FileSet #{file_set_id} for deletion, derivative files are probably left behind\"\n end",
"def remove!(child)\n @last_items_count -= +1 if child && child.last\n super\n end",
"def undelete(list)\n manifests = living_parents.map do |p|\n manifest.read changelog.read(p).manifest_node\n end\n \n # now we actually restore the files\n list.each do |file|\n unless dirstate[file].removed?\n UI.warn \"#{file} isn't being removed!\"\n else\n m = manifests[0] || manifests[1]\n data = file(f).read m[f]\n add_file file, data, m.flags(f) # add_file is wwrite in the python\n dirstate.normal f # we know it's clean, we just restored it\n end\n end\n end",
"def hand_off_to!(other)\n verify_hand_off_to(other)\n\n other.normal_children.replace normal_children\n other.fallback_child = fallback_child\n @normal_children = []\n @fallback_child = nil\n if parent\n if normal?\n parent.normal_children.delete(self)\n parent.normal_children << other\n else\n parent.fallback_child = other\n end\n other.parent = parent\n @parent = nil\n end\n end",
"def remove(child)\n# if children.delete(child)\n# scene.unindex_prop(child) if scene\n @peer.remove(child.peer)\n# end\n end",
"def destroy\n super do\n graph.delete [source.to_term, nil, nil]\n parent.delete [parent, nil, source.to_term]\n end\n end",
"def delete\n begin \n # file_assets\n file_assets.each do |file_asset|\n file_asset.delete\n end\n # We now reload the self to update that the child assets have been removed...\n reload()\n # Call ActiveFedora Deleted via super \n super()\n rescue Exception => e\n raise \"There was an error deleting the resource: \" + e.message\n end\n end",
"def batch_remove_child(batch_client, child_id = nil)\n perform_remove_child(batch_client, child_id)\n end",
"def delete_fileset( user, fileset )\n\n print \"deleting file set #{fileset.id} (#{fileset.label})... \"\n\n file_actor = ::CurationConcerns::Actors::FileSetActor.new( fileset, user )\n file_actor.destroy\n\n puts \"done\"\n\n end",
"def supplant_with (tree, opts)\n\n # at first, nuke self\n\n r = try_unpersist\n\n raise(\n \"failed to remove exp to supplant \"+\n \"#{Ruote.to_storage_id(h.fei)} #{tree.first}\"\n ) if r.respond_to?(:keys)\n\n # then re-apply\n\n if t = opts['trigger']\n tree[1]['_triggered'] = t.to_s\n end\n\n @context.storage.put_msg(\n 'apply',\n { 'fei' => h.fei,\n 'parent_id' => h.parent_id,\n 'tree' => tree,\n 'workitem' => h.applied_workitem,\n 'variables' => h.variables\n }.merge!(opts))\n end",
"def remove(output)\n @outputs.delete(output)\n output.parent = nil\n end",
"def remove_toy(child_name, toy_name)\n\tchild_id = hash_query(child_name, Children[\"children\"], 'child_name', 'child_id')\n\ttoy_id = hash_query(toy_name, Toys[\"toys\"], 'toy_name', 'toy_id')\n\tLootBag.toy_bag[child_id].delete(toy_id)\n\tupdate_file('bag.yaml', LootBag.toy_bag)\nend",
"def remove_child_object(child, relation = nil)\n if !relation\n for rel in sorted_relations\n rel.remove_relation(self, child)\n end\n else\n relation.remove_relation(self, child)\n end\n\tend",
"def reply_to_parent(workitem)\n\n @context.tracker.remove_tracker(h.fei)\n\n super(workitem)\n end",
"def remove_child child\n throw 'Removing self as child' if child == self\n\n if self.categoryChilds\n self.categoryChilds.all(target_id: child.id).destroy\n end\n\n if child.categoryParent\n if child.categoryParent.source_id == self.id\n child.categoryParent.destroy\n end\n end\n\n self.reload\n self\n end",
"def remove_children\n\t\tinterests.destroy_all\n\tend",
"def destroy\n @task.story.touch #update the story's timestamps since its hierarchy has been modified\n @task.destroy\n end",
"def read_me_delete( file_set: )\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"id=#{id}\",\n \"read_me_file_set_id=#{read_me_file_set_id}\",\n \"file_set.id=#{file_set.id}\",\n \"\" ] if umrdr_work_behavior_debug_verbose\n return unless Array( read_me_file_set_id ).first == file_set.id\n self[:read_me_file_set_id] = nil\n save!( validate: false )\n end",
"def parts_with_order_remove part\n self.parts_with_order = self.parts_with_order.reject{|master_file| master_file.pid == part.pid }\n end",
"def delete_from_disk; end",
"def clean(&block)\n @target.files.each do |object|\n unless @source.files.include? object.key\n block.call(object)\n object.destroy\n end\n end\n end",
"def remove_descendant(descendant)\n descendant.destroy\n end",
"def detach_from_parent\n return nil if parent.nil? # root\n oci = own_child_index\n parent.children.delete_at(oci) if oci\n self.parent = nil\n oci\n end",
"def delete_children(id, flowcell)\n @session.flowcell_lane.dataset.filter(:flowcell_id => id).delete\n end",
"def teardown\n @root.remove!(@left_child1)\n @root.remove!(@right_child1)\n @root = nil\n end",
"def delete(key, child)\n\t\t\t\tif key\n\t\t\t\t\t@keyed.delete(key)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t@state.delete(child)\n\t\t\tend",
"def delete_content_paths\n\n # Delete all the paths with the ancestor as the current id\n ContentPath.delete_all(:ancestor => self.id)\n\n # Delete all the paths with the descendant as the current id\n ContentPath.delete_all(:descendant => self.id)\n end",
"def delete_files\n self.bruse_files.each do |file|\n file.destroy\n end\n end",
"def remove_target_set(value)\n @children['target-set'][:value].delete(value)\n end",
"def remove!(pid)\n kill_child pid\n @pids.delete(pid)\n procline\n end",
"def detach_support_hierarchy\r\n self.aln_resource.detach_support_hierarchy\r\n self.reload \r\n self.termination_supporter = nil\r\n self.save\r\n self.detach_network\r\n end",
"def delete_children(id, flowcell)\n Lane::dataset(@session).filter(:flowcell_id => id).delete\n end",
"def destroy_cascade\n self.save\n self.children.each do |child|\n child.destroy_cascade\n end\n self.asset_ws_files.destroy\n self.permissions.destroy\n self.changes.destroy\n self.destroy\n end",
"def destroy\n\t\tFile.delete @filepath\n\t\t@data_base = nil\n\t\t@data_base.freeze\n\t\tself.freeze\n\tend",
"def run_on_deletion(paths)\n end",
"def run_on_deletion(paths)\n end",
"def delete_file\n @file = []\n end",
"def detach parent\n\n # the ordinary *able table\n parent.send( self.class.to_s.underscore.pluralize).delete self\n\n # case child.class.to_s\n # when \"Event\",\"WageEvent\"\n # ev = Eventable.where( event: child, eventable: self)\n # ev.delete_all\n # when \"Printer\"\n # pr = Printable.where( printer: child, printable: self)\n # pr.delete_all\n # else\n # children = eval child.class.to_s.downcase.pluralize\n # children.delete child\n # end\n rescue\n false\n end",
"def test_remove_a_file\n a.rm(\"one\").commit(\"a removed one\")\n \n assert_equal nil, a['one']\n assert_equal \"one content\", b['one']\n \n b.pull\n \n assert_equal nil, a['one']\n assert_equal nil, b['one']\n \n assert_log_equal [\n \"a added one\",\n \"a removed one\"\n ], b\n end",
"def detach()\n @left.detach\n @right.detach\n @results.clear\n end",
"def purge\n self.files.each do |f|\n f.destroy\n end\n self.commits.each do |c|\n c.destroy\n end\n end",
"def destroy_a_work(work:)\n work.destroy\n end",
"def destroy_a_work(work:)\n work.destroy\n end",
"def reap_children\n @child_list.each do |pid|\n Process.kill('SIGKILL', pid)\n\t Process.wait pid\n end\n end",
"def markToDelete\n #N Without this we won't remember that this file is to be deleted\n @toBeDeleted = true\n end",
"def remove_from_parents\n ordered_by.each do |parent|\n parent.ordered_members.delete(self) # Delete the list node\n parent.members.delete(self) # Delete the indirect container Proxy\n parent.save! # record the changes to the ordered members\n end\n end",
"def removed_signal(child)\n\t super\n invalidate_task_terminal_flag_if_needed(child)\n\tend",
"def delete_child(renderer)\n @containers.last().delete_child(renderer)\n end",
"def remove_from_parent\n @change_set = ChangeSet.for(resource)\n parent_resource = find_resource(parent_resource_params[:id])\n authorize! :update, parent_resource\n\n parent_change_set = ChangeSet.for(parent_resource)\n current_member_ids = parent_resource.member_ids\n parent_change_set.member_ids = current_member_ids - [resource.id]\n\n obj = nil\n change_set_persister.buffer_into_index do |persist|\n obj = persist.save(change_set: parent_change_set)\n end\n after_update_success(obj, @change_set)\n rescue Valkyrie::Persistence::ObjectNotFoundError => e\n after_update_error e\n end",
"def graft!(other)\n verify_graft(other)\n other.parent = parent\n parent.children.add other\n parent.children.delete self\n end",
"def removed_signal(child)\n super\n invalidate_task_terminal_flag_if_needed(child)\n end",
"def delete\n CMark.node_unlink(@pointer)\n end",
"def delete_tree\n @root = nil # In ruby it will be taken care by garbage collector\n end",
"def clean\n FileUtils.rm_f(cli.options[:pid])\n end",
"def delete_branch\n #we'll get all descendants by level descending order. That way we'll make sure deletion will come from children to parents\n children_to_be_deleted = self.class.find(:all, :conditions => \"id_path like '#{self.id_path},%'\", :order => \"level desc\")\n children_to_be_deleted.each {|d| d.destroy}\n #now delete my self :)\n self.destroy\n end",
"def delete_with_no_child(parent, direction)\n parent.send \"#{direction}=\".to_sym, nil\n end",
"def move_orphans_to_parent\n orphan_questions = Question.where(qset_id: self.id)\n orphan_questions.update_all(qset_id: self.parent.id)\n end",
"def remove_child(child_id = nil)\n perform_remove_child(nil, child_id)\n reload!\n end",
"def detach\n if attached?\n attachment.destroy\n write_attachment nil\n end\n end",
"def destroy\n #primitives in structs are without parent\n parent and parent.children.delete self\n end",
"def delete_children(id, tube_rack)\n @session.tube_rack_slot.dataset.filter(:tube_rack_id => id).delete\n end",
"def remove\n @fieldset_child = DynamicFieldsets::FieldsetChild.find(params[:id])\n root = @fieldset_child.root_fieldset\n\n respond_to do |format| \n if @fieldset_child.destroy\n notice_text = \"Successfully removed the child\"\n else\n notice_text = \"Child was not able to be removed\"\n end\n format.html { redirect_to(dynamic_fieldsets_children_dynamic_fieldsets_fieldset_path(root), :notice => notice_text)}\n end\n end",
"def do_detach\n \n @options.files.each { |file|\n \n next if not File.exists? file\n \n @open = false\n @open_proc = ''\n @lines = ''\n \n File.new(file).each { |line|\n \n if line !~ /added by ghetto_profile/ then\n @lines += line\n end\n \n }\n \n File.new(file, 'w').write(@lines)\n \n }\n \n end",
"def destroy\n super\n parent.unlist_item(@sym)\n end",
"def destroy\n final_parent.delete(source.statements)\n\n parent.statements.each do |statement|\n parent.delete_statement(statement) if\n statement.subject == source.rdf_subject || \n statement.object == source.rdf_subject\n end\n\n super { source.clear }\n end",
"def delete_all_specs_and_notes(obj = nil)\n obj = self if obj.nil?\n obj.delete_all_specs\n obj.delete_all_notes\n obj.delete_all_exhibits\n obj.children.each do |_name, child|\n next unless child.has_specs?\n\n delete_all_specs_and_notes(child)\n end\n end",
"def remove_child(child_node) \n unless children.include?(child_node) \n raise \"This child does not exist\" \n else \n child_node.parent = nil \n end \n end"
] | [
"0.69785744",
"0.67087173",
"0.6657726",
"0.5990703",
"0.5758282",
"0.5725088",
"0.56670606",
"0.5634715",
"0.56048715",
"0.5602555",
"0.5579192",
"0.5541013",
"0.55216897",
"0.5521616",
"0.54938984",
"0.5480793",
"0.54645514",
"0.5448425",
"0.5426574",
"0.54222316",
"0.54123265",
"0.540828",
"0.5404624",
"0.53657675",
"0.5358985",
"0.53587353",
"0.53319234",
"0.53215504",
"0.52908504",
"0.5284307",
"0.5284307",
"0.52826107",
"0.5267825",
"0.5260823",
"0.52165395",
"0.5203628",
"0.51904887",
"0.5167223",
"0.5154462",
"0.5150697",
"0.5147981",
"0.51467973",
"0.5112787",
"0.5105597",
"0.5089434",
"0.50812113",
"0.50796294",
"0.5067381",
"0.5065689",
"0.50526756",
"0.50410455",
"0.5032634",
"0.5025576",
"0.5024851",
"0.50237685",
"0.50226593",
"0.50167316",
"0.50054324",
"0.49927673",
"0.4991849",
"0.49918342",
"0.49887255",
"0.49771735",
"0.49760807",
"0.49496582",
"0.49425635",
"0.49394587",
"0.49389374",
"0.49389374",
"0.49322075",
"0.4911045",
"0.4908094",
"0.4905337",
"0.4903216",
"0.488756",
"0.488756",
"0.48797873",
"0.48774537",
"0.4866603",
"0.4854723",
"0.48539093",
"0.4849921",
"0.48487967",
"0.48462683",
"0.48371562",
"0.48343453",
"0.48342448",
"0.4834174",
"0.48317572",
"0.48266158",
"0.48251355",
"0.48221728",
"0.48163402",
"0.48149833",
"0.48136225",
"0.48043278",
"0.48034143",
"0.48026708",
"0.47858003",
"0.47829643"
] | 0.64396185 | 3 |
Creates child work with: All the appropriate metadata copied from parent title/creator copied from file_set file_set set as member of new child_work DOES save the new child work. DOES NOT actually add it to parent_work yet. That's expensive and needs to be done in a lock. DOES NOT transfer collection membership, that's a whole different mess. | def create_intermediary_child_work(parent, file_set)
new_child_work = GenericWork.new(title: file_set.title, creator: [current_user.user_key])
new_child_work.apply_depositor_metadata(current_user.user_key)
# make original fileset a member of our new child work
self.class.add_to_parent(new_child_work, file_set, 0, make_thumbnail: true, make_representative: true)
# and set the child work's metadata based on the parent work.
# bibliographic
attrs_to_copy = parent.attributes.sort.map { |a| a[0] }
attrs_to_copy -= ['id', "title", 'lease_id', 'embargo_id', 'head', 'tail', 'access_control_id', 'thumbnail_id', 'representative_id' ]
attrs_to_copy.each do |a|
new_child_work[a] = parent[a]
end
# permissions-related
new_child_work.visibility = parent.visibility
new_child_work.embargo_release_date = parent.embargo_release_date
new_child_work.lease_expiration_date = parent.lease_expiration_date
parent_permissions = parent.permissions.map(&:to_hash)
# member HAS to be saved to set it's permission attributes, not sure why.
# extra saves make things extra slow. :(
new_child_work.save!
if parent_permissions.present?
new_child_work.permissions_attributes = parent_permissions
end
# But now everything seems to be properly saved without need for another save.
return new_child_work
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spawn attributes={}\n child = self.dup\n self.work_groups.each do |wg|\n new_wg = WorkGroup.new(:institution=>wg.institution,:project=>child)\n child.work_groups << new_wg\n wg.group_memberships.each do |gm|\n new_gm = GroupMembership.new(:person=>gm.person, :work_group=>wg)\n new_wg.group_memberships << new_gm\n end\n end\n child.assign_attributes(attributes)\n child.avatar=nil\n child.lineage_ancestor=self\n child\n end",
"def spawn(attributes = {})\n child = dup\n work_groups.each do |wg|\n new_wg = WorkGroup.new(institution: wg.institution, project: child)\n child.work_groups << new_wg\n wg.group_memberships.each do |gm|\n new_gm = GroupMembership.new(person: gm.person, work_group: wg)\n new_wg.group_memberships << new_gm\n end\n end\n child.assign_attributes(attributes)\n child.avatar = nil\n child.lineage_ancestor = self\n child\n end",
"def to_fileset\n begin\n parent_work = GenericWork.find(params['parentworkid'] )\n child_work = GenericWork.find(params['childworkid'] )\n rescue ActiveFedora::ObjectNotFoundError, Ldp::Gone, ActiveFedora::RecordInvalid\n flash[:notice] = \"This item no longer exists, so it can't be promoted to a child work.\"\n redirect_to \"/works/#{parent_work.id}\"\n return\n end\n if !self.class.can_demote_to_file_set?(current_user, parent_work, child_work)\n flash[:notice] = \"Sorry. \\\"#{child_work.title.first}\\\" can't be demoted to a file.\"\n redirect_to \"/works/#{child_work.id}\"\n return\n end\n\n WorkToFilesetCompletionJob.perform_later(parent_work.id, child_work_id: child_work.id)\n\n file_set = child_work.members.first\n\n flash[:notice] = \"\\\"#{file_set.title.first}\\\" is IN PROCESS of being demoted to a file attached to \\\"#{parent_work.title.first}\\\". All metadata associated with the child work has been deleted. You can edit the file immediately if desired.\"\n redirect_to \"/concern/parent/#{parent_work.id}/file_sets/#{file_set.id}\"\n end",
"def attach_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.ordered_members << file_set\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n Hyrax.config.callback.run(:after_create_fileset, file_set, user, warn: false)\n end\n end",
"def attach_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.ordered_members << file_set\n # heliotrope change: don't assign representative_id and thumbnail_id\n # work.representative = file_set if work.representative_id.blank?\n # work.thumbnail = file_set if work.thumbnail_id.blank?\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n Hyrax.config.callback.run(:after_create_fileset, file_set, user)\n end\n end",
"def create(work)\n super\n if work.env[:work_members_attributes].blank?\n @message = NO_CHILD\n add_relationships_succeeded\n else\n call_service\n end\n rescue StandardError => e\n add_relationships_failed\n log(\"failed while adding relationships work: #{e.message}\")\n end",
"def fork_and_work\n cpid = fork {setup_child; work}\n log(:at => :fork, :pid => cpid)\n Process.wait(cpid)\n end",
"def attach_file_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n ## move next four statements to update_work_with_file_set\n #copy_visibility(work, file_set) unless assign_visibility?(file_set_params)\n #work.ordered_members << file_set\n #set_representative(work, file_set)\n #set_thumbnail(work, file_set)\n update_work_with_file_set( work, file_set, file_set_params )\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n end\n end",
"def attach_to_work( work, file_set_params = {}, uploaded_file_id: nil )\n Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n Deepblue::LoggingHelper.called_from,\n \"work.id=#{work.id}\",\n \"file_set_params=#{file_set_params}\" ]\n acquire_lock_for( work.id ) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.ordered_members << file_set\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n Deepblue::UploadHelper.log( class_name: self.class.name,\n event: \"attach_to_work\",\n id: file_set.id,\n uploaded_file_id: uploaded_file_id,\n work_id: work.id,\n work_file_set_count: work.file_set_ids.count )\n Hyrax.config.callback.run(:after_create_fileset, file_set, user)\n end\n rescue Exception => e # rubocop:disable Lint/RescueException\n Rails.logger.error \"#{e.class} work.id=#{work.id} -- #{e.message} at #{e.backtrace[0]}\"\n Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n Deepblue::LoggingHelper.called_from,\n \"ERROR\",\n \"e=#{e.class.name}\",\n \"e.message=#{e.message}\",\n \"e.backtrace:\" ] +\n e.backtrace\n Deepblue::UploadHelper.log( class_name: self.class.name,\n event: \"attach_to_work\",\n event_note: \"failed\",\n id: work.id,\n uploaded_file_id: uploaded_file_id,\n work_id: work.id,\n exception: e.to_s,\n backtrace0: e.backtrace[0] )\n end",
"def create_work\n @files.each do |file|\n executor.queue { file.copy_file(@output_dir) }\n end\n end",
"def make_related(parent, child, resource_config)\n proc = resource_config[:relation][:create]\n proc.call(parent, child) if proc\n child\n end",
"def attach_to_work(work, file_set_params = {})\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"work.id=#{work.id}\",\n \"file_set_params=#{file_set_params}\",\n \"\" ] if file_set_ordered_ordered_members_actor_debug_verbose\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n end",
"def pre_apply_child(child_index, workitem, forget)\n\n child_fei = h.fei.merge(\n 'expid' => \"#{h.fei['expid']}_#{child_index}\",\n 'subid' => Ruote.generate_subid(h.fei.inspect))\n\n h.children << child_fei unless forget\n\n msg = {\n 'fei' => child_fei,\n 'tree' => tree.last[child_index],\n 'parent_id' => forget ? nil : h.fei,\n 'variables' => forget ? compile_variables : nil,\n 'workitem' => workitem\n }\n msg['forgotten'] = true if forget\n\n msg\n end",
"def build_work(work_files)\n work_files.each do |file|\n next if file.blank?\n if file.end_with? '-metadata.json'\n @work_metadata = JSON.parse(File.read(file))\n work_metadata[:packaged_by_package_name] = dip_id\n write_json(work_metadata)\n else\n FileUtils.cp_r(file, src)\n end\n end\n write_dc\n end",
"def update\n @collection = Collection.find(params[:id])\n \n #Parent collection stuff\n parent_child_violation = false\n access_violation = false\n if params.include?(\"collection\") and params[:collection].include?(\"parent_id\") and params[:collection][\"parent_id\"] != \"\"\n parent_collection = Collection.find(params[:collection][\"parent_id\"])\n \n if (parent_collection.user_id != @collection.user_id)\n access_violation = true\n \n else\n #if !collection_is_parent(@collection, parent_collection)\n if !parent_collection.ancestors.include?(@collection)\n @collection.parent_id = parent_collection.id\n \n #inherits project (and permissions) of parent by default\n inherit_collection(parent_collection)\n else\n parent_child_violation = true\n end\n end #if parent\n end #if params\n \n #Update\n #do this now, so the spawn doesn't PG:Error b/c spawned code has locked @colllection\n update_collection_attrs_suc = false\n if (not parent_child_violation and not access_violation)\n update_collection_attrs_suc = @collection.update_attributes(params[:collection])\n end\n\n #Validation\n if (params.include?(\"post\") and params[:post].include?(\"ifilter_id\") and params[:post][:ifilter_id] != \"\" )\n f = get_ifilter( params[:post][:ifilter_id].to_i )\n\n validate_collection_helper(@collection, f)\n end\n \n #Add metadata from a metaform\n if (params.include?(\"post\") and params[:post].include?(\"metaform_id\") and params[:post][:metaform_id] != \"\" )\n add_collection_metaform(@collection, params[:post][:metaform_id].to_i)\n end\n\n #Add to my project\n if (params.include?(\"proj\") and params[:proj].include?(\"id\") and params[:proj][:id] != \"\" )\n project = Project.find( params[:proj][:id] )\n add_project_col(project, @collection) #call to collection helper, adds collection to project\n end\n \n #Add selected upload as a note to the collection\n if (params.include?(\"note\") and params[\"note\"].include?(\"upload_id\") and (!params[\"note\"][\"upload_id\"].blank?) )\n add_note_collection( params[\"note\"][\"upload_id\"] )\n end\n\n if (params.include?(\"remove_ids\") and (!params[\"remove_ids\"].blank?) )\n remove_notes_collection( params[\"remove_ids\"] ) #Remove notes\n end\n\n=begin\n #Add to other project (as editor)\n if (params.include?(\"ed_proj\") and params[:ed_proj].include?(\"pro_id\") and params[:ed_proj][:pro_id] != \"\" )\n project = Project.find( params[:ed_proj][:pro_id] )\n add_project_col(project, @collection) #from collection helper\n end\n=end\n #Recursive remove from project\n if params.include?(\"remove_project\")\n params[\"remove_project\"].each do |k,v|\n if v.to_i == 1\n project = Project.find(k.to_i)\n @collection.projects.delete project\n @collection.descendants.each do |c|\n if !c.projects.empty?\n c.projects.delete project\n end\n end\n end\n end\n end\n\n respond_to do |format|\n if access_violation\n @collection.errors.add(:base, \"You are not authorized to do that.\")\n format.html { render action: \"edit\" }\n elsif parent_child_violation \n #flash[:error] = \"Warning: cannot set parent collection to a child.\"\n @collection.errors.add(:base, \"Cannot set parent collection to a child.\")\n format.html { render action: \"edit\" }\n elsif update_collection_attrs_suc\n format.html { redirect_to edit_collection_path(@collection), notice: 'Collection was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_work(xml_metadata)\n parsed_data = Ingest::Services::MetadataParser.new(xml_metadata,\n @depositor,\n @collection,\n @config).parse\n work_attributes = parsed_data[:work_attributes]\n # Create new work record and save\n new_work = work_record(work_attributes)\n new_work.save!\n\n new_work\n\n end",
"def attach_file_to_work(work, file_set, file_set_params)\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so\n # that we append to the end of the list.\n work.reload unless work.new_record?\n unless assign_visibility?(file_set_params)\n copy_visibility(work, file_set)\n end\n work.ordered_members << file_set\n set_representative(work, file_set)\n set_thumbnail(work, file_set)\n\n # Save the work so the association between the work and the file_set is persisted (head_id)\n work.save\n end\n end",
"def perform_in_child(&block)\n reader, writer = IO.pipe\n\n if fork\n parent_worker(reader, writer)\n else\n child_worker(reader, writer, &block)\n end\n end",
"def attach_files\n @parent = Work.find_by_friendlier_id!(params[:parent_id])\n authorize! :update, @parent\n\n current_position = @parent.members.maximum(:position) || 0\n\n files_params = (params[:cached_files] || []).\n collect { |s| JSON.parse(s) }.\n sort_by { |h| h && h.dig(\"metadata\", \"filename\")}\n\n files_params.each do |file_data|\n asset = Asset.new()\n\n if derivative_storage_type = params.dig(:storage_type_for, file_data[\"id\"])\n asset.derivative_storage_type = derivative_storage_type\n end\n\n asset.position = (current_position += 1)\n asset.parent_id = @parent.id\n asset.file = file_data\n asset.title = (asset.file&.original_filename || \"Untitled\")\n asset.published = @parent.published\n asset.save!\n end\n\n if @parent.representative_id == nil\n @parent.update(representative: @parent.members.order(:position).first)\n end\n\n redirect_to admin_work_path(@parent.friendlier_id, anchor: \"nav-members\")\n end",
"def attach_ordered_members_to_work(work)\n acquire_lock_for(work.id) do\n work.ordered_members = ordered_members\n work.save\n ordered_members.each do |file_set|\n Hyrax.config.callback.run(:after_create_fileset, file_set, user, warn: false)\n end\n end\n end",
"def add_child(child)\n transaction do\n self.reload; child.reload # for compatibility with old version\n # the old version allows records with nil values for lft and rgt\n unless self[left_col_name] && self[right_col_name]\n if child[left_col_name] || child[right_col_name]\n raise ActiveRecord::ActiveRecordError, \"If parent lft or rgt are nil, you can't add a child with non-nil lft or rgt\"\n end\n base_set_class.update_all(\"#{left_col_name} = CASE \\\n WHEN id = #{self.id} \\\n THEN 1 \\\n WHEN id = #{child.id} \\\n THEN 3 \\\n ELSE #{left_col_name} END, \\\n #{right_col_name} = CASE \\\n WHEN id = #{self.id} \\\n THEN 2 \\\n WHEN id = #{child.id} \\\n THEN 4 \\\n ELSE #{right_col_name} END\",\n scope_condition)\n self.reload; child.reload\n end\n unless child[left_col_name] && child[right_col_name]\n maxright = base_set_class.maximum(right_col_name, :conditions => scope_condition) || 0\n base_set_class.update_all(\"#{left_col_name} = CASE \\\n WHEN id = #{child.id} \\\n THEN #{maxright + 1} \\\n ELSE #{left_col_name} END, \\\n #{right_col_name} = CASE \\\n WHEN id = #{child.id} \\\n THEN #{maxright + 2} \\\n ELSE #{right_col_name} END\",\n scope_condition)\n child.reload\n end\n \n child.move_to_child_of(self)\n # self.reload ## even though move_to calls target.reload, at least one object in the tests was not reloading (near the end of test_common_usage)\n end\n # self.reload\n # child.reload\n #\n # if child.root?\n # raise ActiveRecord::ActiveRecordError, \"Adding sub-tree isn\\'t currently supported\"\n # else\n # if ( (self[left_col_name] == nil) || (self[right_col_name] == nil) )\n # # Looks like we're now the root node! Woo\n # self[left_col_name] = 1\n # self[right_col_name] = 4\n # \n # # What do to do about validation?\n # return nil unless self.save\n # \n # child[parent_col_name] = self.id\n # child[left_col_name] = 2\n # child[right_col_name]= 3\n # return child.save\n # else\n # # OK, we need to add and shift everything else to the right\n # child[parent_col_name] = self.id\n # right_bound = self[right_col_name]\n # child[left_col_name] = right_bound\n # child[right_col_name] = right_bound + 1\n # self[right_col_name] += 2\n # self.class.transaction {\n # self.class.update_all( \"#{left_col_name} = (#{left_col_name} + 2)\", \"#{scope_condition} AND #{left_col_name} >= #{right_bound}\" )\n # self.class.update_all( \"#{right_col_name} = (#{right_col_name} + 2)\", \"#{scope_condition} AND #{right_col_name} >= #{right_bound}\" )\n # self.save\n # child.save\n # }\n # end\n # end\n end",
"def add_child(child)\n transaction do\n self.reload; child.reload # for compatibility with old version\n # the old version allows records with nil values for lft and rgt\n unless self[left_col_name] && self[right_col_name]\n if child[left_col_name] || child[right_col_name]\n raise ActiveRecord::ActiveRecordError, \"If parent lft or rgt are nil, you can't add a child with non-nil lft or rgt\"\n end\n base_set_class.update_all(\"#{left_col_name} = CASE \\\n WHEN id = #{self.id} \\\n THEN 1 \\\n WHEN id = #{child.id} \\\n THEN 3 \\\n ELSE #{left_col_name} END, \\\n #{right_col_name} = CASE \\\n WHEN id = #{self.id} \\\n THEN 2 \\\n WHEN id = #{child.id} \\\n THEN 4 \\\n ELSE #{right_col_name} END\",\n scope_condition)\n self.reload; child.reload\n end\n unless child[left_col_name] && child[right_col_name]\n maxright = base_set_class.maximum(right_col_name, :conditions => scope_condition) || 0\n base_set_class.update_all(\"#{left_col_name} = CASE \\\n WHEN id = #{child.id} \\\n THEN #{maxright + 1} \\\n ELSE #{left_col_name} END, \\\n #{right_col_name} = CASE \\\n WHEN id = #{child.id} \\\n THEN #{maxright + 2} \\\n ELSE #{right_col_name} END\",\n scope_condition)\n child.reload\n end\n \n child.move_to_child_of(self)\n # self.reload ## even though move_to calls target.reload, at least one object in the tests was not reloading (near the end of test_common_usage)\n end\n # self.reload\n # child.reload\n #\n # if child.root?\n # raise ActiveRecord::ActiveRecordError, \"Adding sub-tree isn\\'t currently supported\"\n # else\n # if ( (self[left_col_name] == nil) || (self[right_col_name] == nil) )\n # # Looks like we're now the root node! Woo\n # self[left_col_name] = 1\n # self[right_col_name] = 4\n # \n # # What do to do about validation?\n # return nil unless self.save\n # \n # child[parent_col_name] = self.id\n # child[left_col_name] = 2\n # child[right_col_name]= 3\n # return child.save\n # else\n # # OK, we need to add and shift everything else to the right\n # child[parent_col_name] = self.id\n # right_bound = self[right_col_name]\n # child[left_col_name] = right_bound\n # child[right_col_name] = right_bound + 1\n # self[right_col_name] += 2\n # self.class.transaction {\n # self.class.update_all( \"#{left_col_name} = (#{left_col_name} + 2)\", \"#{scope_condition} AND #{left_col_name} >= #{right_bound}\" )\n # self.class.update_all( \"#{right_col_name} = (#{right_col_name} + 2)\", \"#{scope_condition} AND #{right_col_name} >= #{right_bound}\" )\n # self.save\n # child.save\n # }\n # end\n # end\n end",
"def start_work(child=self)\n fork do\n begin\n @job = child.beanstalk.reserve\n BEANPICKER_FORK[:job] = @job if BEANPICKER_FORK[:child_every]\n data = @job.ybody\n\n if not data.is_a?(Hash) or [:args, :next_jobs] - data.keys != []\n data = { :args => data, :next_jobs => [] }\n end\n\n t=Time.now\n debug \"Running #{@job_name}##{@number} with args #{data[:args]}; next jobs #{data[:next_jobs]}\"\n r = @blk.call(data[:args].clone)\n debug \"Job #{@job_name}##{@number} finished in #{Time.now-t} seconds with return #{r}\"\n data[:args].merge!(r) if r.is_a?(Hash) and data[:args].is_a?(Hash)\n\n @job.delete\n\n Beanpicker.enqueue(data[:next_jobs], data[:args]) if r and not data[:next_jobs].empty?\n rescue => e\n fatal Beanpicker::exception_message(e, \"in loop of #{@job_name}##{@number} with pid #{Process.pid}\")\n if BEANPICKER_FORK[:child_every]\n exit\n else\n Thread.new(@job) { |j| j.bury rescue nil }\n end\n ensure\n @job = nil\n end\n end\n end",
"def create_work\n @files.each do |file|\n executor.queue do\n chown(file)\n chmod(file)\n end\n end\n end",
"def build_work(w_hsh)\n title = Array(w_hsh[:title])\n creator = Array(w_hsh[:creator])\n rights = Array(w_hsh[:rights])\n desc = Array(w_hsh[:description])\n methodology = w_hsh[:methodology]\n subject = Array(w_hsh[:subject])\n contributor = Array(w_hsh[:contributor])\n date_created = Array(w_hsh[:date_created]) \n rtype = Array(w_hsh[:resource_type] || 'Dataset')\n\n gw = GenericWork.new( title: title, creator: creator, rights: rights,\n description: desc, resource_type: rtype,\n methodology: methodology, subject: subject,\n contributor: contributor, date_created: date_created ) \n paths_and_names = w_hsh[:files].zip w_hsh[:filenames]\n fsets = paths_and_names.map{|fp| build_file_set(fp[0], fp[1])}\n fsets.each{|fs| gw.ordered_members << fs}\n gw.apply_depositor_metadata(user_key)\n gw.owner=(user_key)\n gw.save!\n return gw\n end",
"def post_add_content\n @parent&.post_initialize_child(self)\n end",
"def associate_child(params)\n # Pull out the relevant parameters\n new_object = params[:child]\n task_run = params[:task_run]\n\n # grab the object's class\n class_name = new_object.class.to_s.downcase\n \n # And set us up as a parent through an object_mapping\n # new_object._map_parent(params) \n # And associate the object as a child through an object_mapping\n EarLogger.instance.log \"Associating #{self} with child object #{new_object}\"\n _map_child(params)\n end",
"def fork(attributes_overrides={})\n # Always empty out the data in fork nodes. Data will be read from parent node.\n attributes_overrides[:data] = nil\n child = Node.copy(self,attributes_overrides)\n child.is_fork = true\n child.save\n child\n end",
"def new_child\n @parent = Comment.find(params[:id])\n @comment = @parent.children.new(user_id: current_user.id, task_id: @task.id)\n\n end",
"def create_or_update_then_render_child(parent, child_name)\n child_obj = parent.send(child_name)\n attribute_name_params_template = \"#{child_name}_params\"\n attribute_name_params = send(attribute_name_params_template)\n\n child_obj = build_has_one_child_if_nil parent, child_name\n child_obj.assign_attributes(attribute_name_params)\n\n render_wizard child_obj\n end",
"def apply_child (child_index, workitem)\n\n child_index, child = if child_index.is_a?(Integer)\n [ child_index, raw_children[child_index] ]\n else\n [ raw_children.index(child_index), child_index ]\n end\n\n get_expression_pool.tlaunch_child(\n self, child, child_index, workitem, :register_child => true)\n end",
"def spawn_child(index)\n master_pid = $$ # need to store in order to pass down to child\n child_pid = fork do\n @file_lock.close\n child_class.new(index, master_pid).start\n end\n children[index] = child_pid\n ProcessManager::Log.info \"#{description}: Spawned child #{index + 1}/#{ProcessManager::Config.config[:children]}\"\n end",
"def parent_work\n find_related_frbr_objects( :is_part_of, :which_works?) \n end",
"def perform_add_child(batch_client, child_id, remove_other = false)\n self.class.make_request(client, batch_client, :add_child, scope_parameters.merge(\n self.class.primary_key_name => primary_key,\n child_id: child_id,\n remove_other: remove_other\n ))\n end",
"def fill_out_work(work)\n work.title = self.title\n\n if self.bib_number.present?\n work.build_external_id(category: \"bib\", value: self.bib_number)\n end\n if self.accession_number.present?\n work.build_external_id(category: \"accn\", value: self.accession_number)\n end\n if self.museum_object_id.present?\n work.build_external_id(category: \"object\", value: self.museum_object_id)\n end\n if self.box.present? || self.folder.present?\n work.physical_container = {box: self.box.presence, folder: self.folder.presence}\n end\n if self.dimensions.present?\n work.extent = self.dimensions\n end\n\n if self.collecting_area == \"archives\"\n work.department = \"Archives\"\n elsif self.collecting_area == \"rare_books\" || self.collecting_area == \"modern_library\"\n work.department = \"Library\"\n elsif self.collecting_area == \"museum\"\n work.department = \"Museum\"\n end\n\n end",
"def create(attributes = {})\n resource = build(attributes)\n @parent.attributes[@name] = resource if resource.save\n resource\n end",
"def create\n @creator.works << Work.where(id: work_ids)\n if @creator.save\n render json: @creator, status: :created, location: @creator\n else\n render json: @creator.errors, status: :unprocessable_entity\n end\n end",
"def build(attributes)\n if @parent.persisted?\n parent_foreign_key = @parent.class.demodulized_name.foreign_key.to_sym\n attributes[parent_foreign_key] = @parent.id\n end\n\n record = client.adapter_for(@class_name).build(attributes)\n @target << record\n record\n end",
"def apply_child(child_index, workitem, forget=false)\n\n msg = pre_apply_child(child_index, workitem, forget)\n\n persist_or_raise unless forget\n # no need to persist the parent (this) if the child is to be forgotten\n\n @context.storage.put_msg('apply', msg)\n end",
"def batch_add_child(batch_client, child_id, remove_other = false)\n perform_add_child(batch_client, child_id, remove_other)\n end",
"def assign_nested_attributes_for_collection( env, attributes_collection )\n return true if attributes_blank? attributes_collection\n return true unless env.curation_concern.respond_to? :provenance_child_add\n attributes_collection = attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }\n # checking for existing works to avoid rewriting/loading works that are already attached\n existing_works = env.curation_concern.member_ids\n current_user = env.user\n attributes_collection.each do |attributes|\n next if attributes['id'].blank?\n if existing_works.include?( attributes['id'] )\n remove( env, attributes['id'], current_user ) if has_destroy_flag?( attributes )\n else\n add( env, attributes['id'], current_user )\n end\n end\n end",
"def create_child_skeleton_rows\n ActiveRecord::Base.transaction do\n\n AssignmentDefinition.all.each do |a|\n assignment = assignments.find_by_assignment_definition_id(a.id)\n if assignment.nil?\n assignment = Assignment.create(\n assignment_definition_id: a.id,\n state: 'new'\n )\n assignments << assignment\n end\n\n a.task_definitions.each do |td|\n task = tasks.find_by_task_definition_id(td.id)\n if task.nil?\n task = Task.create(\n task_definition_id: td.id,\n assignment_id: assignment.id,\n state: 'new'\n )\n tasks << task\n end\n end\n end\n end\n end",
"def attach_work_to_collection(work,collection)\n \n attached = true\n collection.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX\n begin\n work.member_of_collections << collection\n work.save!\n rescue StandardError => e\n attached = false\n end\n\n attached\n end",
"def batch_add_parent(batch_client, parent_id, remove_other = false)\n perform_add_parent(batch_client, parent_id, remove_other)\n end",
"def create_parent_child_relationships\n parents.each do |key, value|\n parent = entry_class.where(\n identifier: key,\n importerexporter_id: importerexporter.id,\n importerexporter_type: 'Bulkrax::Importer'\n ).first\n\n # not finding the entries here indicates that the given identifiers are incorrect\n # in that case we should log that\n children = value.map do |child|\n entry_class.where(\n identifier: child,\n importerexporter_id: importerexporter.id,\n importerexporter_type: 'Bulkrax::Importer'\n ).first\n end.compact.uniq\n\n if parent.present? && (children.length != value.length)\n # Increment the failures for the number we couldn't find\n # Because all of our entries have been created by now, if we can't find them, the data is wrong\n Rails.logger.error(\"Expected #{value.length} children for parent entry #{parent.id}, found #{children.length}\")\n break if children.empty?\n Rails.logger.warn(\"Adding #{children.length} children to parent entry #{parent.id} (expected #{value.length})\")\n end\n parent_id = parent.id\n child_entry_ids = children.map(&:id)\n ChildRelationshipsJob.perform_later(parent_id, child_entry_ids, current_run.id)\n end\n rescue StandardError => e\n status_info(e)\n end",
"def build_new_works\n\n return if self.status==:new_only_effort #estimation only, no schedule\n\n work_actual_array=self.task.work_actuals\n\n d1 = Date.last_monday(self.task.start)\n d2 = task.stop\n\n logger.info \" build_works_for_baseline from #{d1} to #{d2}\"\n\n d1.step(d2, 7) do |date|\n self.works.build do |w|\n w.start_date =date\n w.duration =WORK_TIME_FRAME\n w.workhours =Baseline.corresponding_work(work_actual_array, date).nil_or.workhours\n w.description=Baseline.corresponding_work(work_actual_array, date).nil_or.description\n end\n end\n end",
"def initialize_child_run\n self.workflow = parent.workflow\n end",
"def add_child_object(child, type, info)\n\t unless read_write? && child.read_write?\n\t raise OwnershipError, \"cannot add a relation between tasks we don't own. #{self} by #{owners.to_a} and #{child} is owned by #{child.owners.to_a}\"\n\t end\n\n\t super\n\tend",
"def create_metadata(work, file_set_params = {})\n file_set.apply_depositor_metadata(user)\n now = CurationConcerns::TimeService.time_in_utc\n file_set.date_uploaded = now\n file_set.date_modified = now\n file_set.creator = [user.user_key]\n\n interpret_visibility file_set_params if assign_visibility?(file_set_params)\n attach_file_to_work(work, file_set, file_set_params) if work\n yield(file_set) if block_given?\n end",
"def post_add_content\n @parent_proxy&.post_initialize_child(self)\n end",
"def copy(name, parent)\n raise 'must give non nil parent community' if parent.nil?\n raise 'parent must be a community' if parent.getType != DConstants::COMMUNITY\n\n name = name.strip\n\n new_col = self.class.create(name, parent)\n\n group = @obj.getSubmitters\n if group\n new_group = new_col.createSubmitters\n copy_group(group, new_group)\n end\n\n [1, 2, 3].each do |i|\n group = @obj.getWorkflowGroup(i)\n if group\n new_group = new_col.createWorkflowGroup(i)\n copy_group(group, new_group)\n end\n end\n\n new_col.update\n new_col\n end",
"def create\n logger.debug \"**** WORK CREATE ****\"\n \n #Fix the value coming back from the check box\n if params[:work][:no_duration] == \"on\"\n params[:work][:no_duration] = \"true\"\n else\n params[:work][:no_duration] = \"false\"\n end\n @work = Work.new(params[:work])\n logger.debug \"Created work, fields are #{@work.to_yaml}\"\n\n \n @work.intended_duration = nil if params[:work][:intended_duration].blank?\n \n @main_category = @work.main_category #Used by form\n \n\t@composers = session[:composers]\n\t\n #add a superwork with the same name as the work in question if no superwork is attached\n if ! @work.superwork\n logger.info(\"No superwork assigned!\")\n\t\t\n\t\tcomposers_names = @composers.map{|c| c.contributor.role.contributor_names}.flatten.uniq.join(', ')\n \n\t\t@work.superwork=Superwork.create(:superwork_title=>@work.work_title + \" - \" + composers_names,:updated_by=>@login.login_id,:status_id=>params[:work][:status_id])\n end\n \n show_params(params)\n \n \n logger.debug \"WORK SUBCATS are #{@work.work_subcategories.length}\"\n \n #Create implicit FRBR relationships\n\n @work.login_updated_by = @login\n \n if @work.save_with_composers(@composers)\n logger.debug \"WORK SAVED OK\"\n @work.frbr_updateImplicitRelationships(@login.login_id)\n @subcategories=session[:work_subcategories]\n for subcategory in @subcategories\n @work.work_subcategories << subcategory\n end\n @work.save() \n flash[:notice] = 'Work was successfully created.'\n \n redirect_to :action => 'show', :id => @work\n else\n logger.debug \"WORK DID NOT SAVE - RENDERING NEW FORM\"\n prepare_new\n @interval_duration = IntervalDuration.create_from_string_no_validation(@work.intended_duration)\n\n \n render :action => 'new'\n end\n end",
"def create\n if self.send(self.class.parent_association_name).valid?\n self.send(self.class.parent_association_name).save!\n self.id = self.send(self.class.parent_association_name).id\n self.instance_variable_set(:@new_record, false)\n ret = self.save\n self.reload\n return ret\n else\n self.errors.add(self.class.parent_association_name, 'has errors')\n end\n end",
"def add_common_work common_work\n CatalogsCommonWorks.where(catalog_id: self.id, common_work_id: common_work.id)\n .first_or_create(catalog_id: self.id, common_work_id: common_work.id)\n \n common_work.recordings.each do |recording|\n self.attach_recording recording\n end\n end",
"def my_custom_transaction\n children.create!(CustomFolder, :name => nil)\n end",
"def start_child_quests(parent_id, player_id)\n without_locking do\n Quest.where(:parent_id => parent_id).all\n end.each do |quest|\n begin\n quest_progress = QuestProgress.new(:quest_id => quest.id,\n :player_id => player_id, :status => QuestProgress::STATUS_STARTED)\n quest_progress.save!\n rescue ActiveRecord::RecordNotUnique => e\n # WTF, this should not be happening!\n LOGGER.warn \"QuestProgress not unique for player id #{player_id\n }, quest #{quest}.\\n\\n#{e.to_s}\"\n end\n end\n end",
"def tlaunch_child (parent_exp, template, sub_id, workitem, opts={})\n\n raw_exp = tprepare_child(parent_exp, template, sub_id, opts)\n\n onotify(:tlaunch_child, raw_exp.fei, workitem)\n\n apply(raw_exp, workitem)\n\n raw_exp.fei\n end",
"def create_work_and_files(file_dir, dom)\n @log.info 'Ingesting DSpace item'\n\n start_time = DateTime.now\n\n # data mapper\n params = collect_params(dom)\n pp params if @debug\n\n @log.info 'Handle: ' + params['handle'][0]\n\n @log.info 'Creating Hyrax work...'\n work = create_new_work(params)\n\n if @config['metadata_only']\n @log.info 'Metadata only'\n else\n @log.info 'Getting uploaded files'\n uploaded_files = get_files_to_upload(file_dir, dom)\n\n @log.info 'Attaching file(s) to work job...'\n AttachFilesToWorkJob.perform_now(work, uploaded_files)\n end\n\n # record this work in the handle log\n @handle_report.write(\"#{params['handle']},#{work.id}\\n\")\n\n # record the time it took\n end_time = Time.now.minus_with_coercion(start_time)\n total_time = Time.at(end_time.to_i.abs).utc.strftime('%H:%M:%S')\n @log.info 'Total time: ' + total_time\n @log.info 'DONE!'.green\nend",
"def make_child(block)\n #Forkme.logger.debug \"p: make child\"\n to_child = IO.pipe\n to_parent = IO.pipe\n pid = fork do\n @@children.map do |c|\n c.from.close unless c.from.closed?\n c.to.close unless c.to.closed?\n end\n @from_parent = to_child[0]\n @to_parent = to_parent[1]\n to_child[1].close\n to_parent[0].close\n\n child block\n exit_child\n end\n #Forkme.logger.debug \"p: child pid #{pid}\"\n @@children << Child.new(pid, to_parent[0], to_child[1])\n to_child[0].close\n to_parent[1].close\n end",
"def create(work)\n super\n return persist_work_succeeded if exists?\n\n persist_work_initial\n service.persist_work ? persist_work_succeeded : persist_work_failed\n rescue StandardError => e\n persist_work_failed\n errors(message(e))\n log(\"error while persisting work: #{e.message} : #{e.backtrace}\")\n end",
"def create_nested_document!(parent, child_assoc, child_model)\n child = child_model.new(params)\n if child_model.embeddable?\n parent.send(child_assoc) << child\n unless parent.valid?\n error 400, convert(body_for(:invalid_document, child))\n end\n unless parent.save\n error 400, convert(body_for(:internal_server_error))\n end\n else\n unless child.valid?\n error 400, convert(body_for(:invalid_document, child))\n end\n unless child.save\n error 400, convert(body_for(:internal_server_error))\n end\n end\n child\n end",
"def change_parent(child, parent)\n\t\tif child.is_a?(Node) #if its a node, modify the relation so its parent is the new_node\n\t\t\t\n\t\t\t#relation = child.parent_relationships.first #hierarchy relationship should always be first <- no longer true potentially\n\t\t\trelation = child.parent_relationships.find_by link_collection_id: nil #the first one not explicitly defined, so hierarchy\n\t\t\t#binding.pry\n\t\t\tif (parent != nil) #if there is a parent for it\n\n\t\t\t\tif relation != nil #if it already has a parent relation. should be .any?\n\t\t\t\t\trelation.parent_id = parent.id\n\t\t\t\t\trelation.save\n\t\t\t\t\tchild.save\n\t\t\t\t\tparent.save\n\t\t\t\telse #if it doesn't have a parent already\n\t\t\t\t\trelation = Link.new(child_id: child.id, parent_id: parent.id, work_id: self.id)\n\t\t\t\t\trelation.save\n\t\t\t\t\tchild.save\n\t\t\t\tend\n\t\t\t\t#parent.child_relationships << relation\n\n\t\t\telse #if it doesn't have a new parent to be assigned\n\t\t\t\tif (relation != nil) #if it exists, delete it\n\t\t\t\t\trelation.delete\n\t\t\t\tend #if it doesn't exist and doesn't need to, do nothing\n\t\t\tend\n\t\t\n\t\telsif child.is_a?(Note)\n\t\t\t#prev_parent_id = child.node_id\n\t\t\tif (parent != nil) #if it has a new parent parent already\n\t\t\t\tchild.node_id = parent.id\n\t\t\t\tchild.save\n\t\t\t\tparent.notes << child\n\t\t\t\tparent.save\n\t\t\telse #if it doesn't have a parent, don't set it to anything\n\t\t\t\tchild.node_id = nil\n\t\t\t\tchild.save\t\t\t\n\t\t\tend\n\n\t\t\t#update the notes of the other node, if it exists\n\t\t\t#if Node.exists?(prev_parent_id) #automatically false if nil, so if it has no prev_parent, works even if it thinks it does\n\t\t\t#\tprev_parent = Node.find(prev_parent_id)\n\t\t\t#\tprev_parent.combine_notes()\n\t\t\t#\tprev_parent.save\n\t\t\t#end\n\t\t\n\t\telsif child.is_a?(LinkCollection)\n\t\t\tif (parent != nil) #if it has a new parent\n\t\t\t\tchild.links.each do |link| #reassign its links to that parent\n\t\t\t\t\tlink.change_parent(parent)\n\t\t\t\tend\n\t\t\telse #if a new parent wasn't found for it\n\t\t\t\tchild.links.each do |link| #reassign its links to nil\n\t\t\t\t\tlink.change_parent(nil)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def create\n @wo = Hash.new()\n @wo = params['work_order']\n @wo['createdAt'] = Time.now\n woId = $wo_collection.insert(@wo)\n \n eventUrl = {controller: 'work_order', action: 'show', id: woId}\n registerEvent eventUrl , current_user['_id'], \"work order ID: #{@wo['workOrderId']} created\"\n \n #A regular work order belongs to a project, but a change request (which starts with an authorization request) is a special kind of work order that belongs to another work order hence skipping this part if has key parnetWoId\n if @wo.has_key? 'parentWoId'\n parentWo = $wo_collection.find({ :_id => BSON::ObjectId(@wo['parentWoId']) }).to_a[0]\n parentWo[\"childWo_id_#{woId}\"] = woId\n $wo_collection.save(parentWo)\n \n parentCr = $cr_collection.find({ :_id => BSON::ObjectId(@wo['parentCrId']) }).to_a[0]\n parentCr[\"childWo_id_#{woId}\"] = woId\n $cr_collection.save(parentCr)\n \n \n redirect_to controller: 'work_order', action: 'show', id:@wo['_id']\n else\n project = $project_collection.find({ :_id => BSON::ObjectId(@wo['projectId']) }).to_a[0]\n project[\"wo_id_#{woId}\"] = woId\n $project_collection.save(project)\n redirect_to controller: 'project', action: 'show', id:@wo['projectId']\n end\n end",
"def perform_add_parent(batch_client, parent_id, remove_other = false)\n self.class.make_request(client, batch_client, :add_parent, scope_parameters.merge(\n self.class.primary_key_name => primary_key,\n parent_id: parent_id,\n remove_other: remove_other\n ))\n end",
"def add_child(child)\n child.parent = self\n end",
"def populate_child_inputs\n parent.inputs.each do |i|\n input = TavernaPlayer::RunPort::Input.find_or_initialize_by_run_id_and_name(id, i.name)\n if input.new_record?\n input.value = i.value\n input.file = i.file\n input.depth = i.depth\n input.save\n end\n end\n end",
"def tprepare_child (parent_exp, template, sub_id, options={})\n\n return fetch_expression(template) if template.is_a?(FlowExpressionId)\n # used for \"scheduled launches\"\n\n fei = parent_exp.fei.dup\n fei.expression_id = \"#{fei.expid}.#{sub_id}\"\n fei.expression_name = template.first\n\n parent_id = options[:orphan] ? nil : parent_exp.fei\n\n raw_exp = RawExpression.new_raw(\n fei, parent_id, nil, @application_context, template)\n\n if vars = options[:variables]\n raw_exp.new_environment(vars)\n else\n raw_exp.environment_id = parent_exp.environment_id\n end\n\n raw_exp.dup_environment if options[:dup_environment]\n\n #workitem.fei = raw_exp.fei\n # done in do_apply...\n\n if options[:register_child] == true\n\n (parent_exp.children ||= []) << raw_exp.fei\n\n update(raw_exp)\n\n parent_exp.store_itself unless options[:dont_store_parent]\n end\n\n raw_exp\n end",
"def create\n @plan = Plan.new(params[:plan])\n\n @plan.workers.each do |w|\nprint \"Adding \", w.name, \" to chore_lists\\n\"\n @plan.chore_lists.build(:worker_id => w.id)\n end \n @plan.save\n\n @plan.make_assignments\n\n# @plan.chore_lists.each do |cl|\n# cl.populate\n# end\n\n respond_to do |format|\n if @plan.save\n flash[:notice] = 'Plan was successfully created.'\n format.html { redirect_to(@plan) }\n format.xml { render :xml => @plan, :status => :created, :location => @plan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @plan.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_new_work(params)\n @log.info 'Configuring work attributes'\n\n # set depositor\n depositor = User.find_by_user_key(@config['depositor'])\n raise 'User ' + @config['depositor'] + ' not found.' if depositor.nil?\n\n # set noid\n id = Noid::Rails::Service.new.minter.mint\n\n # set resource type\n resource_type = 'Thesis'\n unless params['resource_type'].first.nil?\n resource_type = params['resource_type'].first\n end\n\n # set visibility\n if params.key?('embargo_release_date')\n params['visibility_after_embargo'] = 'open'\n params['visibility_during_embargo'] = 'authenticated'\n else\n params['visibility'] = 'open'\n end\n\n # set admin set to deposit into\n unless @config['admin_set_id'].nil?\n params['admin_set_id'] = @config['admin_set_id']\n end\n\n # set campus\n params['campus'] = [@config['campus']]\n\n @log.info 'Creating a new ' + resource_type + ' with id:' + id\n\n if @config['type_to_work_map'][resource_type].nil?\n raise 'No mapping for ' + resource_type\n end\n\n model_name = @config['type_to_work_map'][resource_type]\n\n # student research but with a label that is otherwise Publication\n if params['degree_level'] || params['advisor']\n model_name = 'Thesis'\n end\n\n # create the actual work based on the mapped resource type\n model = Kernel.const_get(model_name)\n work = model.new(id: id)\n work.update(params)\n work.apply_depositor_metadata(depositor.user_key)\n work.save\n\n work\nend",
"def fork_master_child_and_monitor\n @fork_master_pid = Kernel.fork do\n at_exit_to_master_child_fork\n Process.die_with_parent\n BEANPICKER_FORK[:child_master] = true\n $0 = \"Beanpicker master child #{@job_name}##{@number}\"\n work_loop(self)\n end\n @loop = Thread.new(self) do |child|\n Process.waitpid @fork_master_pid\n child.fork_master_child_and_monitor if child.running?\n end\n end",
"def create_workers\n @forks = []\n @workers.times do |id|\n pid = fork { Worker.new(@options.merge(id: id)).start }\n @forks << { id: id, pid: pid }\n end\n end",
"def update_fileset_metadata(work, attrs)\n work.ordered_members.to_a.each_with_index do |member, i|\n builder = FileSetBuilder.new(member, user, attrs[i])\n builder.run\n end\n end",
"def assign_nested_attributes_for_collection(env, attributes_collection)\n return true unless attributes_collection\n attributes_collection = attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }\n # checking for existing works to avoid rewriting/loading works that are\n # already attached\n existing_works = env.curation_concern.member_ids\n attributes_collection.each do |attributes|\n next if attributes['id'].blank?\n if existing_works.include?(attributes['id'])\n remove(env.curation_concern, attributes['id']) if has_destroy_flag?(attributes)\n else\n add(env, attributes['id'])\n end\n end\n end",
"def assign_nested_attributes_for_collection(env, attributes_collection)\n return true unless attributes_collection\n attributes_collection = attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }\n # checking for existing works to avoid rewriting/loading works that are\n # already attached\n existing_works = env.curation_concern.member_ids\n attributes_collection.each do |attributes|\n next if attributes['id'].blank?\n if existing_works.include?(attributes['id'])\n remove(env.curation_concern, attributes['id']) if has_destroy_flag?(attributes)\n else\n add(env, attributes['id'])\n end\n end\n end",
"def create\n cp = child_params\n cp[:code] = cp[:code].strip\n @child = Child.new(cp)\n\n respond_to do |format|\n begin\n saved = @child.save\n rescue ActiveRecord::RecordNotUnique => e\n @child.errors[:base] << e.message\n saved = false\n rescue => e\n @child.errors[:base] << e.message\n saved = false\n end\n if saved\n format.html { redirect_to @child, notice: tr('child_created') }\n else\n format.html { render :new }\n end\n end\n end",
"def save_issue_with_child_records_with_redmine_specific_addons(params, existing_time_entry=nil)\n Issue.transaction do\n @time_entry_created = false\n if params[:time_entry] && (params[:time_entry][:hours].present? || params[:time_entry][:comments].present?) && User.current.allowed_to?(:log_time, project)\n @time_entry = existing_time_entry || TimeEntry.new\n @time_entry.project = project\n @time_entry.issue = self\n @time_entry.user = User.current\n @time_entry.spent_on = Date.today\n @time_entry.attributes = params[:time_entry]\n @time_entry_created = true\n self.time_entries << @time_entry\n end\n\n if valid?\n attachments = Attachment.attach_files(self, params[:attachments])\n\n attachments[:files].each {|a| @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}\n # TODO: Rename hook\n Redmine::Hook.call_hook(:controller_issues_edit_before_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})\n begin\n if save\n # TODO: Rename hook\n Redmine::Hook.call_hook(:controller_issues_edit_after_save, { :params => params, :issue => self, :time_entry => @time_entry, :journal => @current_journal})\n else\n raise ActiveRecord::Rollback\n end\n rescue ActiveRecord::StaleObjectError\n attachments[:files].each(&:destroy)\n errors.add_to_base l(:notice_locking_conflict)\n raise ActiveRecord::Rollback\n end\n end\n end\n end",
"def create_relationship_within\n authorize! :read, form_params[:child_id]\n\n if form.save\n notice = I18n.t('create_within', scope: 'hyrax.dashboard.nest_collections_form', child_title: form.child.title.first, parent_title: form.parent.title.first)\n redirect_to redirect_path(item: form.child), notice: notice\n else\n redirect_to redirect_path(item: form.child), flash: { error: form.errors.full_messages }\n end\n end",
"def create_contention(contention)\n contention_child_store(contention).create\n end",
"def create\n @sampling = Sampling.new(params[:sampling])\n\n #used for NESTED Model\n @wf = Wfilter.all()\n\n @valid = false\n if @sampling.sampling_site.nil?\n flash.now[:error] = \"No sampling site set for this sampling\"\n @valid = true\n end\n if @sampling.partner.nil?\n flash.now[:error] = \"No partner found for this sampling\"\n @valid = true\n end\n\n if @valid\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sampling.errors, :status => :unprocessable_entity }\n end\n end\n\n @pt = get_partner\n @sampling.code = get_code(@pt, @sampling.samplingDate, nil)\n\n @title = \"Sampling\"\n \n respond_to do |format|\n if @sampling.save\n\n #Change the child code attribute here because the parent code is yet created\n @fs = FilterSample.count(:all, :conditions => ['sampling_id = ' + @sampling.id.to_s ])\n print ('----Change childs attributes here -------- parent (id-'+@sampling.id.to_s+') code is: '+@sampling.code+'. Childs are -['+@fs.to_s+']-\\n' )\n\n unless @fs.nil? and @fs > 0\n #generate the Microaqua code for all child yet created to this parent\n @fs = FilterSample.all(:conditions => ['sampling_id = ' +@sampling.id.to_s ])\n @fs.each_with_index do |child, index|\n print('----Change childs Old code: (-%s)\\n', child.code)\n #child.code = child.code[0..11] + (\"-F%02d\" % (index + 1))\n child.code = @sampling.code + (\"-F%02d\" % (index + 1))\n print('----Change childs New code: (-%s)\\n' , child.code)\n child.save()\n end \n end \n\n format.html { \n flash[:notice] = 'Sampling was successfully created.'\n redirect_to :action => \"index\" } \n else\n #@partners = Partner.find(:all)\n @codegen = @sampling.code\n @attr_index = 1\n @pt = get_partner\n format.html { \n flash[:notice] = \"Sampling was not created!!\"\n redirect_to :action => :index } \n end\n end\n end",
"def move!\r\n return unless create_new_parent?\r\n parent_arg = find_new_parent\r\n self.move_to_child_of(parent_arg)\r\n if parent_arg\r\n self.debate_id = parent_arg.debate_id\r\n self.children.update_all(\"debate_id = #{parent_arg.debate_id}\")\r\n end\r\n end",
"def valkyrie_perform(work)\n work_acl = Hyrax::AccessControlList.new(resource: work)\n\n PersistHelper.file_sets_for(work).each do |file_set|\n Hyrax::AccessControlList\n .copy_permissions(source: work_acl, target: file_set)\n end\n end",
"def create\n @work = Work.new(params[:work].except(:extra_keys, :extra_values))\n @work.extra = process_extra if params[:extra_keys]\n \n current_dataset.works << @work\n \n Work.create_locations(@work) if @work.places\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to @work, notice: 'Work was successfully created.' }\n format.json { render json: @work, status: :created, location: @work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n resources = if loaded?\n entries\n else\n head + tail\n end\n\n # FIXME: remove this once the mutator on the child side\n # is used to store the reference to the parent.\n relate_resources(resources)\n\n resources.concat(@orphans.to_a)\n @orphans.clear\n\n resources.all? { |r| r.save }\n end",
"def create\n attrs = create_attributes\n @object = klass.new\n object.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX\n run_callbacks :save do\n run_callbacks :create do\n klass == Collection ? create_collection(attrs) : work_actor.create(environment(attrs))\n end\n end\n log_created(object)\n end",
"def change_ownership(creation, pseud)\n creation.pseuds.delete(self)\n creation.pseuds << pseud rescue nil\n if creation.is_a?(Work)\n creation.chapters.each {|chapter| self.change_ownership(chapter, pseud)}\n for series in creation.series\n if series.works.count > 1 && (series.works - [creation]).collect(&:pseuds).flatten.include?(self)\n series.pseuds << pseud rescue nil\n else\n self.change_ownership(series, pseud)\n end\n end\n comment_ids = creation.find_all_comments.collect(&:id).join(\",\")\n Comment.update_all(\"pseud_id = #{pseud.id}\", \"pseud_id = '#{self.id}' AND id IN (#{comment_ids})\") unless comment_ids.blank?\n end\n end",
"def file_sets_for(work)\n Hyrax.custom_queries.find_child_file_sets(resource: work)\n end",
"def dup_question_set_and_save\n parent_q = self\n section_q = parent_q.conditions.first.rule.question\n children_qs = section_q.children\n start_sort_order = 10000\n increment_sort_by = 2\n unless children_qs.blank?\n start_sort_order = children_qs.last.sort_order\n # number of new children questions + condition (parent) and children (rule) questions\n increment_sort_by = children_qs.count + 2\n else\n start_sort_order = section_q.sort_order\n end\n\n # remap sort orders leaving space for new questions before saving new question\n parent_q.survey_template.questions.where(\"sort_order > ?\", start_sort_order).each do |q|\n q.sort_order = q.sort_order + increment_sort_by\n q.save\n end\n\n # this will create new question, answer choices and conditions,\n # but the conditions will be pointed to the old rule which we will need to remap\n new_parent_q = parent_q.amoeba_dup\n # now that we have resorted save new_parent_q into open slot\n new_parent_q.sort_order = new_parent_q.sort_order + increment_sort_by\n new_parent_q.save\n\n # this will duplicate the question, will need to create a new rule,\n # and then set the condtions to new rule id\n new_section_q = section_q.amoeba_dup\n new_section_q.sort_order = new_section_q.sort_order + increment_sort_by\n new_section_q.save\n\n # update newly created conditions with rule relationship now that the rule has been created\n # the rule gets created with the section question\n new_rule = new_section_q.rule\n new_parent_q.conditions.each do |c|\n c.rule_id = new_rule.id\n c.save\n end\n\n children_qs.each do |q|\n new_child_q = q.amoeba_dup\n # update ancestry relationship\n new_child_q.parent = new_section_q\n\n # set sort_order\n new_child_q.sort_order = new_child_q.sort_order + increment_sort_by\n new_child_q.save\n end\n end",
"def new\n logger.debug \"**** WORK NEW ****\"\n @work = Work.new\n @work.login_updated_by = @login\n @popup_title = 'Superwork'\n \n #Reset the in memory array of composers - only do this for new when its not redirected after a failed edit\n session[:composers] = []\n @composers = session[:composers]\n \n prepare_new\n end",
"def generate_for(type, child, parent)\n diff = child.diff(parent)\n path = diff.deltas.last.new_file[:path]\n case type\n when 'thumbnail'\n @project.generate_thumbnail path, child.oid\n when 'inspire'\n @project.generate_inspire_image path\n end\n end",
"def af_perform(work)\n attribute_map = work.permissions.map(&:to_hash)\n work.file_sets.each do |file|\n # copy and removed access to the new access with the delete flag\n file.permissions.map(&:to_hash).each do |perm|\n unless attribute_map.include?(perm)\n perm[:_destroy] = true\n attribute_map << perm\n end\n end\n # apply the new and deleted attributes\n file.permissions_attributes = attribute_map\n file.save!\n end\n end",
"def creatable_works\n all_works.select do |work|\n can?(:create, work)\n end\n end",
"def create_child_from_uuid(uuid)\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK, ZICCLOUDSYNCINGOBJECT.ZIDENTIFIER, \" + \n \"ZICCLOUDSYNCINGOBJECT.ZTYPEUTI \" + \n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZIDENTIFIER=?\", uuid) do |row|\n tmp_child = AppleNotesEmbeddedPublicJpeg.new(row[\"Z_PK\"],\n row[\"ZIDENTIFIER\"],\n row[\"ZTYPEUTI\"],\n @note,\n @backup)\n tmp_child.parent = self\n tmp_child.search_and_add_thumbnails # This will cause it to regenerate the thumbnail array knowing that this is the parent\n add_child(tmp_child)\n end\n end",
"def perform\n begin\n Thread.current[:current_user] = creator\n self.parent_group = AssetGroup.find(asset_group_id)\n group_paths, asset_paths = unpack\n ActiveRecord::Base.transaction do\n groups = initialize_groups(group_paths)\n create_assets(groups, asset_paths)\n end\n ensure\n Thread.current[:current_user] = nil\n cleanup\n\n nil\n end\n end",
"def create\n @work = Work.new(params[:work])\n\n respond_to do |format|\n if @work.save\n flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.work'))\n if @patron\n @patron.works << @work\n end\n format.html { redirect_to @work }\n format.json { render :json => @work, :status => :created, :location => @work }\n else\n prepare_options\n format.html { render :action => \"new\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def add_child(new_child)\n if !@children.include?(new_child)\n new_child.parent = self\n end\n \n end",
"def add_child\n @portfolio = @site.portfolios.build\n @parent_id = params[:id]\n render :action => 'new'\n end",
"def deploy_as_childs_request\n # Each requests found for this template\n self.requests.each { |r|\n # Each milestones linked to this request\n r.milestones.select{ |m1| \n m1.checklist_not_applicable==0 and m1.status==0 and m1.done==0 and (r.contre_visite==\"No\" or r.contre_visite_milestone==m1.name) and self.milestone_names.map{|mn| mn.title}.include?(m1.name)\n }.each { |m|\n c = ChecklistItem.find(:first, :conditions=>[\"template_id=? and request_id=? and milestone_id=?\", self.id, r.id, m.id])\n # Create\n if c == nil\n parent = ChecklistItem.find(:first, :conditions=>[\"template_id=? and request_id=? and milestone_id=?\", self.parent.id, r.id, m.id])\n if parent\n ChecklistItem.create(:milestone_id=>m.id, :request_id=>r.id, :parent_id=>parent.id, :template_id=>self.id)\n end\n # Update\n else\n parent = ChecklistItem.find(:first, :conditions=>[\"template_id=? and request_id=? and milestone_id=?\", self.parent.id, r.id, m.id])\n if parent\n c.parent_id = parent.id\n c.save\n end\n end\n }\n }\n end",
"def create_subtasks(parent_service_task, parent_service)\n tasks = []\n service_resources.each do |child_svc_rsc|\n scaling_min = child_svc_rsc.scaling_min\n 1.upto(scaling_min).each do |scaling_idx|\n nh = parent_service_task.attributes.dup\n %w(id created_on updated_on type state status message).each { |key| nh.delete(key) }\n nh['options'] = parent_service_task.options.dup\n nh['options'].delete(:child_tasks)\n # Initial Options[:dialog] to an empty hash so we do not pass down dialog values to child services tasks\n nh['options'][:dialog] = {}\n next if child_svc_rsc.resource_type == \"ServiceTemplate\" &&\n !self.class.include_service_template?(parent_service_task,\n child_svc_rsc.resource.id,\n parent_service)\n new_task = parent_service_task.class.new(nh)\n new_task.options.merge!(\n :src_id => child_svc_rsc.resource.id,\n :scaling_idx => scaling_idx,\n :scaling_min => scaling_min,\n :service_resource_id => child_svc_rsc.id,\n :parent_service_id => parent_service.id,\n :parent_task_id => parent_service_task.id,\n )\n new_task.state = 'pending'\n new_task.status = 'Ok'\n new_task.source = child_svc_rsc.resource\n new_task.save!\n new_task.after_request_task_create\n parent_service_task.miq_request.miq_request_tasks << new_task\n\n tasks << new_task\n end\n end\n tasks\n end",
"def create_child(name, file_contents)\n # Parse the contents to ensure they are valid JSON\n begin\n object = Chef::JSONCompat.parse(file_contents)\n rescue Chef::Exceptions::JSON::ParseError => e\n raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self, e, \"Parse error reading JSON creating child '#{name}': #{e}\")\n end\n\n # Create the child entry that will be returned\n result = make_child_entry(name, true)\n\n # Normalize the file_contents before post (add defaults, etc.)\n if data_handler\n object = data_handler.normalize_for_post(object, result)\n data_handler.verify_integrity(object, result) do |error|\n raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self, nil, \"Error creating '#{name}': #{error}\")\n end\n end\n\n # POST /api_path with the normalized file_contents\n begin\n rest.post(api_path, object)\n rescue Timeout::Error => e\n raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self, e, \"Timeout creating '#{name}': #{e}\")\n rescue Net::HTTPClientException => e\n # 404 = NotFoundError\n if e.response.code == \"404\"\n raise Chef::ChefFS::FileSystem::NotFoundError.new(self, e)\n # 409 = AlreadyExistsError\n elsif $!.response.code == \"409\"\n raise Chef::ChefFS::FileSystem::AlreadyExistsError.new(:create_child, self, e, \"Failure creating '#{name}': #{path}/#{name} already exists\")\n # Anything else is unexpected (OperationFailedError)\n else\n raise Chef::ChefFS::FileSystem::OperationFailedError.new(:create_child, self, e, \"Failure creating '#{name}': #{e.message}\")\n end\n end\n\n # Clear the cache of children so that if someone asks for children\n # again, we will get it again\n @children = nil\n\n result\n end",
"def create_journal_with_subissues\n if @current_journal\n # attributes changes\n (Issue.column_names - %w(id description lock_version created_on updated_on parent_id materialized_path)).each {|c|\n @current_journal.details << JournalDetail.new(:property => 'attr',\n :prop_key => c,\n :old_value => @issue_before_change.send(c),\n :value => send(c)) unless send(c)==@issue_before_change.send(c)\n }\n # custom fields changes\n custom_values.each {|c|\n next if (@custom_values_before_change[c.custom_field_id]==c.value ||\n (@custom_values_before_change[c.custom_field_id].blank? && c.value.blank?))\n @current_journal.details << JournalDetail.new(:property => 'cf', \n :prop_key => c.custom_field_id,\n :old_value => @custom_values_before_change[c.custom_field_id],\n :value => c.value)\n } \n @current_journal.save\n end\n end"
] | [
"0.63733083",
"0.6279779",
"0.598384",
"0.59336245",
"0.59103876",
"0.57412577",
"0.56821907",
"0.5675552",
"0.5580366",
"0.5564886",
"0.5513622",
"0.55012125",
"0.54822636",
"0.54739124",
"0.5445093",
"0.54324025",
"0.5389517",
"0.5380987",
"0.53791934",
"0.53449917",
"0.53446394",
"0.53446394",
"0.53319883",
"0.53067636",
"0.5294661",
"0.5286325",
"0.52709",
"0.52568763",
"0.5251211",
"0.52046335",
"0.51731116",
"0.51729304",
"0.5170051",
"0.51647276",
"0.5145413",
"0.5139714",
"0.5135887",
"0.5129627",
"0.51281357",
"0.5126066",
"0.51193136",
"0.5117898",
"0.511699",
"0.5111119",
"0.5105536",
"0.5101595",
"0.5085436",
"0.5084383",
"0.5066085",
"0.5015139",
"0.50109583",
"0.50036186",
"0.50031525",
"0.49961147",
"0.4978254",
"0.49576548",
"0.4956552",
"0.49564043",
"0.49562278",
"0.49519515",
"0.49427938",
"0.4940524",
"0.4940126",
"0.49311355",
"0.4920985",
"0.4918683",
"0.49147606",
"0.48934972",
"0.48762238",
"0.48612928",
"0.48596933",
"0.48474333",
"0.48383197",
"0.48383197",
"0.48295158",
"0.4825276",
"0.4823622",
"0.48137996",
"0.48131627",
"0.4810679",
"0.48101047",
"0.4804052",
"0.4803494",
"0.48031944",
"0.47974548",
"0.4791291",
"0.4790412",
"0.47841805",
"0.47630262",
"0.47621557",
"0.4761521",
"0.47531497",
"0.47518593",
"0.47499436",
"0.47440138",
"0.47330186",
"0.47301632",
"0.47295237",
"0.4723852",
"0.47179708"
] | 0.86703324 | 0 |
Begin Display Custom SignIn This section is to enable registration form to be embedded in other pages | def resource_name
:user
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @partner_sign_in = true\n render layout: 'sign_pages'\n end",
"def new\n #showing the registration page\n end",
"def sign_in\n end",
"def login\n layout 'sign_in'\n end",
"def sign_in\n\tend",
"def sign_in\n\n end",
"def signin\n end",
"def signup_form_javascript\n render :partial => 'users/signup_form_javascript'\n end",
"def sign_in\n render inline: \"<html><head><script>window.close();</script></head><body></body></html>\".html_safe\n end",
"def second_step\n\t\trender :layout => 'signup' \n\t\tend",
"def register_page\n render template: \"/register/registerPage\"\n end",
"def viewDidLoad\n super\n\n self.title = \"Sign In\"\n\n view.styleId = 'register-view'\n end",
"def front_office_sign_in_page\n @last_page = FrontOfficeSignInPage.new\n end",
"def visit_sign_in_page\n visit(SIGN_IN_PAGE_URL)\n end",
"def new\n super\n @title = \"Sign up\"\n logger.debug \"\\n\\t RegistrationsController#new \\n\\n\"\n end",
"def signin_get\n @mode = :signin\n \n if params[:req].present? && !ApplicationController::RequiredIdentity.payload(session)\n @mode = :signup\n kind = params[:req].to_sym\n back = request.env[\"HTTP_REFERER\"]\n \n ApplicationController::RequiredIdentity.set_payload(session, \n :on_success => back,\n :on_cancel => back,\n :kind => kind)\n end\n \n render! :action => \"new\", :layout => \"dialog\"\n end",
"def signup\r\n\t@title = \"Sign Up\"\r\n end",
"def successful_registration_look_for_right_hand_side_content\n @session.visit(@pai_main_url + @view_registration)\n fill_in_fields_and_submit(generate_random_email_address, @user_password, @user_password)\n end",
"def sign_in\n @shift = Shift.find(params[:id])\n unless (from_admin? or (@shift.user == @user))\n redirect_with_flash(\"That shift does not belong to you.\") and return\n end\n \n #id of the div that contains quick sign up form\n div_id = @shift.sign_in_div\n respond_to do |wants|\n wants.html {}\n wants.js do\n render :update do |page|\n page.replace_html div_id, :partial => \"quick_sign_in\"\n page[div_id].hide\n page[div_id].visual_effect :blind_down, :duration => 0.2\n end\n end\n end\n rescue Exception => e\n redirect_with_flash(e.message) and return\n else\n #if one tries sign_in to a submitted shift report.Whether to show submitted shifts is up for discussion (tell me). -H\n if @shift.submitted?\n redirect_with_flash(\"You have already submitted this shift report!\") and return\n end\n \n #preventing user to sign in to a shift that has passed\n if (@shift.has_passed? and @shift.scheduled?)\n redirect_with_flash(\"Too late. Can't sign in to a shift that has passed.\")and return\n end\n \n render :template => 'shift/sign_in' if from_admin?\n end",
"def signup\n @user = User.new\n # render :layout => 'framed'\n end",
"def new\n session[:user_return_to] ||= params[:user_return_to]\n @already_hoc_registered = params[:already_hoc_registered]\n @hide_sign_in_option = true\n if params[:providerNotLinked]\n if params[:useClever]\n # The provider was not linked, and we need to tell the user to sign in specifically through Clever\n flash.now[:alert] = I18n.t 'auth.use_clever', provider: I18n.t(\"auth.#{params[:providerNotLinked]}\")\n else\n # This code is only reached through the oauth flow when the user already has an email account.\n # Usually email would not be available for students, this is a special case where oauth fills it in.\n flash.now[:alert] = I18n.t 'auth.not_linked', provider: I18n.t(\"auth.#{params[:providerNotLinked]}\")\n @email = params[:email]\n end\n end\n super\n end",
"def sign_in\n email_create_elem.send_keys @email\n create_bt_elem.click\n if page.has_text?('registered', :wait => 5)\n login\n else\n register\n end\n end",
"def signin\n\t\t\t# Author\n\t\t\tauthorize! :login, nil\n\t\tend",
"def create_subscribe_competition_front_register\n @current_object = User.new\n\t\t@current_object.build_profile if @current_object.profile.nil?\n session[:compredirecid] = params[:id]\n render :update do |page|\n page[\"buylist\"].hide\n page[\"registerform\"].replace_html :partial=>\"create_subscribe_competition_front_register\"\n page[\"iteam_imageregister\"].show\n end\n end",
"def submit_signup_details_without_password\n user = Users.signup_user_without_password\n enter_signup_details(user)\n # @pages.page_home.signup_register_button\n end",
"def login\n # show LOGIN form\n\n end",
"def client_sign_up\n\n end",
"def displayLoginPage()\n\t# User Name: \n\t# Password:\n\t# Forgot Password?\tNew User?\n\treturn\nend",
"def signup_info\n end",
"def login_instructions\n end",
"def login_page\n end",
"def sign_up\n request_params = {\n host_url_with_protocol: host_url_with_protocol,\n host_url: host_url,\n entity_type: GlobalConstant::TemplateType.registration_template_type\n }\n service_response = GlobalConstant::StTokenSale.get_client_details(request_params)\n\n # Check if error present or not?\n unless service_response.success?\n render_error_response(service_response)\n return\n end\n\n @presenter_obj = ::Web::Client::Setup.new(service_response, params)\n\n redirect_to '/token-sale-blocked-region', status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.is_blacklisted_ip?(get_ip_to_aml_countries)\n redirect_to \"/login\", status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.has_registration_ended?\n set_page_meta_info(@presenter_obj.custom_meta_tags)\n end",
"def show\n\t\t# Initializing the Inivitation form from profile page\n\tend",
"def login\n\t#Login Form\n end",
"def signup\n end",
"def signup\n end",
"def require_sign_in\n unless current_user\n flash['info'] = I18n.t 'billfold.please_sign_in'\n redirect_to root_path\n end\n end",
"def nav_login_button\r\n \r\n end",
"def signin_dropdown\n view_context.multiauth_dropdown(\"Sign In\")\n end",
"def new\n @authentications = current_user.authentications if current_user\n if current_user\n # flash[:notice] = \"All signed in. Welcome back, #{current_user.handle}!\"\n redirect_to after_sign_in_path_for(current_user), notice: \"All signed in. Welcome back, #{current_user.handle}!\"\n end\n @auth_delete = true\n smartrender\n end",
"def require_signin\n # If the user is not signed in:\n unless signed_in?\n # Calls the store_location method to save the url the unsigned in user was trying to navigate to:\n store_location\n # Establishes an error to display:\n flash[:error] = \"You must be signed in to reach that page.\"\n # Sends the unsigned in user to the sign in page.\n redirect_to signin_path\n end\n end",
"def call\n add_fields(confirm_registration: true)\n end",
"def loginpage\n end",
"def goldberg_login\n render :file => \"#{RAILS_ROOT}/vendor/plugins/goldberg/app/views/goldberg/auth/_login.rhtml\", :use_full_path => false\n end",
"def registration\n @saas = SETTINGS['saas_registration_mode']\n @user = User.new\n initialize_registration_form\n @errors = {\n :general => [],\n :subjects => [],\n :policies => [],\n :purchase => []\n }\n end",
"def adm_login_form\n render 'adm_login'\n end",
"def signed_in_user\n\t\t\tredirect_to signin_url, notice: \"Please sign in.\" unless signed_in?\n\t\tend",
"def sign_in_ui(user)\n visit user_session_url\n\n fill_in \"user_email\", with: user.email\n fill_in \"user_password\", with: user.password\n\n click_on \"Log in\"\n end",
"def new\n\n if signed_in? && !isAdmin?\n sign_out\n redirect_to signup_url\n elsif signed_in? && isAdmin?\n redirect_to \"/new_prof\"\n end\n @title= \"Sign Up\"\n @user = User.new\n\n \n end",
"def start_registration\r\n \r\n end",
"def login\n render :layout => 'login_user'\n end",
"def sign_in(user_data)\n fill_in 'Email:', :with => user_data['email']\n fill_in 'Password:', :with => user_data['password']\n click_button 'Sign In'\n end",
"def registration(login, pass, first_name, last_name)\n visit(HomePage)\n on(HomePage).register_element.when_visible($WT).click\n on(RegisterPage).user_login_element.when_visible($WT).send_keys login\n on(RegisterPage).user_password = pass\n on(RegisterPage).user_password_confirmation = pass\n on(RegisterPage).user_firstname = first_name\n on(RegisterPage).user_lastname = last_name\n on(RegisterPage).user_language = 'English'\n on(RegisterPage).user_mail = login + '@dd.dd'\n on(RegisterPage).submit\n end",
"def signed_in_user\n\t store_location\n redirect_to signin_url, notice: \"Please sign in.\" unless signed_in?\n end",
"def sign_in(*args); end",
"def before_each(req)\n @subsection = \"signup\"\n @title = \"Sign Up for Lynr\"\n @stripe_pub_key = stripe_config.pub_key\n super\n end",
"def valid_signin(user)\n fill_in 'Email', with: user.email\n fill_in 'Password', with: user.password\n click_button 'Sign in', match: :first\n # print page\nend",
"def enter_register_information(user) \r\n puts \"+ <action> enter_register_information --- begin\"\r\n adobe_id_frame_enter_username(user[:email_address])\r\n adobe_id_frame_enter_password_2(user[:password])\r\n adobe_id_frame_retype_password(user[:retype_pass])\r\n adobe_id_frame_firstname_input(user[:first_name])\r\n adobe_id_frame_lastname_input(user[:last_name])\r\n adobe_id_select_country_region(user[:country_region])\r\n\r\n create_btn.click\r\n sleep 5\r\n puts \"+ <action> enter_register_information --- end\"\r\n\r\n if warning_display? \r\n return adobe_id_frame_warning_message.text\r\n end\r\n\r\n end",
"def restricted_registration\n redirect_to root_url, notice: \"You are already registered\" if signed_in?\n end",
"def signIn_user\n unless signed_in?\n store_location\n redirect_to signin_url, notice: \"Please sign in.\"\n end\n end",
"def register\n if @user.blank? || (!@user.is_registered && @user.tips.count == 0 && @user.votes.count == 0)\n redirect_to :profile, alert: \"Registration Impossible. There is nothing to register\"\n elsif @user.is_registered\n redirect_to :profile, alert: \"Registration Impossible. Account already registered\"\n else\n if @user.register(user_registration_params.to_h)\n #cookies.delete(\"user_id\") #don't delete the cookie, just in case I'm logging in on someone else's device.\n sign_in @user\n redirect_to :profile, notice: \"Account successfully registered. You can now login from anywhere !\"\n else\n redirect_to :profile, alert: \"Registration failed. #{@user.errors.full_messages.to_sentence}\"\n end\n end\n end",
"def sign_in(user)\n visit signin_path\n fill_in \"Name\", with: user.name\n fill_in \"Email\", with: user.uid\n click_button \"Sign In\"\nend",
"def email_signup\n email = params[:Email] || params[:email] || \"\"\n @src = \"#{website.email_signup_url}#{email}\"\n @page_title = \"Newsletter Sign Up\"\n render_template\n end",
"def signed_in_user\n redirect_to signin_url, notice: \"Please sign in.\" unless signed_in?\n end",
"def new\n \t@client = Client.new\n @page_title = \"Registration\"\n end",
"def new\n # render the login form\n end",
"def signed_in_user\r\n redirect_to signin_url, notice: \"Fai il login\" unless signed_in?\r\n # flash[:notice] = \"Please sign in\"\r\n end",
"def custom_user_auth\n\t\t\tunless student_signed_in? || admin_signed_in?\n\t\t\t\tredirect_to root_path, notice: \"You have to sign in.\"\n\t\t\tend\n\t\tend",
"def require_signin\n if !signed_in? \n flash.now.alert = \"先登录!\"\n redirect_to signin_path\n end\n end",
"def signed_in_user\n #Method signed_in? defined in app/helpers/sessions_helper.rb\n redirect_to signin_url, notice: \"Please sign in.\" unless signed_in? #notice :\"Please sign in\" = flash[:notice] = \"Please sign in\"\n end",
"def signed_in_user\n #Method signed_in? defined in app/helpers/sessions_helper.rb\n redirect_to signin_url, notice: \"Please sign in.\" unless signed_in? #notice :\"Please sign in\" = flash[:notice] = \"Please sign in\"\n end",
"def feature_plain_sign_in(login, password, options = {})\n visit '/'\n fill_in 'educator_login_text', with: login\n fill_in 'educator_password', with: password\n if options[:login_code]\n fill_in 'educator_login_code', with: options[:login_code]\n end\n click_button 'Sign in'\n end",
"def create\n\n @signin = SignIn.new( params[ :sign_in ] )\n\n # The OpenID subsystem ends up back at this method with a parameter\n # of \"openid_url\" set up, so we have to look at that too. It also\n # annoyingly *requires* this to be *set* when we're calling out.\n # There being no coherent documentation, a bodge is forced.\n\n @signin.identity_url ||= params[ :openid_url ]\n params[ :openid_url ] ||= @signin.identity_url\n\n # Identity URL is *not* nil, but *is* empty? Form was submitted\n # with an empty string. Fall through to the password-based code.\n #\n # URL is *not* nil and is *not* empty? Form was submitted with a\n # identity URL; call OpenID authentication routine.\n #\n # URL *is* nil? We're being called from the Open ID plug-in with\n # the result of a sign-in attempt. Again, call the authentication\n # routine but don't try and read the JavaScript detection field.\n\n if ( not @signin.identity_url.nil? and @signin.identity_url.empty? )\n if @signin.valid?\n session[ :javascript ] = params[ :javascript ]\n process_password_sign_in_with( @signin )\n else\n render :new\n end\n\n else\n unless ( @signin.identity_url.nil? )\n session[ :javascript ] = params[ :javascript ]\n @signin.identity_url = User.rationalise_id( @signin.identity_url )\n end\n\n open_id_authentication( @signin.identity_url )\n end\n\n rescue => error\n failed_login(\n @signin,\n :external_message,\n :message => error.message\n )\n\n end",
"def registration\n @registration = Registration.for_user(current_user).for_olympiad(@olympiad).first\n @active_tab = params[:page] || \"me\"\n redirect_to :action=>\"register\" unless @registration\n end",
"def login\n # render :login\n end",
"def sign_in\n trait()\n end",
"def account_infos()\n\t\ttxt = render(:partial => \"auth/remotelogin\", :layout => 'auth')\n\t\t\"\" + javascript_tag('function showloginform() {'+ update_element_function(\"accountinfo\", :content => txt) +\n\t\t' document.getElementById(\\'post_login\\').focus();}') + \"<!-- account info --> <div id=\\\"accountinfo\\\">\"+\n\t\trender(:partial => \"auth/remoteinfo\", :layout => 'auth') + \"</div>\"\n\tend",
"def sign_in\n trait\n end",
"def create_subscribe_competition_front_login\n \n session[:compredirecid] = params[:id]\n render :update do |page|\n page[\"buylist\"].hide\n page[\"loginform\"].replace_html :partial=>\"create_subscribe_competition_front_login\"\n page[\"iteam_imagelogin\"].show\n end\n end",
"def signed_in_user\n\n\t\t# If check to see if user is signed in\n \tunless signed_in?\n\n \t\t# Store the last the requested action and store it\n \t\tstore_location\n\n \t\t# Redirect to the signin url with notice to signin\n \t\tredirect_to signin_url, notice: \"Please sign in.\"\n \tend\n \tend",
"def sign_up(resource_name, resource)\n # sign_in(resource_name, resource)\n end",
"def new\n if logged_in?\n # User who has logged in has no need to access create action\n redirect_to current_user\n else\n # Get ready to display signup page by declaring instance var\n \t @user = User.new\n end\n end",
"def require_signin\n unless signed_in?\n store_location\n flash[:notice] = \"Please sign in to continue\"\n redirect_to signin_path\n end\n end",
"def thelper_sign_in( u = User.find_by_identity_url( 'http://openid.pond.org.uk' ) )\n visit signin_path\n fill_in :sign_in_identity_url, :with => u.identity_url\n thelper_submit_with_named_button()\n assert_equal home_path, current_path\n return u\n end",
"def register\r\n logger.info(\"UserController::register\")\r\n if logged_in?\r\n redirect_to :controller=>'user' , :action=>'my_account'\r\n end \r\n end",
"def signin\n embed_screen api_args.select_keys(\"redirect_uri\", \"client_id\", \"response_type\")\n end",
"def require_signin\n unless signed_in?\n store_location\n flash[:error] = 'Please sign in.'\n redirect_to signin_url\n end\n end",
"def after_sign_up_path_for(resource)\n #super(resource)\n\n #'/pages/monprofil'\n\n if(session[:page_id].present?)\n cours_show_path(session[:page_id])\n else\n '/users/sign_up' \n end\n end",
"def after_sign_in_path_for(resource)\n splash_page\n end",
"def get_signup(req)\n render template_path()\n end",
"def signed_in_user\n store_location #pour ensuite rediriger l'utilisateur vers la destination qu'il voulait avant\n # d'etre rediriger vers la pagne d'authentification\n redirect_to signin_url, notice: \"Please sign in.\" unless signed_in?\n end",
"def sign_in\n if cookies[ :user_id ] != nil\n redirect_to :action => \"index\" ,:controller => \"homepage\"\n end\n render layout: false\n end",
"def form_sign(user_name, password)\n sign_form.click\n form_sign_data_enter(user_name, password)\n end",
"def new\n remember_prev_page!\n if !session[:invitation_code].blank?\n @user = User.new\n @user.use_invitation_code(find_invitation_code)\n flash[:notice] = \"if you wish to response to an argument or debate you have to register, please register.\"\n # Group member signup\n @group = (params[:hash] ? Group.find_by_unique_hash(params[:hash]) : nil)\n @user.group_id = @group.id if @group\n end\n respond_to do |format|\n format.html\n format.js {render :partial => \"login_tip\"}\n end\n end",
"def new\n @title = \"Sign-In or Register\"\n @user = User.new\n\n end",
"def signed_in_user\n unless signed_in?\n flash.now[:danger] = \"Please sign in first.\"\n # store the edit location for redirect back\n store_location\n redirect_to signin_url\n end\n end",
"def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to register_path\n end\n end",
"def require_signin\n unless signed_in?\n store_location\n flash[:error] = 'Please Sign In'\n redirect_to signin_path\n end\n end",
"def show\n unless logged_in?\n flash.now[:danger] = 'Você não possui autorização'\n render 'sessions/new'\n end\n end",
"def require_signin\n unless signed_in?\n store_location\n flash[:error] = \"Please sign in to continue\"\n redirect_to signin_url\n end\n end",
"def candidate_sign_up\n\n end"
] | [
"0.66339207",
"0.6368181",
"0.6303788",
"0.6260165",
"0.6228212",
"0.6227329",
"0.6147987",
"0.6147557",
"0.6136934",
"0.6086453",
"0.60843635",
"0.60747653",
"0.6067426",
"0.60292995",
"0.5988416",
"0.59651905",
"0.59518564",
"0.5885948",
"0.586249",
"0.5855816",
"0.583419",
"0.58284223",
"0.58221453",
"0.5817409",
"0.58116364",
"0.580272",
"0.5794185",
"0.57825404",
"0.5776731",
"0.57625306",
"0.575824",
"0.5753125",
"0.57530844",
"0.5745573",
"0.5738229",
"0.5738229",
"0.57367903",
"0.5730299",
"0.57283074",
"0.5725913",
"0.5723035",
"0.5715488",
"0.57104766",
"0.5708148",
"0.5695399",
"0.56929016",
"0.56672734",
"0.5655832",
"0.562775",
"0.5626842",
"0.56212866",
"0.5620558",
"0.5620023",
"0.5615067",
"0.56012344",
"0.55897653",
"0.5589275",
"0.5583132",
"0.5578233",
"0.55644315",
"0.55609286",
"0.55565923",
"0.5554491",
"0.555111",
"0.5538878",
"0.55388075",
"0.55384314",
"0.5528979",
"0.5528533",
"0.5528286",
"0.5528286",
"0.5523312",
"0.5521329",
"0.5520052",
"0.5518934",
"0.55167687",
"0.55165803",
"0.55156636",
"0.55096513",
"0.550947",
"0.55079323",
"0.54996777",
"0.54952615",
"0.54903287",
"0.54895276",
"0.5488051",
"0.54810494",
"0.5476144",
"0.54758143",
"0.5475794",
"0.5474925",
"0.54742897",
"0.5472667",
"0.5470517",
"0.54645884",
"0.54576254",
"0.5456973",
"0.5444861",
"0.5442787",
"0.54391",
"0.54382294"
] | 0.0 | -1 |
rubocop:disable Metrics/PerceivedComplexity rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/BlockNesting | def update?
if record.updateable_time?
if record.subject&.personal?
if record.vip_updateable_time?
return true if user.staff.id.in? record.staff_ids
return true if user.id == record.creator_id
end
end
if record.klass_subject&.fixed == false
return true if user.staff.id.in? record.staff_ids
return true if user.id == record.creator_id
end
return true if user.role? 'STUDENT_ADMIN'
end
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def block; end",
"def blocks; end",
"def blocks; end",
"def blocks; end",
"def block_node; end",
"def block_node; end",
"def block?; end",
"def yield; end",
"def blocks() end",
"def private; end",
"def captured_by_block?; end",
"def pre_block\n end",
"def pre_block\n end",
"def context(&block); end",
"def context(&block); end",
"def block\n true\n end",
"def require_block; end",
"def captured_by_block; end",
"def nesting() end",
"def before_block_boundary?; end",
"def with_block(&block)\n end",
"def run(&block)\n end",
"def to_prepare_blocks; end",
"def list_block()\n\nend",
"def block_node=(_); end",
"def each(&block)\n end",
"def block_reference_count; end",
"def return(&block); end",
"def after_block_boundary?; end",
"def run(&block); end",
"def post_block\n end",
"def post_block\n end",
"def inside_t1\n yield\n end",
"def blocklists; end",
"def block_given?() end",
"def anonymous_blocklists; end",
"def main_content\n yield if block_given?\n end",
"def inner\n puts \"TODO\"\n end",
"def code_of_conduct; end",
"def next()\n \n end",
"def next()\n \n end",
"def block_class() Block; end",
"def callBlock\n yield\n yield\nend",
"def each(&block)\n raise NotImplementedError\n end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def outer; end",
"def content\n call_block\n end",
"def probers; end",
"def executor; end",
"def executor; end",
"def executor; end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block)\n\n end",
"def initialize_starting_block\n nil\n end",
"def what_i_am(&block)\n\t\tblock.class\n\tend",
"def block(_hash)\n raise Sibit::NotSupportedError, 'block() doesn\\'t work here'\n end"
] | [
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.70014393",
"0.6461039",
"0.6461039",
"0.6461039",
"0.6405012",
"0.6405012",
"0.6322225",
"0.6276294",
"0.6236953",
"0.62171805",
"0.60393035",
"0.60327923",
"0.60327923",
"0.6007055",
"0.6007055",
"0.6003929",
"0.59921455",
"0.5975899",
"0.5936797",
"0.5889108",
"0.584042",
"0.58138466",
"0.5807199",
"0.5806518",
"0.57978696",
"0.57631344",
"0.5755091",
"0.57328105",
"0.5689781",
"0.56683487",
"0.5653239",
"0.5653239",
"0.561412",
"0.5578132",
"0.5577889",
"0.5567821",
"0.5566499",
"0.5566065",
"0.5562597",
"0.55541253",
"0.55541253",
"0.5537924",
"0.5533672",
"0.55265814",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5525249",
"0.5493057",
"0.5486189",
"0.5484208",
"0.54763126",
"0.54763126",
"0.54763126",
"0.54496753",
"0.54496753",
"0.54496753",
"0.54496753",
"0.54496753",
"0.54496753",
"0.5441631",
"0.5440916",
"0.54280055",
"0.5426632"
] | 0.0 | -1 |
Assumptions: 1. CWD is "jenkinsintegration" 2. Scenario config JSON files in "./config/scenarios/.json" 3. Node config JSON files in "./config/nodes/.json" 4. Hiera config YAML files in "./config/hieras//hiera.yaml" 5. Hiera data trees in "./config/hieras///" | def parse_scenario_file(scenario_id)
JSON.parse(File.read(File.join('config', 'scenarios', scenario_id + '.json')))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_configs(scenario_id)\n parse_node_config_files(parse_scenario_file(scenario_id))\nend",
"def hiera_configpath(hiera)\n File.join('config', 'hieras', hiera, 'hiera.yaml')\nend",
"def read_component_configuration component,platform,configuration\n hp_dir=File.join(configuration['base_dir'],'src','hand',platform,component)\n hc_dir=File.join(configuration['base_dir'],'src','hand','common',component)\n gp_dir=File.join(configuration['base_dir'],'src','gen',platform,component)\n gc_dir=File.join(configuration['base_dir'],'src','gen','common',component)\n cfg={}\n [hp_dir,hc_dir,gp_dir,gc_dir].each do |cfg_dir|\n file_to_merge=File.join(cfg_dir,'build.cfg')\n if File.exists?(file_to_merge)\n cfg_to_merge=read_configuration(file_to_merge)\n cfg=merge_configurations(cfg,cfg_to_merge) \n end\n end\n return cfg\nend",
"def read_etl_data\n\n ### CHANGE CUSTOM PATHS\n\toetl_script = OPT[:oetl]\n\tetl_dir = Pathname.new File.expand_path(\"./spec/etl/\")\n #etl_dir.children.each{|f| puts \"#{oetl_script} #{f} \" if f.extname == '.json' } # debugging\n etl_dir.children.each{ |f| `#{oetl_script} #{f} ` if f.extname == '.json' }\n\nend",
"def install_hiera_config(logger, options)\n # Validate hiera config file\n hiera_config = options[:hiera_config]\n unless hiera_config.is_a?(String)\n raise ArgumentError, \"Called install_hiera_config with a #{hiera_config.class} argument\"\n end\n file_src = if hiera_config.start_with? '/'\n hiera_config\n elsif hiera_config =~ %r{^environments/#{Regexp.escape(environment)}/}\n File.join(@tempdir, hiera_config)\n else\n File.join(@tempdir, 'environments', environment, hiera_config)\n end\n raise Errno::ENOENT, \"hiera.yaml (#{file_src}) wasn't found\" unless File.file?(file_src)\n\n # Munge datadir in hiera config file\n obj = YAML.load_file(file_src)\n (obj[:backends] || %w(yaml json)).each do |key|\n next unless obj.key?(key.to_sym)\n if options[:hiera_path_strip].is_a?(String)\n next if obj[key.to_sym][:datadir].nil?\n rexp1 = Regexp.new('^' + options[:hiera_path_strip])\n obj[key.to_sym][:datadir].sub!(rexp1, @tempdir)\n elsif options[:hiera_path].is_a?(String)\n obj[key.to_sym][:datadir] = File.join(@tempdir, 'environments', environment, options[:hiera_path])\n end\n rexp2 = Regexp.new('%{(::)?environment}')\n obj[key.to_sym][:datadir].sub!(rexp2, environment)\n\n # Make sure the dirctory exists. If not, log a warning. This is *probably* a setup error, but we don't\n # want it to be fatal in case (for example) someone is doing an octocatalog-diff to verify moving this\n # directory around or even setting up Hiera for the very first time.\n unless File.directory?(obj[key.to_sym][:datadir])\n message = \"WARNING: Hiera datadir for #{key} doesn't seem to exist at #{obj[key.to_sym][:datadir]}\"\n logger.warn message\n end\n end\n\n # Write properly formatted hiera config file into temporary directory\n File.open(File.join(@tempdir, 'hiera.yaml'), 'w') { |f| f.write(obj.to_yaml.gsub('!ruby/sym ', ':')) }\n logger.debug(\"Installed hiera.yaml from #{file_src} to #{File.join(@tempdir, 'hiera.yaml')}\")\n end",
"def generate_hiera_template\n ssh_key = Bebox::Project.public_ssh_key_from_file(self.project_root, self.name)\n project_name = Bebox::Project.shortname_from_file(self.project_root)\n Bebox::PROVISION_STEPS.each do |step|\n step_dir = Bebox::Provision.step_name(step)\n generate_file_from_template(\"#{Bebox::FilesHelper.templates_path}/puppet/#{step}/hiera/data/environment.yaml.erb\", \"#{self.project_root}/puppet/steps/#{step_dir}/hiera/data/#{self.name}.yaml\", {step_dir: step_dir, ssh_key: ssh_key, project_name: project_name})\n end\n end",
"def create_structure\n if File.exists?(\"features\") && File.directory?(\"features\")\n return\n else\n FileUtils.mkpath \"features/step_definitions\"\n FileUtils.mkdir \"features/support\"\n FileUtils.mkdir \"features/screenshots\"\n FileUtils.touch\"features/support/env.rb\"\n end\n \n\n end",
"def loadConfigurationFiles\n baseDirectory = 'configuration'\n\n mainDirectory = 'Configuration'\n customDirectory = 'myConfiguration'\n\n mainPath = Nil.joinPaths(baseDirectory, mainDirectory)\n customPath = Nil.joinPaths(baseDirectory, customDirectory)\n\n targets = Nil.readDirectory(mainPath)\n targets = targets.map{|x| ConfigurationEntry.new(x)}\n\n priorityFiles =\n [\n #need to make an exception for the User.rb here because it needs to get included first\n ['User', 2],\n ['Torrent', 1],\n ]\n\n priorityFiles.each do |name, priority|\n name = \"#{name}.rb\"\n targets.each do |entry|\n if entry.target.name == name\n entry.priority = priority\n break\n end\n end\n end\n\n targets.sort!\n\n targets.each do |entry|\n target = entry.target\n customPath = Nil.joinPaths(customPath, target.name)\n if File.exists?(customPath)\n require customPath\n else\n require target.path\n end\n end\nend",
"def validate_and_upload_config_jar_contents(custom_dir_full_path, config_name)\n Dir.chdir(\"#{custom_dir_full_path}\")\n Chef::Log.info(\"current directory - [#{Dir.getwd}]\")\n solrconfig_files = File.join(\"**\",\"solrconfig.xml\")\n possible_subdirs = Array.new()\n Dir.glob(solrconfig_files).each do |solrconfig_file|\n Chef::Log.info(\"Find parent directory for the file #{solrconfig_file}\")\n parent_dir = File.dirname(solrconfig_file)\n Dir.chdir(\"#{parent_dir}\")\n important_objects = 0\n Chef::Log.info(\"parent directory - [#{Dir.getwd}]\")\n if Dir.glob(File.join(\"managed-schema\")).empty?\n if Dir.glob(File.join(\"schema.xml\")).empty?\n Chef::Log.warn(\"Neither schema.xml nor managed-schema file is present. Cannot upload this configuration to zookeeper.\")\n else\n schema_file_name = \"schema.xml\"\n important_objects += 1\n Chef::Log.info(\"schema.xml file is present\")\n end\n else\n schema_file_name = \"managed-schema\"\n important_objects += 1\n Chef::Log.info(\"managed-schema file is present\")\n if parent_dir == \".\"\n validate_schema_fields(\"#{custom_dir_full_path}/#{schema_file_name}\")\n else\n validate_schema_fields(\"#{custom_dir_full_path}/#{parent_dir}/#{schema_file_name}\")\n end\n end\n # Deleting META-INF folder locally on the compute to avoid uploading to ZK while uploading solr config\n if directoryExists?(\"META-INF\")\n begin\n FileUtils.rm_rf(\"META-INF\")\n rescue Exception => msg\n Chef::Log.error(\"Error while deleting the directory META-INF recursively : #{msg}\")\n end\n end\n\n # if Dir.glob(File.join(\"META-INF\")).empty?\n # Chef::Log.warn(\"META-INF directory does not exist.\")\n # else\n # important_objects += 1\n # Chef::Log.info(\"META-INF directory exists in the directory - [#{parent_dir}]\")\n # end\n # File.join(\"**\",\"lang\", \"**\") -- Check whether lang directory has some files. This returns empty when the lang directory do not contain files and also if it is present as a file.\n # So, In case if it returns empty then logs an message and will not consider the parent directory as a valid directory.\n # if Dir.glob(File.join(\"**\",\"lang\", \"**\")).empty?\n # Chef::Log.warn(\"lang directory is empty.\")\n # else\n # important_objects += 1\n # Chef::Log.info(\"lang directory exists in the directory - [#{parent_dir}]\")\n # end\n if (important_objects == 1)\n Chef::Log.info(\"Found all required configration file in the directory -- #{parent_dir}\")\n possible_subdirs.push(parent_dir)\n end\n Dir.chdir(\"#{custom_dir_full_path}\")\n end\n if (possible_subdirs.length == 0)\n Chef::Log.raise(\"No directory found that contains Solr's configuration files like solrconfig.xml etc. Cannot upload to zookeeper\")\n end\n if (possible_subdirs.length > 1)\n Chef::Log.raise(\"Several directories found that contains Solr's configuration files like solrconfig.xml etc. Cannot determine which one to upload to zookeeper. [ #{possible_subdirs} ]\")\n end\n node.set['config_sub_dir'] = \"#{possible_subdirs[0]}\"\n\n if node['config_sub_dir'] == \".\"\n uploadCustomConfig_without_bash_resource(node['solr_version'][0,1], node['zk_host_fqdns'], config_name, custom_dir_full_path)\n else\n uploadCustomConfig_without_bash_resource(node['solr_version'][0,1], node['zk_host_fqdns'],config_name, \"#{custom_dir_full_path}/#{node['config_sub_dir']}\")\n end\n\n end",
"def parse_config\n %w(/etc/steel/steel.yml steel.yml).each do |cfg|\n if File.exist?(cfg)\n begin\n y = YAML.load_file(cfg)\n rescue Psych::SyntaxError => e\n error \"[#{e.class}] Failed to parse '#{cfg}'!!\"\n error e.message\n exit 1\n end\n # Merge the contents of the config into @config.\n config.merge!(y)\n end\n end\n end",
"def load_scenario (scenario_name, configYAML)\n scenarioDefaults = YAML.load_file(File.join(File.dirname(__FILE__), '/../../scenarios/defaults/base_scenario'))\n scenario_name ||= configYAML['scenario']\n scenarioYAML = scenarioDefaults.merge!(YAML.load_file(File.join(File.dirname(__FILE__), '/../../scenarios', scenario_name )))\nend",
"def test_FindNamedConfigurationWithContextInParentDirectory\n\t\tDir.mktmpdir do |dir|\n\t\t\tFileUtils.mkdir_p(\"#{dir}/src/some/project/\")\n\t\t\tFileUtils.mkdir_p(\"#{dir}/src/.mc/machine/\")\n\n\t\t\tFile.write(\"#{dir}/src/.mc/machine/machine.yaml\", 'Yaml')\n\t\t\tFile.write(\"#{dir}/src/.mc/machine/context\", 'Context')\n\t\t\tFile.write(\"#{dir}/src/base\", 'Base')\n\n\t\t\tconfig = FindConfiguration.named(\"#{dir}/src/some/project/\", 'machine')\n\t\t\tassert_not_nil(config, 'Failed finding unnamed configuration .mc/machine/machine.yaml in parent directory')\n\t\t\tassert(config.kind_of?(Configuration), 'Return value must be of type Configuration')\n\n\t\t\tassert_equal('Yaml', File.read(config.yaml_file), 'Unexpected configuration content')\n\t\t\tassert_equal('Context', File.read(config.context_directory + 'context'), 'Unexpected context content')\n\t\t\tassert_equal('Base', File.read(config.base_directory + 'base'), 'Unexpected base content')\n\t\tend\n\tend",
"def prepare_config_files\n #Create .config dir\n #Create tucotuco dir\n #Create short dir\n #Create info file\n end",
"def config_filepath(name)\n File.expand_path(\"../fixtures/configs/#{name}.yaml\", __dir__)\nend",
"def yaml_files\n file_list('{,puppet/}{,hiera}data/**/*.{yaml,eyaml}') +\n file_list('config/**/*.yml')\n end",
"def load_config\n input_file_paths =\n YAML.load_file('config/input_file_paths.yml')\n input_file_paths['input_file_paths'].each do |_, input_file_path|\n start input_file_path\n end\n end",
"def create_test_node\n parent = @root\n File.open(@file_name, \"r\") do |f|\n f.each_with_index do |line, index|\n \n if index == 0\n @stack = []\n @stack.push(@root)\n end\n line.chomp!\n next if line.empty? || line.nil?\n prelim_whitespace = 0\n line.each_byte do |byte|\n break if byte != 32\n prelim_whitespace += 1\n end\n stripped_line = line.strip\n next if stripped_line.nil? || stripped_line.empty?\n token_line = stripped_line.split\n #accounts for Cucumber colons\n first_token = token_line[0].gsub(/:/,' ').downcase.strip\n last_token = token_line[-1].strip\n\n case stripped_line\n when /^context/, /^describe/, /^Feature:/, /^Feature/, /^RSpec.describe/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^it/, /^Scenario/, /^Scenario:/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n if stripped_line =~ /do$/\n @stack.push(node)\n end\n when /^def/, /do$/, /do.*$/\n node = Tree.new(first_token, prelim_whitespace)\n node.file_name = @file_name\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^end/\n @stack.pop\n else\n end\n end\n end\n @root\n end",
"def create_test_node\n parent = @root\n File.open(@file_name, \"r\") do |f|\n f.each_with_index do |line, index|\n \n if index == 0\n @stack = []\n @stack.push(@root)\n end\n line.chomp!\n next if line.empty? || line.nil?\n prelim_whitespace = 0\n line.each_byte do |byte|\n break if byte != 32\n prelim_whitespace += 1\n end\n stripped_line = line.strip\n next if stripped_line.nil? || stripped_line.empty?\n token_line = stripped_line.split\n #accounts for Cucumber colons\n first_token = token_line[0].gsub(/:/,' ').downcase.strip\n last_token = token_line[-1].strip\n\n case stripped_line\n when /^context/, /^describe/, /^Feature:/, /^Feature/, /^RSpec.describe/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^it/, /^Scenario/, /^Scenario:/\n node = Tree.new(format_description(line, first_token), prelim_whitespace)\n node.file_name = @file_name\n parent = fetch_parent(@stack, node)\n if parent\n parent.children << node\n node.parent = parent\n end\n node.structure_marker = first_token\n \n if stripped_line =~ /do$/\n @stack.push(node)\n end\n when /^def/, /do$/, /do.*$/\n node = Tree.new(first_token, prelim_whitespace)\n node.file_name = @file_name\n node.structure_marker = first_token\n \n @stack.push(node)\n when /^end/\n @stack.pop\n else\n end\n end\n end\n @root\n end",
"def test_buildstep_search\n result = TeamcityRuby::Core.new(['property_search', '.\\config', 'dev', 'iinstall', '.\\result_buildstep_search.yml'])\n result = YAML::load_file('.\\result_buildstep_search.yml')\n bed = YAML::load_file(File.join(File.dirname(__FILE__), 'bed_buildstep_search.yml'))\n assert_equal result, bed\n end",
"def load_config\n projects = Array.new\n Dir.glob(\"#{@config_path}/*.json\") do |cf|\n if !cf.end_with?(\"template.json\")\n projects << Project.new(cf)\n end\n end\n projects\nend",
"def spec_dirs; end",
"def load_config_files\n [\n Pathname.new(ENV['GUIGNOL_YML'] || '/var/nonexistent'),\n Pathname.new('guignol.yml'),\n Pathname.new('config/guignol.yml'),\n Pathname.new(ENV['HOME']).join('.guignol.yml')\n ].each do |pathname|\n next unless pathname.exist?\n return YAML.load(pathname.read)\n end\n return {}\n end",
"def process_config\n input = File.open(\"lib/templates/config_template.sh\",\"r\")\n config = input.read\n input.close()\n output = File.new(@bigframe_home + \"/conf/config.sh\", \"w\") \n if output\n output.syswrite(config %[@hadoop_home, @tpchds_local])\n end\n output.close()\n end",
"def path_for(config); File.expand_path(File.join('../fixtures', config), __FILE__) ;end",
"def configure_data\n [:bitcask, :eleveldb, :merge_index].each {|k| env[k] ||= {} }\n env[:bitcask][:data_root] ||= (data + 'bitcask').expand_path.to_s\n env[:eleveldb][:data_root] ||= (data + 'leveldb').expand_path.to_s\n env[:merge_index][:data_root] ||= (data + 'merge_index').expand_path.to_s\n env[:riak_core][:slide_private_dir] ||= (data + 'slide-data').expand_path.to_s\n env[:riak_core][:ring_state_dir] ||= (data + 'ring').expand_path.to_s\n\n TS_NODE_DIRECTORIES.each do |dir|\n env[:riak_core][:\"platform_#{dir}_dir\"] ||= send(dir).to_s\n end\n end",
"def load_configuration\n # Default configuration.\n config = File.open('pin_spec.yml', 'r') { |f| YAML.load f }\n \n if ARGV[0]\n # If the first argument is a Yaml configuration file, use that to override\n # the default configuration.\n if ARGV[0][-4, 4] == '.yml'\n config.merge! File.open(ARGV[0], 'r') { |f| YAML.load f }\n else\n # Argument 1: the output directory.\n config[:output_dir] = ARGV[0]\n end\n end\n \n # Supply a default output directory if no directory is given.\n config[:output_dir] ||= 'results_' + Time.now.strftime(\"%Y%m%d%H%M%S\")\n config[:output_dir] = File.expand_path config[:output_dir],\n File.dirname(__FILE__)\n\n # Argument 2: pintool binary\n config[:tool_binary] = ARGV[1] if ARGV[1]\n config[:tool_binary] = File.expand_path ARGV[1] || config[:tool_binary],\n File.dirname(__FILE__)\n\n # Arguments 3..n: pintool arguments\n if ARGV[2]\n config[:tool_args] = ARGV[2..-1]\n end\n if config[:tool_args].respond_to? :to_str\n config[:tool_args] = config[:tool_args].split\n end\n\n # Suite location.\n suite_file = config[:suite_path] || './spec_suite.yml'\n config[:suite] = File.open(suite_file, 'r') { |f| YAML.load f }\n\n # Filter out tests in the suite.\n config[:suite].delete_if do |test_name, test_config|\n config[:skip_tests].include? test_name\n end \n\n config\nend",
"def stage_install_paths(stage)\n select_existing_paths = proc do |cookbook_path, paths|\n paths.select {|from, _| cookbook_path.join(from).exist?}\n end\n\n common_paths = [['metadata.json', 'metadata.json']]\n\n Dir[vendor_path.join('*')]\n .map(&Pathname.method(:new))\n .map do |cookbook_path|\n cookbook_name = File.basename cookbook_path\n is_builder = (cookbook_name == name)\n is_dimod = cookbook_name.start_with? 'dimod-'\n dimod_enabled = is_dimod && enabled_modules.include?(cookbook_name)\n\n paths = if is_builder\n common_dapp_paths = select_existing_paths.call(\n cookbook_path,\n [\n *common_paths,\n [\"files/#{stage}/common\", 'files/default'],\n [\"templates/#{stage}/common\", 'templates/default'],\n *enabled_recipes.flat_map do |recipe|\n [[\"files/#{stage}/#{recipe}\", 'files/default'],\n [\"templates/#{stage}/#{recipe}\", 'templates/default']]\n end\n ]\n )\n\n recipe_paths = enabled_recipes\n .map {|recipe| [\"recipes/#{stage}/#{recipe}.rb\", \"recipes/#{recipe}.rb\"]}\n .select {|from, _| cookbook_path.join(from).exist?}\n\n if recipe_paths.any?\n [*recipe_paths, *common_dapp_paths]\n else\n [nil, *common_dapp_paths]\n end\n elsif is_dimod && dimod_enabled\n common_dimod_paths = select_existing_paths.call(\n cookbook_path,\n [\n *common_paths,\n [\"files/#{stage}\", 'files/default'],\n ['files/common', 'files/default'],\n [\"templates/#{stage}\", 'templates/default'],\n ['templates/common', 'templates/default'],\n [\"attributes/#{stage}.rb\", \"attributes/#{stage}.rb\"],\n ['attributes/common.rb', 'attributes/common.rb']\n ]\n )\n\n recipe_path = \"recipes/#{stage}.rb\"\n if cookbook_path.join(recipe_path).exist?\n [[recipe_path, recipe_path], *common_dimod_paths]\n else\n [nil, *common_dimod_paths]\n end\n elsif !is_dimod\n [['.', '.']]\n end\n\n [cookbook_path, paths] if paths && paths.any?\n end.compact\n end",
"def all\n load_paths.inject([]) do |all_scenarios, load_path|\n Dir[ File.join(load_path, '**', '*.rb') ].each do |found_scenario_file|\n all_scenarios << EolScenario.new(found_scenario_file)\n end\n all_scenarios\n end\n end",
"def configure_directories\n processing_dir = @config['processing_dir']\n if @config['directory_formats']\n @spec['origdir'] = @config['origdir'] || parse_directory_format(@config['directory_formats']['origdir']) || File.join(processing_dir, @spec['subid'] + '_orig')\n @spec['procdir'] = @config['procdir'] || parse_directory_format(@config['directory_formats']['procdir']) || File.join(processing_dir, @spec['subid'] + '_proc')\n @spec['statsdir'] = @config['statsdir'] || parse_directory_format(@config['directory_formats']['statsdir']) || File.join(processing_dir, @spec['subid'] + '_stats')\n else\n @spec['origdir'] = @config['origdir'] || File.join(processing_dir, @spec['subid'] + '_orig')\n @spec['procdir'] = @config['procdir'] || File.join(processing_dir, @spec['subid'] + '_proc')\n @spec['statsdir'] = @config['statsdir'] || File.join(processing_dir, @spec['subid'] + '_stats')\n end\n end",
"def parse_content(path, service_name = nil)\n config_files = Array(path)\n\n if path.directory?\n config_files = inspec.bash(\"ls #{path}/*\").stdout.lines.map{|f| inspec.file(f.strip) }\n end\n\n config_files.each do |config_file|\n next unless config_file.content\n\n # Support multi-line continuance and skip all comments and blank lines\n rules = config_file.content.gsub(\"\\\\\\n\",' ').lines.map(&:strip).delete_if do |line|\n line =~ /^(\\s*#.*|\\s*)$/\n end\n\n service = service_name\n unless service || @top_config\n service = config_file.basename\n end\n\n rules.each do |rule|\n new_rule = Pam::Rule.new(rule, {:service_name => service})\n\n # If we hit an 'include' or 'substack' statement, we need to derail and\n # delve down that tail until we hit the end\n #\n # There's no recursion checking here but, if you have a recursive PAM\n # stack, you're probably not logging into your system anyway\n if ['include','substack'].include?(new_rule.control)\n # Support full path specification includes\n if new_rule.module_path[0].chr == '/'\n subtarget = inspec.file(new_rule.module_path)\n else\n if File.directory?(path.path)\n subtarget = inspec.file(File.join(path.path, new_rule.module_path))\n else\n subtarget = inspec.file(File.join(File.dirname(path.path), new_rule.module_path))\n end\n end\n\n if subtarget.exist?\n parse_content(subtarget, service)\n end\n else\n\n unless new_rule.type && new_rule.control && new_rule.module_path\n raise PamError, \"Invalid PAM config found at #{config_file}\"\n end\n\n @services[new_rule.service] ||= []\n @services[new_rule.service] << new_rule\n\n @types[new_rule.type] ||= []\n @types[new_rule.type] << new_rule\n\n @modules[new_rule.module_path] ||= []\n @modules[new_rule.module_path] << new_rule\n\n @rules.push(new_rule)\n end\n end\n end\n end",
"def read_configuration filename\n puts \"Reading configuration from #{filename}\"\n lines=File.readlines(filename)\n cfg={}\n #change in the dir of the file to calculate paths correctly\n cfg_dir=File.dirname(filename)\n lines.each do |l|\n l.gsub!(\"\\t\",\"\")\n l.chomp!\n #ignore if it starts with a hash\n unless l=~/^#/ || l.empty?\n #clean up by trimming whitespaces\n l.gsub!(/\\s*=\\s*/,'=')\n l.gsub!(/\\s*,\\s*/,',')\n #\n if l=~/=$/\n trailing_equals=true\n end\n #split on equals\n fields=l.split('=')\n #more than one part needed\n if fields.size>1\n #the key is the first\n key=fields.first\n #take the key out of the array\n values=fields.drop(1)\n #the value to each key is the values array joined with space\n case key \n when \"include\",\"depend\",\"interface\",\"external\" \n cfg[key]||=[]\n #here we want to handle a comma separated list of prefixes\n incs=values.join\n cfg[key]+=incs.split(',')\n cfg[key].uniq!\n when \"out_dir\",\"base_dir\",\"model\" \n cfg[key]=File.expand_path(File.join(cfg_dir,values.join))\n else\n cfg[key]=values.join('=')\n end#case\n cfg[key]<<'=' if trailing_equals\n else\n puts \"ERROR - Configuration syntax error in #{filename}:\\n'#{l}'\"\n end#if size>1\n end#unless\n end#lines.each\n return cfg\nend",
"def hiera_plugins\n return @hiera_plugins if @hiera_plugins\n @hiera_plugins = {}\n return @hiera_plugins unless Noop::Config.file_path_hiera_plugins.directory?\n Noop::Config.file_path_hiera_plugins.children.each do |hiera|\n next unless hiera.directory?\n hiera_name = hiera.basename.to_s\n hiera.children.each do |file|\n next unless file.file?\n next unless file.to_s.end_with? '.yaml'\n file = file.relative_path_from Noop::Config.dir_path_hiera\n @hiera_plugins[hiera_name] = [] unless @hiera_plugins[hiera_name]\n @hiera_plugins[hiera_name] << file\n end\n end\n @hiera_plugins\n end",
"def assign_spec_to_hiera\n return @assign_spec_to_hiera if @assign_spec_to_hiera\n @assign_spec_to_hiera = {}\n assign_spec_to_roles.each do |file_name_spec, spec_roles_set|\n hiera_files = get_hiera_for_roles spec_roles_set\n @assign_spec_to_hiera[file_name_spec] = hiera_files if hiera_files.any?\n end\n @assign_spec_to_hiera\n end",
"def spec\n YAML.load_file(\"#{tmp_folder}/#{repository_name}/#{spec_name}\")\n end",
"def getFeatureList env_url\n allfearure_arr=Array.new\n Dir.foreach(\"#{env_url}\") do |file|\n if file !=\".\" and file !=\"..\"\n testcase_hash = YAML.load(File.open(\"#{env_url}\\\\#{file}\"))\n testcase_hash.each do |key,value|\n allfearure_arr=allfearure_arr|value\n end\n end\n end\n allfearure_arr\nend",
"def hiera_datadir\n # This output lets us know where Hiera is configured to look on the system\n puppet_lookup_info = run_shell('puppet lookup --explain test__simp__test').stdout.strip.lines\n puppet_config_check = run_shell('puppet agent --configprint manifest').stdout\n\n if puppet_config_check.nil? || puppet_config_check.empty?\n fail(\"No output returned from `puppet config print manifest`\")\n end\n\n puppet_env_path = File.dirname(puppet_config_check)\n\n # We'll just take the first match since Hiera will find things there\n puppet_lookup_info = puppet_lookup_info.grep(/Path \"/).grep(Regexp.new(puppet_env_path))\n\n # Grep always returns an Array\n if puppet_lookup_info.empty?\n fail(\"Could not determine hiera data directory under #{puppet_env_path}\")\n end\n\n # Snag the actual path without the extra bits\n puppet_lookup_info = puppet_lookup_info.first.strip.split('\"').last\n\n # Make the parent directories exist\n run_shell(\"mkdir -p #{File.dirname(puppet_lookup_info)}\", acceptable_exit_codes: [0])\n\n # We just want the data directory name\n datadir_name = puppet_lookup_info.split(puppet_env_path).last\n\n # Grab the file separator to add back later\n file_sep = datadir_name[0]\n\n # Snag the first entry (this is the data directory)\n datadir_name = datadir_name.split(file_sep)[1]\n\n # Constitute the full path to the data directory\n datadir_path = puppet_env_path + file_sep + datadir_name\n\n # Return the path to the data directory\n return datadir_path\nend",
"def create_hiera_template\n options = {ssh_key: Bebox::Project.public_ssh_key_from_file(project_root, environment), project_name: Bebox::Project.shortname_from_file(project_root)}\n Bebox::Provision.generate_hiera_for_steps(self.project_root, \"node.yaml.erb\", self.hostname, options)\n end",
"def test_buildstep_modify\n TeamcityRuby::Core.new(['property_modify', '.\\config.rb', 'dev','PS1', 'p', '.\\result_buildstep_modify.yml', nil, 'PackageStoreAPI_TestTemplate'])\n result = TeamcityRuby::Core.new(['property_modify', '.\\config.rb', 'dev','STDIN', 'e', '.\\result_buildstep_modify.yml', nil, 'PackageStoreAPI_TestTemplate'])\n result = YAML::load_file('.\\result_buildstep_modify.yml')\n bed = YAML::load_file(File.join(File.dirname(__FILE__), 'bed_buildstep_modify.yml'))\n assert_equal result, bed \n end",
"def hiera_datadirs(hiera)\n configpath = hiera_configpath(hiera)\n config = YAML.load_file(configpath)\n backends = [config[:backends]].flatten\n datadirs = backends.map { |be| config[be.to_sym][:datadir] }.uniq\n datadirs.map do |datadir|\n localpath = File.join('config', 'hieras', hiera, File.basename(datadir))\n [localpath, datadir]\n end\nend",
"def setup_workspace\n\n if ! File.exist?( @app_data )\n\n @logger.trace \"Creating configuration in \" + @app_data\n Dir.mkdir( @app_data )\n f = File.open( Config.formulate_config_file_name( @app_data ), \"w\" )\n f.puts @@yaml_config\n f.close\n\n @whois_cache_dir = File.join( @app_data, \"whois_cache\" )\n Dir.mkdir( @whois_cache_dir )\n\n @tickets_dir = File.join( @app_data, \"tickets\" )\n Dir.mkdir( @tickets_dir )\n\n else\n\n @logger.trace \"Using configuration found in \" + @app_data\n @whois_cache_dir = File.join( @app_data, \"whois_cache\" )\n @tickets_dir = File.join( @app_data, \"tickets\" )\n\n end\n\n end",
"def read_features(p_features_path = @features_path, p_parent_node = nil)\n # don't read features if some error happened before\n if @exit_status == 0\n feature_node = nil\n begin\n if p_features_path.end_with?(\"/\")\n features_path = p_features_path\n else\n features_path = p_features_path + \"/\"\n end\n features = Dir.entries(features_path)\n rescue Exception\n @log.error(\"can't access >>#{features_path}<< as feature dir\")\n @exit_status = 66\n return\n end\n @log.info \"start reading features from dir #{features_path}\"\n feature_count = 0\n scenario_count = 0\n features.each do |feature_file|\n #ignore files starting with .\n if feature_file =~ /^[^\\.]/\n #look for features in only in .feature files\n if feature_file =~ /\\.feature$/\n feature = File.read(\"#{features_path}#{feature_file}\")\n feature.scan(/^\\s*(Feature|Ability|Business Need):\\s*(\\S.*)$/) do |feature_type, feature_name|\n feature_node = @mindmap.add_node(feature_name, \"feature\", p_parent_node)\n feature_count += 1\n end\n feature.scan(/^\\s*(Scenario|Scenario Outline):\\s*(\\S.*)$/) do |scenario_type, scenario_name|\n case scenario_type\n when \"Scenario Outline\" then @mindmap.add_node(scenario_name, \"scenario_outline\", feature_node)\n when \"Scenario\" then @mindmap.add_node(scenario_name, \"scenario\", feature_node)\n end\n scenario_count += 1\n end\n end\n # look for subdirs\n if File.directory?(\"#{features_path}#{feature_file}\")\n # ignore step_definitions and support folders because those are used for code\n if feature_file != \"step_definitions\" && feature_file != \"support\"\n subdir_node = @mindmap.add_node(feature_file, \"subdir\", p_parent_node)\n read_features(\"#{features_path}#{feature_file}\", subdir_node)\n end\n end\n end\n end\n @log.info \"found #{feature_count} feature(s) and #{scenario_count} scenarios in dir #{features_path}\"\n end\n end",
"def loadConfigs()\n fh = File.open(@fileName_vars, \"r\")\n\n fh.each do |line| \n line.gsub!(/[\\s]/, '') # removes white spaces \n\n if(!(/^\\#/.match(line)) && /:/.match(line)) # only considers lines not begining with #\n line.sub!(/\\#.*$/, '') # removes all trailing comments\n line.upcase!\n arr_configs = line.split(/:/)\n case arr_configs[0] \n when FOLDER_DATA\n @folder_data = arr_configs[1]\n when FOLDER_DB\n @folder_db = arr_configs[1]\n when FOLDER_BLASTRES\n @folder_blastRes = arr_configs[1]\n when FOLDER_FINALRES\n @folder_finalRes = arr_configs[1]\n end \n #puts arr[0] + \"\\t\" + arr[1]\n #puts line\n end \n\n end \n\n fh.close\n end",
"def render_json (yaml_files)\n files = Dir[yaml_files]\n log(\"Rendering JSON configs for jmxtrans\")\n files.each do | yaml_file |\n log(\"Rendering to JSON: #{yaml_file}\")\n execute \"render json\" do\n command \"python #{node['jmxtrans']['home']}/tools/yaml2jmxtrans.py #{yaml_file}\"\n cwd \"#{node['jmxtrans']['config_dir']}/json\"\n action :run\n end\n end\n\n json_files = Dir[\"#{node['jmxtrans']['config_dir']}/json\"]\n\n json_files.each do | json_file |\n log(\"Rendering JSON file: #{json_file}}\")\n end\nend",
"def ReadGlobalConfig()\n\n # Load config file\n begin\n conf = YAML.load_file(\"#{$confdir}/#{$globalConfFile}\")\n rescue\n puts \"Unable to locate #{$confdir}/#{$globalConfFile}\"\n conf = {}\n end\n\n Dir.glob(\"#{$confdir}/#{$globalConfDir}/*.yaml\") {|f|\n begin\n conf.merge!(YAML.load_file(f))\n rescue\n puts \"Unable to locate #{f}\"\n conf = {}\n end\n }\n\n $sections.each {|o|\n conf[o] = [] if conf[o].nil?\n }\n conf[:globalConfFile] = \"#{$confdir}/#{$globalConfFile}\"\n conf[:globalConfDir] = \"#{$confdir}/#{$globalConfDir}\"\n\n altConfFile = \"#{$curdir}/.rake/#{$globalConfFile}\"\n if File.exists?(altConfFile)\n begin\n puts \"Reading local config file #{altConfFile}\" if $verbose\n c = YAML.load_file(altConfFile)\n raise \"Invalid yaml file\" if not c\n\n # surcharge d'options\n $sections.each {|s|\n next if c[s].nil?\n if $sections_uniq.include?(s)\n # remove then add option\n c[s].each {|o|\n o2 = o.gsub(/=.*/, \"=\")\n conf[s].delete_if {|o3| o3.start_with?(o2)}\n conf[s].push o\n }\n else\n c[s].each {|o|\n if o[0] == \"!\"\n # delete option\n conf[s].delete o[1..-1]\n else\n # just add option\n conf[s].push o\n end\n }\n end\n }\n rescue\n puts \"Error loading #{altConfFile}\"\n end\n end\n \n conf.each {|k,v|\n if v.class == Array\n conf[k].each_index {|i|\n conf[k][i].gsub!(/%B/, $basedir) if conf[k][i].class == String\n conf[k][i].gsub!(/%b/, $confdir) if conf[k][i].class == String\n }\n else\n conf[k].gsub!(/%B/, $basedir) if conf[k].class == String\n conf[k].gsub!(/%b/, $confdir) if conf[k].class == String\n end\n }\n\n return conf\nend",
"def test_FindNamedConfigurationWithoutContextInParentDirectory\n\t\tDir.mktmpdir do |dir|\n\t\t\tFileUtils.mkdir_p(\"#{dir}/src/some/project/\")\n\t\t\tFileUtils.mkdir_p(\"#{dir}/src/.mc/\")\n\n\t\t\tFile.write(\"#{dir}/src/.mc/machine.yaml\", 'Yaml')\n\t\t\tFile.write(\"#{dir}/src/base\", 'Base')\n\n\t\t\tconfig = FindConfiguration.named(\"#{dir}/src/some/project/\", 'machine')\n\t\t\tassert_not_nil(config, 'Failed finding unnamed configuration .mc/machine.yaml in parent directory')\n\t\t\tassert(config.kind_of?(Configuration), 'Return value must be of type Configuration')\n\n\t\t\tassert_equal('Yaml', File.read(config.yaml_file), 'Unexpected configuration content')\n\t\t\tassert_nil(config.context_directory, \"Should not find context directory but found #{config.context_directory}\")\n\t\t\tassert_equal('Base', File.read(config.base_directory + 'base'), 'Unexpected base content')\n\t\tend\n\tend",
"def test_FindUnnamedConfigurationInSubdirectoryOfParentDirectory\n\t\tDir.mktmpdir do |dir|\n\t\t\tFileUtils.mkdir_p(\"#{dir}/src/some/project/\")\n\t\t\tFileUtils.mkdir_p(\"#{dir}/src/.mc/\")\n\n\t\t\tFile.write(\"#{dir}/src/.mc/mc.yaml\", 'Yaml')\n\t\t\tFile.write(\"#{dir}/src/.mc/context\", 'Context')\n\t\t\tFile.write(\"#{dir}/src/base\", 'Base')\n\n\t\t\tconfig = FindConfiguration.without_name(\"#{dir}/src/some/project/\")\n\t\t\tassert_not_nil(config, 'Failed finding unnamed configuration .mc/mc.yaml in parent directory')\n\t\t\tassert(config.kind_of?(Configuration), 'Return value must be of type Configuration')\n\n\t\t\tassert_equal('Yaml', File.read(config.yaml_file), 'Unexpected configuration content')\n\t\t\tassert_equal('Context', File.read(config.context_directory + 'context'), 'Unexpected context content')\n\t\t\tassert_equal('Base', File.read(config.base_directory + 'base'), 'Unexpected base content')\n\t\tend\n\tend",
"def config_read\n f = File.expand_path(CONFIG_FILE)\n return unless File.readable? f\n\n hash = loadYML(f)\n @used_dirs = hash['DIRS']\n @visited_files = hash['FILES']\n @bookmarks = hash['BOOKMARKS']\n @used_dirs.concat get_env_paths\nend",
"def hiera_file_names\n return @hiera_file_names if @hiera_file_names\n error \"No #{Noop::Config.dir_path_hiera} directory!\" unless Noop::Config.dir_path_hiera.directory?\n exclude = [ Noop::Config.dir_name_hiera_override, Noop::Config.dir_name_globals, Noop::Config.file_name_hiera_plugins ]\n @hiera_file_names = find_files(Noop::Config.dir_path_hiera, Noop::Config.dir_path_hiera, exclude) do |file|\n file.to_s.end_with? '.yaml'\n end\n end",
"def get_scenario_data(name)\n scenario_file = File.join(data_dir, 'scenarios', \"#{name}.yaml\")\n unless File.exists?(scenario_file)\n raise(Exception, \"scenario file #{scenario_file} does not exist\")\n end\n YAML.load_file(scenario_file)\n end",
"def parse_gherkin_to_json\r\n feature_file_name.each do |file_name|\r\n string_file = file_name.to_s\r\n io = StringIO.new\r\n formatter = Gherkin::Formatter::JSONFormatter.new(io)\r\n parser = Gherkin::Parser::Parser.new(formatter)\r\n #path = File.expand_path(string_file)\r\n parser.parse(IO.read(string_file), string_file, 0)\r\n formatter.done\r\n self.feature_json = MultiJson.dump(MultiJson.load(io.string), :pretty => true)\r\n get_scenario_details\r\n end\r\n\r\n end",
"def find_config(file); end",
"def compile_hiera_files(nodes, clean_export)\n update_compiled_ssh_configs # must come first\n sanity_check(nodes)\n manager.export_nodes(nodes)\n manager.export_secrets(clean_export)\n end",
"def with_config\n config = Hoe::DEFAULT_CONFIG\n\n rc = File.expand_path(\"~/.hoerc\")\n homeconfig = maybe_load_yaml rc\n\n config = config.merge homeconfig\n\n localrc = File.join Dir.pwd, \".hoerc\"\n localconfig = maybe_load_yaml(localrc)\n\n config = config.merge localconfig\n\n yield config, rc\n end",
"def prepare_test_stand\n unless CONFIG_DIR.exist?\n puts \"Unable to rum specs - .ini not found. Put all your .ini files into #{CONFIG_DIR}!\"\n RSpec.wants_to_quit=true\n end\n\n FileUtils.rm_rf TMP_DIR\n FileUtils.cp_r SOURCE_DIR, TEST_DIR #TMP_DIR\nend",
"def load_config()\n Kitchenplan::Log.debug \"Loading configs from #{self.options[:config_dir]} ...\"\n #Kitchenplan::Log.debug self.platform.ohai.inspect\n self.config = Kitchenplan::Config.new(self.platform.ohai, parse_configs=true,config_path=self.options[:config_dir]).config()\n end",
"def assign_hiera_to_roles\n return @assign_hiera_to_roles if @assign_hiera_to_roles\n @assign_hiera_to_roles = {}\n hiera_file_names.each do |hiera_file|\n begin\n data = YAML.load_file(Noop::Config.dir_path_hiera + hiera_file)\n next unless data.is_a? Hash\n fqdn = data['fqdn']\n next unless fqdn\n nodes = data.fetch('network_metadata', {}).fetch('nodes', nil)\n next unless nodes\n this_node = nodes.find do |node|\n node.last['fqdn'] == fqdn\n end\n node_roles = this_node.last['node_roles']\n roles = Set.new\n roles.merge node_roles if node_roles.is_a? Array\n role = data['role']\n roles.add role if role\n @assign_hiera_to_roles[hiera_file] = roles\n rescue\n next\n end\n end\n @assign_hiera_to_roles\n end",
"def test_FindUnnamedConfigurationInParentDirectory\n\t\tDir.mktmpdir do |dir|\n\t\t\tFileUtils.mkdir_p(\"#{dir}/src/some/project/\")\n\n\t\t\tFile.write(\"#{dir}/src/mc.yaml\", 'Yaml')\n\t\t\tFile.write(\"#{dir}/src/base\", 'Base')\n\n\t\t\tconfig = FindConfiguration.without_name(\"#{dir}/src/some/project/\")\n\t\t\tassert_not_nil(config, 'Failed finding unnamed configuration mc.yaml in parent directory')\n\t\t\tassert(config.kind_of?(Configuration), 'Return value must be of type Configuration')\n\n\t\t\tassert_equal('Yaml', File.read(config.yaml_file), 'Unexpected configuration content')\n\t\t\tassert_nil(config.context_directory, \"Should not find context directory but found #{config.context_directory}\")\n\t\t\tassert_equal('Base', File.read(config.base_directory + 'base'), 'Unexpected base content')\n\t\tend\n\tend",
"def check_config\n unless File.directory?(yolo_dir) and File.exist?(yaml_path)\n @error.run_setup\n load_config\n @formatter.setup_complete\n end\n end",
"def generate_fixtures_data\n # Determine if there are symlinks, either for the default modulename, or for anything in the modulepath\n symlinks = []\n modulepath = ''\n if (File.exists?('environment.conf') and environment_conf = File.read('environment.conf'))\n puts \"\\nGenerating .fixtures.yml for a controlrepo.\" unless @options[:silent]\n\n environment_conf.split(\"\\n\").each do |line|\n modulepath = (line.split('='))[1].gsub(/\\s+/,'') if line =~ /^modulepath/\n end\n\n paths = modulepath.split(':').delete_if { |path| path =~ /^\\$/ }\n paths.each do |path|\n Dir[\"#{path}/*\"].each do |module_location|\n next unless File.directory?(module_location)\n module_name = File.basename(module_location)\n module_path = module_location\n symlinks << {\n :name => module_name,\n :path => '\"#{source_dir}/' + module_path + '\"',\n }\n end\n end\n else\n puts \"\\nGenerating .fixtures.yml using module name #{@options[:modulename]}.\" unless @options[:silent]\n\n symlinks << { \n :name => @options[:modulename],\n :path => '\"#{source_dir}\"',\n }\n end\n\n # Header for fixtures file creates symlinks for the controlrepo's modulepath, or for the current module\"\n fixtures_data = \"fixtures:\\n\"\n if symlinks\n fixtures_data += \" symlinks:\\n\"\n symlinks.sort_by!{|symlink| symlink[:name]}.each do |symlink|\n fixtures_data += \" #{symlink[:name]}: #{symlink[:path]}\\n\"\n end\n end\n\n unless @repository_data.empty?\n fixtures_data += \" repositories:\\n\"\n @repository_data.sort_by!{|repo| repo[:name]}.each do |repodata|\n # Each repository has two or pieces of data\n # Mandatory: the module name, the URI/location\n # Optional: the type (ref, branch, commit, etc.) and ID (tag, branch name, commit hash, etc.)\n name = repodata[:name]\n location = repodata[:location]\n type = repodata[:type]\n id = repodata[:id]\n\n data = <<-EOF\n #{name}:\n repo: \"#{location}\"\n EOF\n data += \" #{type}: \\\"#{id}\\\"\\n\" unless @options[:latest_versions] || !type || !id\n\n fixtures_data += data\n end\n end\n\n\n unless @module_data.empty?\n fixtures_data += \" forge_modules:\\n\"\n @module_data.keys.sort_by!{|mod| mod.split(/[\\/-]/)[1]}.each do |modulename|\n shortname = modulename.split(/[\\/-]/)[1]\n version = @module_data[modulename] \n data = <<-EOF\n #{shortname}:\n repo: \"#{modulename}\"\n EOF\n data += \" ref: \\\"#{version}\\\"\\n\" unless @options[:latest_versions] || version.nil?\n\n fixtures_data += data\n end\n end\n\n fixtures_data\n end",
"def find_scenario_paths(scenarios)\n return [] if scenarios.nil?\n scenarios.select do |path|\n (@location + path + \"scenario.yml\").exist?\n end.uniq.compact\n end",
"def load(config_file = DEFAULTS[:config_file])\n user_config_params = {}\n dirname = Dir.pwd\n if File.exists?(File.expand_path(config_file, Dir.pwd))\n begin\n config_file_path = File.expand_path config_file, Dir.pwd\n user_config_params = Psych.load(File.open(config_file_path))\n dirname = File.dirname config_file_path\n rescue ArgumentError => e\n raise Nimbus::WrongFormatFileError, \"It was not posible to parse the config file (#{config_file}): \\r\\n#{e.message} \"\n end\n end\n\n if user_config_params['input']\n @training_file = File.expand_path(user_config_params['input']['training'], dirname) if user_config_params['input']['training']\n @testing_file = File.expand_path(user_config_params['input']['testing' ], dirname) if user_config_params['input']['testing']\n @forest_file = File.expand_path(user_config_params['input']['forest' ], dirname) if user_config_params['input']['forest']\n @classes = user_config_params['input']['classes'] if user_config_params['input']['classes']\n else\n @training_file = File.expand_path(DEFAULTS[:training_file], Dir.pwd) if File.exists? File.expand_path(DEFAULTS[:training_file], Dir.pwd)\n @testing_file = File.expand_path(DEFAULTS[:testing_file ], Dir.pwd) if File.exists? File.expand_path(DEFAULTS[:testing_file ], Dir.pwd)\n @forest_file = File.expand_path(DEFAULTS[:forest_file ], Dir.pwd) if File.exists? File.expand_path(DEFAULTS[:forest_file ], Dir.pwd)\n end\n\n @do_training = true unless @training_file.nil?\n @do_testing = true unless @testing_file.nil?\n @classes = @classes.map{|c| c.to_s.strip} if @classes\n\n if @do_testing && !@do_training && !@forest_file\n raise Nimbus::InputFileError, \"There is not random forest data (training file not defined, and forest file not found).\"\n end\n\n if user_config_params['forest']\n @forest_size = user_config_params['forest']['forest_size'].to_i if user_config_params['forest']['forest_size']\n @tree_SNP_total_count = user_config_params['forest']['SNP_total_count'].to_i if user_config_params['forest']['SNP_total_count']\n @tree_SNP_sample_size = user_config_params['forest']['SNP_sample_size_mtry'].to_i if user_config_params['forest']['SNP_sample_size_mtry']\n @tree_node_min_size = user_config_params['forest']['node_min_size'].to_i if user_config_params['forest']['node_min_size']\n @do_importances = user_config_params['forest']['var_importances'].to_s.strip.downcase\n @do_importances = (@do_importances != 'no' && @do_importances != 'false')\n end\n\n check_configuration\n log_configuration\n end",
"def setup( dir = default_directory )\n unless File.directory?( dir )\n logger.info \"Creating directory #{dir}\"\n FileUtils.mkdir_p( dir )\n end\n\n cfg = File.join( dir, config_file_basename )\n\n unless File.exist?( cfg )\n template = TyrantManager::Paths.data_path( config_file_basename )\n logger.info \"Creating default config file #{cfg}\"\n FileUtils.cp( template, dir )\n end\n\n %w[ instances log tmp ].each do |subdir|\n subdir = File.join( dir, subdir )\n unless File.directory?( subdir ) then\n logger.info \"Creating directory #{subdir}\"\n FileUtils.mkdir subdir \n end\n end\n return TyrantManager.new( dir )\n end",
"def read_input_params options_cli={}\n #utility sub\n def find_first_yaml_file(dir_to_process)\n Dir.chdir(dir_to_process)\n yaml_file = nil\n Dir.glob(\"*.{yaml,yml}\") do |file|\n yaml_file = file\n break\n end \n return yaml_file\n end\n\n # read input args\n dir_to_process = Dir.pwd\n fail(\"#{dir_to_process} does not exist\") unless File.exist?(dir_to_process) \n fail(\"#{dir_to_process} is not a Directory\") unless File.directory?(dir_to_process)\n $log.info \"Dir to be processed: #{dir_to_process}\"\n \n yaml_name = options_cli['--event']||find_first_yaml_file(dir_to_process)\n fail(\"- no YAML File found;\") if yaml_name.nil? \n fail(\"- no YAML File found;\") unless File.file?(yaml_name)\n $log.info \"YAML Profile to be processed: #{yaml_name}\"\n return [dir_to_process, yaml_name]\nend",
"def test_buildstep_replace\n TeamcityRuby::Core.new(['property_replace', '.\\config.rb', 'dev', 'test_buildstep_replace_expected', 'test_buildstep_replace_modified', '.\\result_buildstep_replace.yml'])\n result = TeamcityRuby::Core.new(['property_replace', '.\\config.rb','dev', 'test_buildstep_replace_modified', 'test_buildstep_replace_expected', '.\\result_buildstep_replace.yml'])\n result = YAML::load_file('.\\result_buildstep_replace.yml')\n bed = YAML::load_file(File.join(File.dirname(__FILE__), 'bed_buildstep_replace.yml'))\n assert_equal result, bed\n end",
"def spec_dirs=(_arg0); end",
"def load_nodes\n yaml_dir = File.expand_path(\n \"../../govuk-provisioning/vcloud-launcher/*integration_carrenza/\",\n __FILE__\n )\n yaml_local = File.expand_path(\"../nodes.local.yaml\", __FILE__)\n\n # DEPRECATED\n json_local = File.expand_path(\"../nodes.local.json\", __FILE__)\n if File.exists?(json_local)\n $stderr.puts \"ERROR: nodes.local.json is deprecated. Please convert it to YAML\"\n exit 1\n end\n\n unless Dir.glob(yaml_dir).any?\n puts \"Unable to find nodes in 'govuk-provisioning' repo\"\n puts\n return {}\n end\n\n yaml_files = Dir.glob(\n File.join(yaml_dir, \"*.yaml\")\n )\n\n nodes = Hash[\n yaml_files.flat_map { |yaml_file|\n YAML::load_file(yaml_file).fetch('vapps').map { |vapp|\n name = vapp.fetch('name')\n template = vapp.fetch('vapp_template_name')\n vm = vapp.fetch('vm')\n network = vm.fetch('network_connections').first\n vdc = network.fetch('name').downcase\n\n name = \"#{name}.#{vdc}\"\n config = {\n 'ip' => network.fetch('ip_address'),\n }\n\n config['box_dist'] = ['precise', 'trusty', 'xenial'].find { |dist| vapp['vapp_template_name'].include? dist }\n\n [name, config]\n }\n }\n ]\n\n # Local YAML file can override node properties like \"memory\". It should\n # look like:\n #\n # ---\n # machine1.vdc1:\n # memory: 128\n # machine2.vdc2:\n # memory: 4096\n #\n if File.exists?(yaml_local)\n nodes_local = YAML::load_file(yaml_local)\n nodes_local.each { |k,v| nodes[k].merge!(v) if nodes.has_key?(k) }\n end\n\n Hash[nodes.sort]\nend",
"def chef_config\n ci = @json.split('/').last.gsub('.json', '')\n \"#{prefix_root}/home/oneops/#{@circuit}/components/cookbooks/\" \\\n \"chef-#{ci}.rb\"\n end",
"def set_hieradata(hieradata)\n @temp_hieradata_dirs ||= []\n data_dir = Dir.mktmpdir('hieradata')\n @temp_hieradata_dirs << data_dir\n\n fh = File.open(File.join(data_dir, 'common.yaml'), 'w')\n if hieradata.is_a?(String)\n fh.puts(hieradata)\n else\n fh.puts(hieradata.to_yaml)\n end\n fh.close\n\n run_shell(\"mkdir -p #{File.dirname(data_dir)}\", acceptable_exit_codes: [0])\n result = upload_file(File.join(data_dir, 'common.yaml'), File.join(@hiera_datadir, 'common.yaml'), ENV['TARGET_HOST'], options: {}, config: nil, inventory: inventory_hash_from_inventory_file)\n raise \"error uploading hiera file to #{ENV['TARGET_HOST']}\" if result[0][\"status\"] !~ %r{success}\nend",
"def setup_dir_structure\n # insure that database dir exists so that a new db can be created if necessary\n if $config[\"database\"][\"adapter\"] == \"sqlite3\"\n FileUtils.mkpath(File.dirname($config[\"database\"][\"database\"]))\n end\n # ensure that log dirs exists and last $config[\"clamscan_log\"] is cleared before use\n FileUtils.mkpath(File.dirname($config[\"run_log\"]))\n FileUtils.mkpath(File.dirname($config[\"clamscan_log\"]))\nend",
"def load\n return unless File.exist? @config_path\n @files = YAML.load_file(@config_path)['files'].collect do |file|\n GistDep::File.load file\n end\n end",
"def build \n configure_directories\n \n @spec['collision'] = 'destroy'\n \n \n jobs = []\n \n # Recon\n recon_options = {'rawdir' => @rawdir, 'epi_pattern' => /(Rest|Task)/i, }\n config_step_method(recon_options, 'recon') if @config['custom_methods']\n jobs << ReconJobGenerator.new(recon_options).build\n \n # Preproc\n preproc_options = {'scans' => jobs.first['scans']}\n config_step_method(preproc_options, 'preproc') if @config['custom_methods']\n jobs << PreprocJobGenerator.new(preproc_options).build\n \n # Stats\n stats_options = {\n 'scans' => jobs.first['scans'],\n 'conditions' => @config['conditions'],\n 'responses_dir' => @config['responses_dir'],\n 'subid' => @spec['subid']\n }\n config_step_method(stats_options, 'stats') if @config['custom_methods']\n jobs << StatsJobGenerator.new(stats_options).build\n \n @spec['jobs'] = jobs\n \n return @spec\n end",
"def test_FindNamedConfigurationWithContext\n\t\tDir.mktmpdir do |dir|\n\t\t\tFileUtils.mkdir_p(\"#{dir}/.mc/machine\")\n\n\t\t\tFile.write(\"#{dir}/.mc/machine/machine.yaml\", 'Yaml')\n\t\t\tFile.write(\"#{dir}/.mc/machine/context\", 'Context')\n\t\t\tFile.write(\"#{dir}/base\", 'Base')\n\n\t\t\tconfig = FindConfiguration.named(dir, 'machine')\n\t\t\tassert_not_nil(config, 'Failed finding unnamed configuration .mc/machine/machine.yaml')\n\t\t\tassert(config.kind_of?(Configuration), 'Return value must be of type Configuration')\n\n\t\t\tassert_equal('Yaml', File.read(config.yaml_file), 'Unexpected configuration content')\n\t\t\tassert_equal('Context', File.read(config.context_directory + 'context'), 'Unexpected context content')\n\t\t\tassert_equal('Base', File.read(config.base_directory + 'base'), 'Unexpected base content')\n\t\tend\n\tend",
"def load_repo_configs(config = {}, repos = [])\n repos.each_with_object(config.dup) do |repo, hsh|\n fp = Pathname.new(repo).expand_path + '.rizzo.json'\n if fp.readable?\n hsh.deep_merge!(load_rizzo_config(fp))\n else\n log.debug \"Skipped #{fp} (it is not readable)\"\n end\n end\n end",
"def modify_yaml_for_testing(yaml_path)\n puts \"Modifying yaml for testing\"\n yaml_file = yaml_path + \"/bf.config.yaml\"\n c_path = Dir.pwd\n c_path.slice!(/\\/test$/)\n\n bf_config = File.open(yaml_file).read\n bf_config.gsub!(/\\/h\\/hsap.36.1.hg18\\/hsap_36.1_hg18.fa/, \"/t/test/test.fa\")\n bf_config.gsub!(%r{h/hsap.36.1.hg18/bwaaln/hsap_36.1_hg18.fa}, \n \"/t/test/bwaaln/test.fa\")\n %w{28000 8000 4000}.each {|n| bf_config.gsub!(/#{n}/, \"400\") }\n %w{8g 4g}.each {|n| bf_config.gsub!(/#{n}/, \"1g\") }\n \n bf_config.gsub!(/dist_dir:.+$/, \"dist_dir: #{c_path}\")\n bf_config.gsub!(/reads_per_file:.+$/, \"reads_per_file: 480\")\n\n # Send email only to the user that is testing this\n user=`id -u -n`.chomp\n bf_config.gsub!(/email_to:.+$/, \"email_to: #{user}@bcm.edu\")\n\n File.open(yaml_file, \"w\") {|f| f.write(bf_config)}\nend",
"def setup(template_path, config_path)\n if !File.directory? config_path and !File.exists? config_path\n logger.info \"Config path #{config_path} was not found, creating from template...\"\n FileUtils.mkdir_p(config_path)\n FileUtils.cp_r(Dir[File.join(template_path, \"*\")], config_path)\n elsif !File.directory? config_path\n err_msg = \"Config path #{config_path} exists, but is not a valid gitsy \"\n err_msg += \"configuration directory. Delete it to create a new one from a template.\"\n logger.error err_msg\n raise \"Gitsy is not configured correctly. Please check the logs for more details.\"\n end\n end",
"def nodes\n get_chef_files_absolute_paths nodes_path\n end",
"def read_config_files(files); end",
"def ingest_paths\n path = Pathname.new(Figgy.config[\"ingest_folder_path\"]).join(ingest_directory)\n return [] unless path.exist?\n path.children.select(&:directory?)\n end",
"def load_yaml_files\n @room_list = YAML.load_file(__dir__ + '/rooms.yml')\n @weapon_list = YAML.load_file(__dir__ + '/weapons.yml')\n @enemy_list = YAML.load_file(__dir__ + '/enemy.yml')\n @high_score_list = YAML.load_file(__dir__ + '/high_score.yml')\n end",
"def json_fixture(path)\n File.read(Rails.root.join(*%W[spec fixtures #{path}.json]))\nend",
"def test_scenario2\n data = [[File.dirname(__FILE__)+'/data/iris.csv', \n false, \n File.dirname(__FILE__)+'/tmp/ensemble.json']]\n puts\n puts \"Scenario 2: Successfully creating a local ensemble from an exported file\"\n\n data.each do |filename, pmml, exported_file|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And the source is in the project\"\n assert_equal(source[\"object\"]['project'], @project[\"resource\"])\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And the dataset is in the project\"\n assert_equal(dataset[\"object\"]['project'], @project[\"resource\"])\n \n puts \"An I create a model\"\n ensemble = @api.create_ensemble(dataset, {\"seed\" => 'BigML', 'ensemble_sample'=>{'rate' => 0.7, 'seed' => 'BigML'}})\n\n puts \"And I wait until the ensemble is ready\"\n assert_equal(BigML::HTTP_CREATED, ensemble[\"code\"])\n assert_equal(1, ensemble[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(ensemble), true)\n \n puts \"And I export the <%s> ensemble to <%s>\" % [pmml, exported_file]\n @api.export(ensemble[\"resource\"], exported_file)\n \n puts \"When I create a local ensemble from the file <%s>\" % exported_file\n local_ensemble = BigML::Ensemble.new(exported_file)\n \n puts \"Then the ensemble ID and the local ensemble ID match\"\n assert_equal(local_ensemble.resource_id, ensemble[\"resource\"])\n \n end\n end",
"def load()\n\n checkFileExists()\n loadConfigs()\n checkConfigs() \n end",
"def run_files_in_config_folder\n Dir[Dir.pwd + '/config/*.rb'].each do |config_file|\n require(config_file)\n end\n end",
"def Chef_Solo_Nodes role_or_paths = '*'\n \n if role_or_paths.is_a?(Array)\n role = '*'\n files = role_or_paths.map { |path| File.expand_path(path) }\n else\n role = role_or_paths.to_s\n files = Dir.glob(\"nodes/*.json\")\n end\n \n files.map { |str| \n h = JSON(File.read(str))\n next if role != '*' && !(h['roles'] || []).include?(role)\n h['ipaddress'] ||= File.basename(str).sub(\".json\", \"\")\n h\n }.compact\n \nend",
"def fixture_path\n File.join(__dir__, '../chef/fixtures')\n end",
"def load!\n if(path)\n if(File.directory?(path))\n conf = Dir.glob(File.join(path, '*')).sort.inject(Smash.new) do |memo, file_path|\n memo.deep_merge(load_file(file_path))\n end\n elsif(File.file?(path))\n conf = load_file(path)\n else\n raise Errno::ENOENT.new path\n end\n conf\n end\n end",
"def load_config(filename)\n yml = YAML.load_file(filename)\n yml.each do |key, value| \n next if key == 'Templates'\n\n if key == 'PackageDirs'\n # PackageDirs.register value\n elsif key == 'AppDirs' \n # ApplicationDirMatcher.register value\n else\n app_matcher.register value\n end \n end\n end",
"def read_config_file\n begin\n Log.log.debug(\"config file is: #{@option_config_file}\".red)\n conf_file_v1=File.join(Dir.home,ASPERA_HOME_FOLDER_NAME,PROGRAM_NAME_V1,DEFAULT_CONFIG_FILENAME)\n conf_file_v2=File.join(Dir.home,ASPERA_HOME_FOLDER_NAME,PROGRAM_NAME_V2,DEFAULT_CONFIG_FILENAME)\n # files search for configuration, by default the one given by user\n search_files=[@option_config_file]\n # if default file, then also look for older versions\n search_files.push(conf_file_v2,conf_file_v1) if @option_config_file.eql?(@conf_file_default)\n # find first existing file (or nil)\n conf_file_to_load=search_files.select{|f| File.exist?(f)}.first\n # require save if old version of file\n save_required=!@option_config_file.eql?(conf_file_to_load)\n # if no file found, create default config\n if conf_file_to_load.nil?\n Log.log.warn(\"No config file found. Creating empty configuration file: #{@option_config_file}\")\n @config_presets={CONF_PRESET_CONFIG=>{CONF_PRESET_VERSION=>@program_version},CONF_PRESET_DEFAULT=>{'server'=>'demoserver'},\n 'demoserver'=>{'url'=>'ssh://'+DEMO+'.asperasoft.com:33001','username'=>AOC_COMMAND_V2,'ssAP'.downcase.reverse+'drow'.reverse=>DEMO+AOC_COMMAND_V2}}\n else\n Log.log.debug \"loading #{@option_config_file}\"\n @config_presets=YAML.load_file(conf_file_to_load)\n end\n files_to_copy=[]\n Log.log.debug \"Available_presets: #{@config_presets}\"\n raise \"Expecting YAML Hash\" unless @config_presets.is_a?(Hash)\n # check there is at least the config section\n if !@config_presets.has_key?(CONF_PRESET_CONFIG)\n raise \"Cannot find key: #{CONF_PRESET_CONFIG}\"\n end\n version=@config_presets[CONF_PRESET_CONFIG][CONF_PRESET_VERSION]\n if version.nil?\n raise \"No version found in config section.\"\n end\n # oldest compatible conf file format, update to latest version when an incompatible change is made\n # check compatibility of version of conf file\n config_tested_version='0.4.5'\n if Gem::Version.new(version) < Gem::Version.new(config_tested_version)\n raise \"Unsupported config file version #{version}. Expecting min version #{config_tested_version}\"\n end\n config_tested_version='0.6.15'\n if Gem::Version.new(version) < Gem::Version.new(config_tested_version)\n convert_preset_plugin_name(AOC_COMMAND_V1,AOC_COMMAND_V2)\n version=@config_presets[CONF_PRESET_CONFIG][CONF_PRESET_VERSION]=config_tested_version\n save_required=true\n end\n config_tested_version='0.8.10'\n if Gem::Version.new(version) <= Gem::Version.new(config_tested_version)\n convert_preset_path(PROGRAM_NAME_V1,PROGRAM_NAME_V2,files_to_copy)\n version=@config_presets[CONF_PRESET_CONFIG][CONF_PRESET_VERSION]=config_tested_version\n save_required=true\n end\n config_tested_version='1.0'\n if Gem::Version.new(version) <= Gem::Version.new(config_tested_version)\n convert_preset_plugin_name(AOC_COMMAND_V2,AOC_COMMAND_V3)\n convert_preset_path(PROGRAM_NAME_V2,@tool_name,files_to_copy)\n version=@config_presets[CONF_PRESET_CONFIG][CONF_PRESET_VERSION]=config_tested_version\n save_required=true\n end\n # Place new compatibility code here\n if save_required\n Log.log.warn(\"Saving automatic conversion.\")\n @config_presets[CONF_PRESET_CONFIG][CONF_PRESET_VERSION]=@program_version\n save_presets_to_config_file\n Log.log.warn(\"Copying referenced files\")\n files_to_copy.each do |file|\n FileUtils.cp(file,@main_folder)\n Log.log.warn(\"..#{file} -> #{@main_folder}\")\n end\n end\n rescue Psych::SyntaxError => e\n Log.log.error(\"YAML error in config file\")\n raise e\n rescue => e\n Log.log.debug(\"-> #{e}\")\n new_name=\"#{@option_config_file}.pre#{@program_version}.manual_conversion_needed\"\n File.rename(@option_config_file,new_name)\n Log.log.warn(\"Renamed config file to #{new_name}.\")\n Log.log.warn(\"Manual Conversion is required. Next time, a new empty file will be created.\")\n raise CliError,e.to_s\n end\n end",
"def chef_config_path\n if Chef::Config['config_file']\n ::File.dirname(Chef::Config['config_file'])\n else\n raise(\"No chef config file defined. Are you running \\\nchef-solo? If so you will need to define a path for the ohai_plugin as the \\\npath cannot be determined\")\n end\n end",
"def read_cluster_config\n if ENV['VAGRANT_CWD'] then\n folder = ENV['VAGRANT_CWD'] + \"/cluster_defs.json\"\n defs_file = open(folder)\n else\n defs_file = open(\"cluster_defs.json\")\n end\n defs_json = defs_file.read\n clust_cfg = JSON.parse(defs_json)\n defs_file.close\n return clust_cfg\nend",
"def configuration_setup\n dirname = File.expand_path(USER_DIR)\n if !File.exists?(dirname)\n Dir.mkdir(dirname) \n create_storage_dir\n create_staging_dir\n create_user_conf_file\n create_user_email_conf_file\n else \n create_user_conf_file if !File.exists?(USER_CONF_FILE)\n create_storage_dir if !File.exists?(File.expand_path(STORAGE_DIR))\n create_staging_dir if !File.exists?(File.expand_path(STAGING_DIR))\n create_user_email_conf_file if !File.exists?(EMAIL_CONF_FILE)\n end\n end",
"def installed_spec_directories; end",
"def load\n if File.exist?(@base_file)\n string = File.read(@base_file)\n obj = JSON.parse(string)\n else\n obj = {\n \"target\" => {},\n \"tester\" => {\n \"software\" => \"dolphin\",\n \"version\" => 0.1,\n },\n \"human\" => \"anonymous coward\"\n }\n end\n @config = HashTree[obj]\n\n if File.exist?(@completions_file)\n string = File.read(@completions_file)\n obj = JSON.parse(string)\n else\n obj = []\n end\n @completions = Set.new(obj)\n\n # in case there were manual edits to the file,\n # do completions\n @config.traverse do |node|\n self.add_terms(node.keys)\n node.values.each do |v|\n if v.is_a? String\n self.add_terms(v)\n end\n end\n end\n\n @config.each_path do |path|\n self.add_terms(path.join(\".\"))\n end\n end",
"def configs(cfg)\n Dir.glob(cfg[\"tile_engines\"][\"conf_dir\"] + \"/*.conf.yml\").each do |item|\n\t engine_cfg = File.open(item){|fd| YAML.load(fd)}\n\t engine_cfg[\"mailer_config\"] = cfg[\"tile_engines\"][\"mailer_config\"]\n\t engine_cfg[\"config_path\"]=item\n\t yield engine_cfg\n end\n end",
"def sub_config\n puts config_script\n shell(config_script, source_dir(true))\n end",
"def parse_spec_file(task_spec)\n task_spec_metadata = {}\n\n begin\n text = task_spec.read\n text.split(\"\\n\").each do |line|\n line = line.downcase\n\n if line =~ /^\\s*#\\s*(?:yamls|hiera):\\s*(.*)/\n task_spec_metadata[:hiera] = [] unless task_spec_metadata[:hiera].is_a? Array\n task_spec_metadata[:hiera] += get_list_of_yamls $1\n end\n\n if line =~ /^\\s*#\\s*facts:\\s*(.*)/\n task_spec_metadata[:facts] = [] unless task_spec_metadata[:facts].is_a? Array\n task_spec_metadata[:facts] += get_list_of_yamls $1\n end\n\n if line =~ /^\\s*#\\s*(?:skip_yamls|skip_hiera):\\s(.*)/\n task_spec_metadata[:skip_hiera] = [] unless task_spec_metadata[:skip_hiera].is_a? Array\n task_spec_metadata[:skip_hiera] += get_list_of_yamls $1\n end\n\n if line =~ /^\\s*#\\s*skip_facts:\\s(.*)/\n task_spec_metadata[:skip_facts] = [] unless task_spec_metadata[:skip_facts].is_a? Array\n task_spec_metadata[:skip_facts] += get_list_of_yamls $1\n end\n\n if line =~ /^\\s*#\\s*disable_spec/\n task_spec_metadata[:disable] = true\n end\n\n if line =~ /^\\s*#\\s*role:\\s*(.*)/\n task_spec_metadata[:roles] = [] unless task_spec_metadata[:roles].is_a? Array\n roles = line.split /\\s*,\\s*|\\s+/\n task_spec_metadata[:roles] += roles\n end\n\n if line =~ /^\\s*#\\s*run:\\s*(.*)/\n run_record = get_list_of_yamls $1\n if run_record.length >= 2\n run_record = {\n :hiera => run_record[0],\n :facts => run_record[1],\n }\n task_spec_metadata[:runs] = [] unless task_spec_metadata[:runs].is_a? Array\n task_spec_metadata[:runs] << run_record\n end\n end\n end\n rescue\n return task_spec_metadata\n end\n task_spec_metadata\n end",
"def load_config\n create_yolo_dir\n unless File.exist?(yaml_path)\n @formatter.config_created(yaml_path)\n FileUtils.cp_r(File.dirname(__FILE__) + \"/config.yml\", yaml_path)\n end\n end",
"def remove_hiera_template\n Bebox::PROVISION_STEP_NAMES.each {|step| FileUtils.cd(self.project_root) { FileUtils.rm_rf \"puppet/steps/#{step}/hiera/data/#{self.name}.yaml\" } }\n end",
"def create_health_script file\n contents = <<EOF\n#!/bin/bash\nf1=static.cfg\nf2=runtime.cfg\nf3=prefs.cfg\nif [[ ! (-e $f1 && -e $f2 && -e $f3) ]]; then\n echo \"files missing, no, it's not good :-(\"\n exit 1\nfi\nSTATIC=$(grep \".*\" $f1)\nRUNTIME=$(grep \".*\" $f2)\nPREFS=$(grep \".*\" $f3)\nif [[ (\"$STATIC\" == \"ncores=4\") && (\"$RUNTIME\" == \"memory=1024\") && (\"$PREFS\" == \"folder=home\") ]]; then\n echo \"yes, it's good :-)\"\nelse\n echo \"no, it's not good :-(\"\n exit 2\nfi\nEOF\n File.open file, \"w\" do |f|\n f.puts contents\n end\n File.chmod(0744, file)\nend",
"def search_config( directory )\n \t\tif File.file?( File.join( directory, \".mytix.yaml\" ) ) \n\t\t\treturn directory\n\t\telse\n\t\t\tparentdir = File.dirname( directory )\n\t\t\tif directory != parentdir\n\t\t\t\tsearch_config( parentdir )\n\t\t\telse\n\t\t\t\treturn \"\"\n\t\t\tend\n\t\tend\n\tend"
] | [
"0.64268255",
"0.5865868",
"0.5843177",
"0.5788928",
"0.57699054",
"0.5763899",
"0.57149637",
"0.5664235",
"0.56347233",
"0.5603015",
"0.5576554",
"0.55589277",
"0.5555402",
"0.5537381",
"0.5522504",
"0.5498021",
"0.54587007",
"0.54587007",
"0.54543394",
"0.5453461",
"0.5443524",
"0.54367596",
"0.54261315",
"0.5414081",
"0.5408173",
"0.53994566",
"0.53949344",
"0.53407866",
"0.5333123",
"0.5331511",
"0.5327112",
"0.53258944",
"0.5322756",
"0.53060144",
"0.52919906",
"0.527238",
"0.52720964",
"0.52698654",
"0.525931",
"0.52582395",
"0.52532184",
"0.5223414",
"0.5219216",
"0.521905",
"0.5201243",
"0.52001184",
"0.51920736",
"0.51777875",
"0.5171563",
"0.5165777",
"0.51626796",
"0.5162511",
"0.51489204",
"0.5141369",
"0.51403666",
"0.51345986",
"0.5133978",
"0.51331073",
"0.5128763",
"0.51153046",
"0.5111603",
"0.51006323",
"0.5099555",
"0.5096273",
"0.5091983",
"0.5090358",
"0.50835246",
"0.50814223",
"0.50618297",
"0.5060315",
"0.50571257",
"0.50496477",
"0.5048082",
"0.504655",
"0.5045506",
"0.5041533",
"0.50266045",
"0.50260365",
"0.5022287",
"0.5021092",
"0.502074",
"0.50185716",
"0.5014786",
"0.5014695",
"0.5013639",
"0.5010556",
"0.5008764",
"0.49989635",
"0.4995502",
"0.49929142",
"0.498555",
"0.49855328",
"0.498152",
"0.49798685",
"0.49722412",
"0.4969875",
"0.49677587",
"0.4964254",
"0.49640718",
"0.4960503"
] | 0.5558348 | 12 |
Returns the list of node configs hashes in the given scenario. | def node_configs(scenario_id)
parse_node_config_files(parse_scenario_file(scenario_id))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_subhashes(node)\n l_hash = node.left ? node.left._hash : self.class.null_hash_at(node.depth + 1)\n r_hash = node.right ? node.right._hash : self.class.null_hash_at(node.depth + 1)\n [l_hash, r_hash]\n end",
"def find_scenario_paths(scenarios)\n return [] if scenarios.nil?\n scenarios.select do |path|\n (@location + path + \"scenario.yml\").exist?\n end.uniq.compact\n end",
"def node_list\n Chef::Node.list.keys\n end",
"def matched_configs(object, node)\n return [] unless node\n mod = object.is_a?(Module) ? object : object.class\n path = underscore(mod.name)\n\n [node[mod.name],\n node[path],\n node.get(path),\n ].uniq.compact\n end",
"def generate_node_config\n run_list = { run_list: @recipes.map{|name| \"recipe[#{name}]\"} }\n @ssh.write \"/tmp/node.json\", content: JSON.generate(run_list), sudo: true\n end",
"def generate_node_config\n run_list = { run_list: @recipes.map{|name| \"recipe[#{name}]\"} }\n ssh.write \"#{CHEF_VAR_PATH}/node.json\", content: JSON.generate(run_list), sudo: true\n end",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end",
"def node_list\n list = {}\n search = Chef::Search::Query.new\n query = config[:query]\n\n ui.msg \"Search nodes '#{query}'\"\n search.search('node', query) do |node|\n if node['chef'] && node['chef']['client_version']\n version = node['chef']['client_version']\n\n list[version] ||= []\n list[version] << node\n end\n end\n ui.msg ''\n\n list\n end",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.source)}\n return(cfg)\n end",
"def get_scenarios\n scenarios = []\n File.open(@options[:scenarios_file]) do |f|\n f.each_line do |line|\n scenarios << line.chomp\n end\n end\n return scenarios.sort\n end",
"def get_hash()\n\t\t\treturn @config.clone()\n\t\tend",
"def get_scenario_hash(feature_hash)\r\n # scenario details are inside the elements tag\r\n feature_hash['elements']\r\n end",
"def node_hash(node_id)\n \n end",
"def hashes\n return @hashes\n end",
"def get_all_roles_nodes\n result = search(:node, \"chef_environment:#{node.chef_environment}\")\n if result.any? { |x| x['hostname'] == node['hostname'] }\n result.map! { |x| x['hostname'] == node['hostname'] ? node : x }\n else\n result.push(node)\n end\n return result.sort! { |a, b| a['hostname'] <=> b['hostname'] }\nend",
"def collect_node_nei_hashes\n @log.info(\"#{__method__.to_s} started[#{self.class.to_s}]\")\n\n node_nei_hash = @redis_connector.fetch_relations\n end",
"def all_structural_subhashes\n hashes = []\n self.deep_each do |node|\n hashes << node.structural_hash\n end\n hashes\n end",
"def disk_hash_tree\n tree_size = SpStore::Merkle::HashTreeHelper.full_tree_node_count @blocks\n node_hashes = Array.new(tree_size+1)\n File.open(disk_hash_file, 'rb') do |file|\n file.seek(hash_byte_size, IO::SEEK_SET)\n (1..tree_size).each do |idx|\n node_hashes[idx] = file.read(hash_byte_size)\n end\n end\n node_hashes\n end",
"def configs\n @configuration.ids\n end",
"def node_hash_for(node, statements, hashes)\n statement_signatures = []\n grounded = true\n statements.each do | statement |\n if statement.to_quad.include?(node)\n statement_signatures << hash_string_for(statement, hashes, node)\n statement.to_quad.compact.each do | resource |\n grounded = false unless grounded?(resource, hashes) || resource == node\n end\n end\n end\n # Note that we sort the signatures--without a canonical ordering, \n # we might get different hashes for equivalent nodes.\n [grounded,Digest::SHA1.hexdigest(statement_signatures.sort.to_s)]\n end",
"def config_list(regex)\n\t\tcmd = \"git config -f #{@config_file} \" +\n\t\t \"--get-regexp 'environment.#{@env}.#{regex}'\"\n\n\t\tbegin\n\t\t\t@command.\n\t\t\t run_command_stdout(cmd).\n\t\t\t split(\"\\n\").\n\t\t\t map { |l| l.split(/\\s+/, 2) }.\n\t\t\t map { |item|\t[item[0].gsub(\"environment.#{@env}.\", ''), item[1]] }\n\t\trescue Giddyup::CommandWrapper::CommandFailed => e\n\t\t\tif e.status.exitstatus == 1\n\t\t\t\t# \"Nothing found\", OK then\n\t\t\t\treturn []\n\t\t\telse\n\t\t\t\traise RuntimeError,\n\t\t\t\t \"Failed to get config list environment.#{@env}.#{regex}\"\n\t\t\tend\n\t\tend\n\tend",
"def node_list\n connect unless connected?\n set_config unless @config\n\n return [] unless config\n\n [\"#{@host}:#{@port}\"]\n end",
"def list_config\n configs = store :get, 'configs'\n (configs.error?) ? 'No config vars set yet.' : configs.to_s\n end",
"def generate_config_for(mode)\n config_items = []\n @cluster_members.each do |mem|\n # The config item should match the structure NodeInfo\n # in node/cluster/membership.go in order for that one\n # to unmarshal successfully.\n config_item = {node_id: mem.id}\n if :docker.eql? mode\n config_item[:rpc_url] = \"#{mem.id}:#{mem.rpc_port}\"\n config_item[:api_url] = \"#{mem.id}:#{mem.api_port}\"\n else\n config_item[:rpc_url] = \"localhost:#{mem.rpc_port}\"\n config_item[:api_url] = \"localhost:#{mem.api_port}\"\n end\n config_items << config_item\n end\n config_items\n end",
"def nodes(hsh={})\n results = describe_instances(:status=>'running').select_with_hash({:keypair_name => keypair.basename})\n results.select_with_hash(hsh)\n end",
"def get_node_names\n Chef::Node.list.keys\n end",
"def hash\n node_id.hash\n end",
"def configurations\n @configurations ||= []\n end",
"def hash_nodes(statements, nodes, grounded_hashes)\n hashes = grounded_hashes.dup\n ungrounded_hashes = {}\n hash_needed = true\n\n # We may have to go over the list multiple times. If a node is marked as\n # grounded, other nodes can then use it to decide their own state of\n # grounded.\n while hash_needed\n starting_grounded_nodes = hashes.size\n nodes.each do | node |\n unless hashes.member? node\n grounded, hash = node_hash_for(node, statements, hashes)\n if grounded\n hashes[node] = hash\n end\n ungrounded_hashes[node] = hash\n end\n end\n\n # after going over the list, any nodes with a unique hash can be marked\n # as grounded, even if we have not tied them back to a root yet.\n uniques = {}\n ungrounded_hashes.each do |node, hash|\n uniques[hash] = uniques.has_key?(hash) ? false : node\n end\n uniques.each do |hash, node|\n hashes[node] = hash if node\n end\n hash_needed = starting_grounded_nodes != hashes.size\n end\n [hashes, ungrounded_hashes]\n end",
"def get_checksums(commit)\n # Reset @currenthash\n @currenthash = Hash.new\n path = find_relative_git_cookbook_path\n #puts \"path is '#{path}' commit hash is #{commit}\"\n #puts \"commit.tree is #{commit.tree}\"\n unless path == '.'\n tree = commit.tree / path\n git_checksum_hash(tree)\n else\n git_checksum_hash(commit.tree)\n end\n end",
"def group_by_environment(node_configs)\n node_configs.group_by do |config|\n node_environment(config)\n end\nend",
"def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.desc)}\n return(cfg)\n end",
"def matched_configs\n [@full_config['environments'][environment], @full_config['nodes'][fqdn]]\n end",
"def to_hash\n @configuration_data\n end",
"def gen_node_configs(cluster_yml)\n master_n = cluster_yml['master_n']\n master_mem = cluster_yml['master_mem']\n master_cpus = cluster_yml['master_cpus']\n slave_n = cluster_yml['slave_n']\n slave_mem = cluster_yml['slave_mem']\n slave_cpus = cluster_yml['slave_cpus']\n master_ipbase = cluster_yml['master_ipbase']\n slave_ipbase = cluster_yml['slave_ipbase']\n master_instance_type = cluster_yml['master_instance_type']\n slave_instance_type = cluster_yml['slave_instance_type']\n master_droplet_size = cluster_yml['master_droplet_size']\n slave_droplet_size = cluster_yml['slave_droplet_size']\n\n master_infos = (1..master_n).map do |i|\n { :hostname => \"master#{i}\",\n :ip => master_ipbase + \"#{10+i}\",\n :mem => master_mem,\n :cpus => master_cpus,\n :instance_type => master_instance_type,\n :size => master_droplet_size\n }\n end\n slave_infos = (1..slave_n).map do |i|\n { :hostname => \"slave#{i}\",\n :ip => slave_ipbase + \"#{10+i}\",\n :mem => slave_mem,\n :cpus => slave_cpus,\n :instance_type => slave_instance_type,\n :size => slave_droplet_size\n }\n end\n\n return { :master => master_infos, :slave=>slave_infos }\nend",
"def nodes\n get_chef_files_absolute_paths nodes_path\n end",
"def scenarios\n return @scenarios\n end",
"def config_nodes_task(task_mh, state_change_list, assembly_idh = nil, stage_index = nil)\n return nil unless state_change_list and not state_change_list.empty?\n ret = nil\n all_actions = []\n if state_change_list.size == 1\n executable_action, error_msg = get_executable_action_from_state_change(state_change_list.first, assembly_idh, stage_index)\n fail ErrorUsage.new(error_msg) unless executable_action\n all_actions << executable_action\n ret = create_new_task(task_mh, display_name: \"config_node_stage#{stage_index}\", temporal_order: 'concurrent')\n ret.add_subtask_from_hash(executable_action: executable_action)\n else\n ret = create_new_task(task_mh, display_name: \"config_node_stage#{stage_index}\", temporal_order: 'concurrent')\n all_errors = []\n state_change_list.each do |sc|\n executable_action, error_msg = get_executable_action_from_state_change(sc, assembly_idh, stage_index)\n unless executable_action\n all_errors << error_msg\n next\n end\n all_actions << executable_action\n ret.add_subtask_from_hash(executable_action: executable_action)\n end\n fail ErrorUsage.new(\"\\n\" + all_errors.join(\"\\n\")) unless all_errors.empty?\n end\n attr_mh = task_mh.createMH(:attribute)\n Action::ConfigNode.add_attributes!(attr_mh, all_actions)\n ret\n end",
"def get_all(key)\n configuration.hpath(key)\n end",
"def ssh_configs\n configs = []\n configs << project_git_config if project_git_config.host\n configs << database_git_config if database_git_config.host\n configs.concat @standalone_ssh_configs\n configs.compact\n end",
"def ssh_hostnames\n ssh_configs.map { |c| c.hostname }.compact.uniq.sort\n end",
"def hash\n @node.sort.push(@edge).hash\n end",
"def get_scenario_details(json_gherkin = self.feature_json)\r\n json_hash = json_to_hash(json_gherkin)\r\n self.scenario_hash = get_scenario_hash(json_hash)\r\n feature_absolute_path = get_feature_file_absolute_path(json_hash)\r\n self.scenario_hash.each do |one_scenario|\r\n one_scenario_hash = Hash[one_scenario]\r\n self.scenario_name = one_scenario_hash['name']\r\n tags = one_scenario_hash['tags']\r\n @tag_hash = []\r\n unless tags.nil?\r\n tags.each do |each_tag|\r\n @tag_hash.push(each_tag['name'])\r\n end\r\n end\r\n # Each Scenario Object will be tagged to One Browser for Parallel Execetion \r\n #@TODO need to add cod for Browser Config and Pass to Scenario Details Class. For now passing NIL\r\n scenario_details = ScenarioDetails.new(self.scenario_name, @tag_hash, feature_absolute_path, nil)\r\n @array_scenarios << scenario_details\r\n end\r\n end",
"def ceph_chef_mon_nodes\n results = nil\n if node['ceph']['search_by_environment']\n results = search(:node, ceph_chef_mon_env_search_string)\n else\n results = search(:node, \"tags:#{node['ceph']['mon']['tag']}\")\n if !results.include?(node) && node.run_list.roles.include?(node['ceph']['mon']['role'])\n results.push(node)\n end\n end\n\n results.map! { |x| x['hostname'] == node['hostname'] ? node : x }\n results.sort! { |a, b| a['hostname'] <=> b['hostname'] }\nend",
"def fetch_whitelist_from_configuration\n conf_file = 'sniffer_config.json'.freeze\n if File.file?(conf_file)\n common_conf_sniffer_conf = JSON.parse(File.read(conf_file))\n searchable_folders = common_conf_sniffer_conf['whitelist'] - common_conf_sniffer_conf['blacklist']\n whitelist = F! searchable_folders.empty? ? searchable_folders : Dir.glob('../*/')\n return whitelist\n end\n\n puts \"No sniffer config found, Missing file, sniffer_conf.json\"\n return Dir.glob('../*/')\n end",
"def get_role_info(secret)\n if !valid_secret?(secret)\n return BAD_SECRET_MSG\n end\n\n all_nodes = []\n @nodes.each { |node|\n all_nodes << node.to_hash()\n }\n\n return JSON.dump(all_nodes)\n end",
"def hgetall(hash)\n redis_token.hgetall(hash)\n end",
"def get_inflated_node_list\n Chef::Node.list(true)\n end",
"def hash(option_json)\n\t\tif(File.exist?(GROWTH::GROWTH_REPOSITORY))then\n\t\t\tg = Git.open(GROWTH::GROWTH_REPOSITORY)\n\t\t\treturn {status: \"ok\", hash: g.log()[-1].sha}\n\t\telse\n\t\t\treturn {status: \"error\", message: \"GRWOTH git repository '#{GROWTH::GROWTH_REPOSITORY}' not found \"}\n\t\tend\n\tend",
"def all_chunk_hashes\n\t\t\n\t\tbegin\n\t\t\t@all_chunk_map = \"\"\n\t\t\t0.upto(num_chunks-1) { |i|\n\t\t\t\t@all_chunk_map += sha1_chunk(i)\n\t\t\t}\n\n\t\tend unless @all_chunk_map\n\t\t@all_chunk_map\n\tend",
"def excluded_node_list\n config[\"nodes\"] ? config[\"nodes\"][\"exclude\"] : []\n end",
"def hgetall(key)\n node_for(key).hgetall(key)\n end",
"def modules_per_environment(node_configs)\n node_configs = group_by_environment(node_configs)\n modules = node_configs.map do |env, configs|\n [env, configs.map { |c| c['modules'] }.flatten.uniq]\n end\n Hash[modules]\nend",
"def get_responsible_nodes key\n responsible_hash_keys = []\n if @@dynamo_nodes.size <= ENV['REPLICATION'].to_i\n return @@dynamo_nodes\n end\n responsible_node_key = 0\n previous = 0\n\n sorted_hash_keys = @@dynamo_nodes.sort_by { |_k,v| v.first.second.to_i}.map {|_k,v| v.first.second}\n\n sorted_hash_keys.each do |hash_key|\n #log_message('Comparing key '+key.to_i.to_s+' to hash_key '+hash_key.to_i.to_s)\n if key.to_i <= hash_key.to_i && key.to_i > previous.to_i #key.to_i.between?(previous.to_i,hash_key.to_i)\n responsible_node_key = hash_key\n break\n elsif hash_key.to_i == sorted_hash_keys.last.to_i && hash_key.to_i < key.to_i\n responsible_node_key = sorted_hash_keys.first\n else\n previous = hash_key\n end\n end\n\n sorted_hash_keys.each_with_index do |key, index|\n if key == responsible_node_key\n 3.times.each_with_index { |_e, iterator| responsible_hash_keys << sorted_hash_keys[(index - iterator) % sorted_hash_keys.size]}\n end\n end\n\n @@dynamo_nodes.select { |_k, v| v.first.second.in?(responsible_hash_keys) }\n\n end",
"def to_hash\n log_blocked_facts\n logger.debug(\"Facter version: #{Facter::VERSION}\")\n\n resolved_facts = Facter::FactManager.instance.resolve_facts\n resolved_facts.reject! { |fact| fact.type == :custom && fact.value.nil? }\n collection = Facter::FactCollection.new.build_fact_collection!(resolved_facts)\n\n # Ensures order of keys in hash returned from Facter.to_hash() and\n # Facter.resolve() is always stable\n if collection.empty?\n Hash[collection]\n else\n Hash[Facter::Utils.sort_hash_by_key(collection)]\n end\n end",
"def to_hash\n ChefConfig::Config.save(true)\n end",
"def get_all_nodes(state)\n rc = []\n machines = state[:machines]\n chef_server = Cheffish::CheffishServerAPI.new(Cheffish.enclosing_chef_server)\n nodes = chef_server.get(\"/nodes\")\n nodes.each_key do |key|\n if (machines.include?(key))\n node_url = nodes[key]\n node = chef_server.get(node_url)\n rc.push(node)\n end\n end\n return rc\n end",
"def get_keys()\n\t\t\treturn @config.keys\n\t\tend",
"def instances_names_list\n return [] unless configured?\n\n aws_instances_ids = instances_list || []\n aws_instances_ids.map { |instance| instance[:node_name] }\n end",
"def reference_book_configurations()\n return Rails.cache.fetch(\"odsa_reference_book_configs\", expires_in: 6.hours) do\n config_dir = File.join(\"public\", \"OpenDSA\", \"config\")\n base_url = request.protocol + request.host_with_port + \"/OpenDSA/config/\"\n configs = []\n Dir.foreach(config_dir) do |entry|\n if entry.include?(\"_generated.json\") or not File.extname(entry) == '.json'\n next\n end\n url = base_url + File.basename(entry)\n begin\n title = JSON.parse(File.read(File.join(config_dir, entry)))[\"title\"]\n configs << {\n title: title,\n name: File.basename(entry, '.json'),\n url: url,\n }\n rescue\n error = Error.new(:class_name => 'book_config_parse_fail',\n :message => \"Failed to parse #{entry}\")\n error.save!\n end\n end\n configs.sort_by! { |x| x[:title] }\n end\n end",
"def listFileHashes\n return contentHost.listFileHashes(baseDir)\n end",
"def get_pool_names\n pool_names = []\n Dir.entries(@confdir).each do |entry|\n pool_names.push $1 if entry =~ @pool_fname_regex\n end\n pool_names\n end",
"def generate_chef_config()\n Kitchenplan::Log.info 'Generating the Chef configs'\n #$: << File.join((File.expand_path(\"../\", Pathname.new(__FILE__).realpath)), \"/lib\")\n File.open(\"kitchenplan-attributes.json\", 'w') do |out|\n\tout.write(::JSON.pretty_generate(self.config['attributes']))\n end\n File.open(\"solo.rb\", 'w') do |out|\n\tout.write(\"cookbook_path [ \\\"#{Dir.pwd}/cookbooks\\\" ]\")\n end\n end",
"def config_for(node_name)\n data = @groups.data_for(node_name)\n if data\n Bolt::Util.symbolize_keys(data['config'])\n end\n end",
"def generate_config(resource)\n resource = symbolize_hash(convert_to_hash(resource))\n config = []\n config << \"lxc.utsname = #{resource[:utsname]}\"\n if(resource[:aa_profile])\n config << \"lxc.aa_profile = #{resource[:aa_profile]}\"\n end\n [resource[:network]].flatten.each do |net_hash|\n nhsh = Mash.new(net_hash)\n flags = nhsh.delete(:flags)\n %w(type link).each do |k|\n config << \"lxc.network.#{k} = #{nhsh.delete(k)}\" if nhsh[k]\n end\n nhsh.each_pair do |k,v|\n config << \"lxc.network.#{k} = #{v}\"\n end\n if(flags)\n config << \"lxc.network.flags = #{flags}\"\n end\n end\n if(resource[:cap_drop])\n config << \"lxc.cap.drop = #{Array(resource[:cap_drop]).join(' ')}\"\n end\n %w(include pts tty arch devttydir mount mount_entry rootfs rootfs_mount pivotdir).each do |k|\n config << \"lxc.#{k.sub('_', '.')} = #{resource[k.to_sym]}\" if resource[k.to_sym]\n end\n prefix = 'lxc.cgroup'\n resource[:cgroup].each_pair do |key, value|\n if(value.is_a?(Array))\n value.each do |val|\n config << \"#{prefix}.#{key} = #{val}\"\n end\n else\n config << \"#{prefix}.#{key} = #{value}\"\n end\n end\n config.join(\"\\n\") + \"\\n\"\n end",
"def names\n @configs.keys\n end",
"def names\n @configs.keys\n end",
"def all_nodes\n Pathname.glob(node_file(\"*\", false)).map do |file|\n json = JSON.parse(file.read)\n Config::Node.from_json(json)\n end\n end",
"def to_hash\n @configuration\n end",
"def to_hash\n @configuration\n end",
"def hash\n [host_list, total_matching, total_returned].hash\n end",
"def chef_config\n ci = @json.split('/').last.gsub('.json', '')\n \"#{prefix_root}/home/oneops/#{@circuit}/components/cookbooks/\" \\\n \"chef-#{ci}.rb\"\n end",
"def dev_pod_hashes_map\n @dev_pod_hashes_map ||=\n dev_pod_sources.map { |name, attribs| [name, FolderChecksum.git_checksum(attribs[:path])] }.to_h\n end",
"def to_hash(node)\n @facts.inject({}) do |h, ary|\n resolved_value = RFacter::DSL::COLLECTION.bind(self) do\n RFacter::DSL::NODE.bind(node) do\n ary[1].value\n end\n end\n\n # For backwards compatibility, convert the fact name to a string.\n h[ary[0].to_s] = resolved_value unless resolved_value.nil?\n\n h\n end\n end",
"def hashes(log)\n return log.split(\"\\n\").map{|line| parser(line) }\n end",
"def index\n @graphium_configurations = Graphium::Configuration.all\n end",
"def scenarios\n @tests.select { |test| test.is_a? Scenario }\n end",
"def scenarios\n @tests.select { |test| test.is_a? Scenario }\n end",
"def hg_tags_nodes\n return_list = {}\n self.heads.reverse.each do |node|\n changeset = self[node]\n rev = changeset.revision\n file_node = changeset.get_file(\".hgtags\") rescue next\n return_list[file_node] = [rev, node, file_node]\n end\n return return_list.values\n end",
"def nodes\n nodes_by_id.values\n end",
"def nodes\n state(metrics: \"nodes\").dig(\"nodes\")\n end",
"def enum_configs\n host = session.session_host\n port = session.session_port\n exec_commands = [\n {\n 'cmd' => '/export verbose',\n 'fn' => 'get_config',\n 'desc' => 'Get Device Config on Mikrotik Device'\n },\n ]\n exec_commands.each do |ec|\n command = ec['cmd']\n cmd_out = session.shell_command(command).gsub(/#{command}/, '')\n print_status(\"Gathering info from #{command}\")\n # detect if we're in pagination and get as much data as possible\n if ec['fn'] == 'get_config'\n mikrotik_routeros_config_eater(host, port, cmd_out.strip)\n else\n cmd_loc = store_loot(\"mikrotik.#{ec['fn']}\",\n 'text/plain',\n session,\n cmd_out.strip,\n \"#{ec['fn']}.txt\",\n ec['desc'])\n vprint_good(\"Saving to #{cmd_loc}\")\n end\n end\n end",
"def configurations\n return @configurations if @configurations\n \n configurations = CONFIGURATIONS_CLASS.new\n configurations.extend(IndifferentAccess) if @use_indifferent_access\n \n ancestors.reverse.each do |ancestor|\n next unless ancestor.kind_of?(ClassMethods)\n ancestor.config_registry.each_pair do |key, value|\n if value.nil?\n configurations.delete(key)\n else\n configurations[key] = value\n end\n end\n end\n \n configurations\n end",
"def ceph_chef_pool_set(pool)\n if !node['ceph']['pools'][pool]['federated_names'].empty? && node['ceph']['pools'][pool]['federated_enable']\n node_loop = node['ceph']['pools'][pool]['federated_names']\n node_loop.each do |name|\n # if node['ceph']['pools'][pool]['settings']['type'] == 'replicated'\n next unless name['type'] == 'replicated'\n val = if node['ceph']['pools'][pool]['settings']['size']\n node['ceph']['pools'][pool]['settings']['size']\n else\n node['ceph']['osd']['size']['max']\n end\n\n ceph_chef_pool name do\n action :set\n key 'size'\n value val\n only_if \"ceph osd pool #{name} size | grep #{val}\"\n end\n end\n else\n node_loop = node['ceph']['pools'][pool]['pools']\n node_loop.each do |pool_val|\n # if node['ceph']['pools'][pool]['settings']['type'] == 'replicated'\n next unless pool_val['type'] == 'replicated'\n val = if node['ceph']['pools'][pool]['settings']['size']\n node['ceph']['pools'][pool]['settings']['size']\n else\n node['ceph']['osd']['size']['max']\n end\n\n ceph_chef_pool pool_val['name'] do\n action :set\n key 'size'\n value val\n only_if \"ceph osd pool #{pool_val['name']} size | grep #{val}\"\n end\n end\n end\nend",
"def get_config\n if @resource[:section]\n return node.get_config(params: \"section #{@resource[:section]}\", as_string: true)\n end\n node.running_config\n end",
"def used_scenarios # :nodoc:\n @used_scenarios ||= []\n @used_scenarios = (@used_scenarios.collect(&:used_scenarios) + @used_scenarios).flatten.uniq\n end",
"def list\n @artifacts ||= {}\n @artifacts.keys\n end",
"def host_list()\n host_list = [\n {\"ip\"=>\"192.168.110.207\", \"host\"=>\"zabbix-server\", \"roles\"=>[\"zabbix-server\", \"csgw\"], \"deployment\"=>\"vm\", \"status\"=>1},\n {\"ip\"=>\"192.168.110.210\", \"host\"=>\"test-01\", \"roles\"=>[\"test\"], \"deployment\"=>\"test\", \"status\"=>1}\n ]\n return host_list\n end",
"def settings_for_node\n cluster_name = self.parent.name.to_sym\n cluster_role = self.name.to_sym\n node_settings = {\n :user_data => { :attributes => { :run_list => [] } },\n :cluster_name => cluster_name,\n :cluster_role => cluster_role,\n }.deep_merge(Settings)\n node_settings.delete :pools\n raise \"Please define the '#{cluster_name}' cluster and the '#{cluster_role}' role in your ~/.chef/cluster_chef.yaml\" if (Settings[:pools][cluster_name].blank? || Settings[:pools][cluster_name][cluster_role].blank?)\n node_settings = node_settings.deep_merge(\n Settings[:pools][cluster_name][:common] ||{ }).deep_merge(\n Settings[:pools][cluster_name][cluster_role] ||{ })\n configure_aws_region node_settings\n node_settings\nend",
"def root_hash\n self.node_hash root_node_id\n end",
"def get_all_keys\n settings, _ = _get_settings()\n if settings === nil\n @log.error(1000, \"Config JSON is not present. Returning empty list.\")\n return []\n end\n return settings.keys\n end",
"def ssh_config_for(node, ssh_config: nil, nodes: nil, ssh_exec: nil, known_hosts_file: nil)\n if ssh_config.nil?\n params = {}\n params[:nodes] = nodes unless nodes.nil?\n params[:ssh_exec] = ssh_exec unless ssh_exec.nil?\n params[:known_hosts_file] = known_hosts_file unless known_hosts_file.nil?\n ssh_config = test_connector.ssh_config(**params)\n end\n ssh_config_lines = ssh_config.split(\"\\n\")\n begin_marker = node.nil? ? /^Host \\*$/ : /^# #{Regexp.escape(node)} - .+$/\n start_idx = ssh_config_lines.index { |line| line =~ begin_marker }\n return nil if start_idx.nil?\n\n end_markers = [\n /^\\# \\w+ - .+$/,\n /^\\#+$/\n ]\n end_idx = ssh_config_lines[start_idx + 1..].index { |line| end_markers.any? { |end_marker| line =~ end_marker } }\n end_idx = end_idx.nil? ? -1 : start_idx + end_idx\n \"#{\n ssh_config_lines[start_idx..end_idx].select do |line|\n stripped_line = line.strip\n !stripped_line.empty? && stripped_line[0] != '#'\n end.join(\"\\n\")\n }\\n\"\n end",
"def list_from_config(xpath, config, options = {})\n REXML::XPath.match(config, xpath).map do |r|\n hash = Util.xml_to_hash(r, \"search\")\n from_hash(hash, options)\n end\n end",
"def to_a\n list = []\n @_config.each do |feature, configs|\n list.concat(configs)\n end\n list\n end",
"def config_hash\n digest = Digest::MD5.hexdigest(\n \"#{@x}-#{@y}-#{@hires_factor}-#{@render_type}-#{@format}-#{CONVERTER_VERSION}\")\n digest\n end",
"def healthy_cluster_config\n {\n 'http://127.0.0.1:4001' => 'http://127.0.0.1:4001',\n 'http://127.0.0.1:4002' => 'http://127.0.0.1:4001',\n 'http://127.0.0.1:4003' => 'http://127.0.0.1:4001'\n }\n end",
"def keys\n @config.keys\n end",
"def stash_list\n\n check_vcs\n\n cmd = []\n cmd << \"cd\"\n cmd << @wsPath\n cmd << \"&&\"\n cmd << @vcs.exe_path\n cmd << \"stash list\"\n\n cmdln = cmd.join(\" \")\n log_debug \"Stash list : #{cmdln}\"\n res = os_exec(cmdln) do |st, res|\n if st.success?\n list = { }\n res.each_line do |l|\n ll = l.split(\": \")\n\n # first element is the stash id\n # 2nd element is the info on branch\n branch = ll[1].split(\" \")[-1]\n\n\n list[ll[0].strip] = [branch, ll[1..-1].join(\": \")] \n end\n\n [true, list]\n else\n [false, res]\n end\n end\n\n end"
] | [
"0.542058",
"0.5137308",
"0.5054009",
"0.5019797",
"0.5015323",
"0.5013689",
"0.49368373",
"0.49368373",
"0.49368373",
"0.4911848",
"0.48847175",
"0.48072508",
"0.47990763",
"0.4782286",
"0.47625422",
"0.47604105",
"0.47544375",
"0.47277436",
"0.47255638",
"0.4718899",
"0.47171402",
"0.4704105",
"0.4700897",
"0.4690515",
"0.46876684",
"0.45967385",
"0.45947537",
"0.4591293",
"0.45734096",
"0.45596802",
"0.45464778",
"0.45360053",
"0.45357928",
"0.45121297",
"0.45082802",
"0.45014605",
"0.44809815",
"0.44603452",
"0.44582433",
"0.44265807",
"0.4414982",
"0.4411439",
"0.44061255",
"0.4403503",
"0.4399655",
"0.4393986",
"0.439377",
"0.43921757",
"0.4389213",
"0.43839183",
"0.43761683",
"0.43745726",
"0.43727553",
"0.43615305",
"0.4359054",
"0.43428496",
"0.4340657",
"0.4338954",
"0.43372667",
"0.43220797",
"0.4322032",
"0.43041682",
"0.43033695",
"0.4299199",
"0.4295266",
"0.428989",
"0.42872626",
"0.4273992",
"0.4273992",
"0.42737192",
"0.42673162",
"0.42673162",
"0.42662525",
"0.4260223",
"0.42541558",
"0.4248916",
"0.42488736",
"0.42395335",
"0.4235614",
"0.4235614",
"0.42344084",
"0.4231255",
"0.42274466",
"0.4224187",
"0.42225465",
"0.42148942",
"0.42135286",
"0.42128786",
"0.4207856",
"0.42066827",
"0.42049956",
"0.4198939",
"0.41920254",
"0.41909468",
"0.41858542",
"0.4184132",
"0.4183357",
"0.41830438",
"0.41803735",
"0.41751555"
] | 0.61751086 | 0 |
Returns the environment from the node config hash, or 'production' if it is nil or empty. | def node_environment(node_config)
env = node_config['environment']
(env.nil? || env.empty?) ? 'production' : env
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_environment\n if node['ingenerator'] && node['ingenerator']['node_environment']\n node['ingenerator']['node_environment'].to_sym\n else\n :production\n end\n end",
"def environment\n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\"\n end\nend",
"def environment\n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\"\n end\nend",
"def environment \n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env \n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\" \n end\nend",
"def get_environment ()\n service_data = query_for_services()\n return service_data[\"environment\"]\n end",
"def pdb_get_environment(facts)\n if facts.is_a?(Hash) && !facts['trusted'].nil? && !facts['trusted']['value'].nil? && !facts['trusted']['value']['extensions'].nil? && !facts['trusted']['value']['extensions']['pp_environment'].nil?\n environment = facts['trusted']['value']['extensions']['pp_environment']\n Puppet.info(\"#{log_prefix} puppet environment for node is: environment=#{environment}\")\n environment\n else\n \"Unknown\"\n end\n end",
"def default_environment_name\n return nil unless config?\n config.default_environment\n end",
"def env_str\n @env_str ||= begin\n env = Rails.env\n env.include?('production') ? '' : env\n end\n end",
"def env_str\n @env_str ||= begin\n env = Rails.env\n env.include?('production') ? '' : env\n end\n end",
"def get_env(format, app, node = self.node)\n return '' unless node.attribute?(app)\n\n if node[app]['env'].nil?\n Chef::Log.info(\"Attribute 'env' for application '#{app}' is not defined!\")\n return ''\n end\n\n appenv = streamline_appenv(node[app]['env'])\n generate_config_part(format, 'settings', appenv)\n end",
"def railsenv\n config['environment_variables']['RAILS_ENV'] || 'production'\nend",
"def environment\n if defined?(Rails) && Rails.respond_to?(:env)\n Rails.env.to_s\n else\n ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['ENV'] || 'development'\n end\n end",
"def environment\n environment = 'development'\n\n if ARGV.last.match(/(development|production)/)\n environment = ARGV.last\n end\n \n return environment\nend",
"def environment(environment=nil)\n @environment ||= environment_from_app(environment) || 'development'\n end",
"def env\n env = job[:env]\n env = env - (config[:env].is_a?(Hash) && config[:env][:global] || []) if env\n env = env - config[:global_env] if config[:global_env].is_a?(Array)\n env\n end",
"def env\n config.env\n end",
"def env\n config.env\n end",
"def environment\n node.environment\n end",
"def environment\n @environment || DEFAULT_ENVIRONMENT\n end",
"def environ\n case environment\n when 'production' then :prd\n when 'staging' then :stg\n when 'test' then :tst\n when 'development' then :dev\n end\n end",
"def env\n if defined? @@env and @@env\n @@env\n elsif ENV['SASYNC_ENV']\n ENV['SASYNC_ENV']\n else\n if defined? Rails\n Rails.env\n else\n ENV['SASYNC_ENV'] || 'production'\n end\n end\n end",
"def getEnvVar\n if ENV['ENV'].nil?\n UI.user_error!(\"No 'ENV' environment variable set. Set it using `awsenv` config file. Must contain 'dev', 'qa' or 'prod' in value.\")\n end\n\n env_raw = /(dev|qa|prod)/.match(ENV.fetch('ENV', nil))[1]\n UI.important(\"ENVIRONMENT: #{env_raw}\")\n\n if env_raw.nil? || env_raw.length == 0\n UI.user_error!(\"Your 'ENV' environment variable is set but doesn't contain 'dev', 'qa' or 'prod' as value.\")\n end\n\n return env_raw\nend",
"def env\n unless defined?(@environment)\n self.env = DEFAULT_ENVIRONMENT\n end\n\n @environment\n end",
"def env(key) \n str = key.to_s \n env?(str) ? ENV[str] : nil\n end",
"def environment(name = nil)\n name = default_environment_name unless name\n known_environments.find { |env| env.match_name?(name) }\n end",
"def env\n return :development unless @env\n @env\n end",
"def env\n @env ||= ENV['RACK_ENV'].present? ? ENV['RACK_ENV'].to_sym : :development\n end",
"def autodetect_environment\n rails_env = if defined?(::Rails) && ::Rails.respond_to?(:env)\n ::Rails.env.to_s\n elsif defined?(::RAILS_ENV)\n ::RAILS_ENV.to_s\n end\n \n LIVE_RAILS_ENVIRONMENTS.include?(rails_env) ? 'live' : 'test'\n end",
"def env(key)\n if key.nil?\n nil\n elsif override_env.present?\n override_env[key]\n else\n ENV[key]\n end\n end",
"def get_env(name)\n ENV[name] || ENV[name.downcase] || ENV[name.upcase] || nil\n end",
"def env\n env_hash = {}\n env_hash[\"NODE_PATH\"] = asset_paths unless uses_exorcist\n env_hash[\"NODE_ENV\"] = config.node_env || Rails.env\n env_hash\n end",
"def env\n if defined? @@env and @@env\n @@env\n elsif ENV['SASYNC_ENV']\n ENV['SASYNC_ENV']\n else\n if defined? Rails\n Rails.env\n else\n ENV['SASYNC_ENV'] || 'production'\n end\n end\n end",
"def environment\n ENV['CLOUDTASKER_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n end",
"def pseudo_env\n ENV[\"PSEUDO_PRODUCTION_ENV\"]&.inquiry || Rails.env\n end",
"def environment\n @options.fetch(:environment, 'production')\n end",
"def environment\n @environment ||= ActiveSupport::StringInquirer.new(app.environment.to_s)\n end",
"def env_config\n @env_config ||= {}\n end",
"def default_environment\n return nil unless default_environment_name\n environment(default_environment_name)\n end",
"def environment\n self.config[:environment] || :development\n end",
"def env\n Thread.current[ENVIRONMENT] or raise(\"no env in scope\")\n end",
"def rails_env\n return ::Rails.env.to_s if defined?(::Rails.env)\n return RAILS_ENV.to_s if defined?(RAILS_ENV)\n nil\n end",
"def get_environment\n VanagonLogger.info <<-WARNING.undent\n #get_environment is deprecated; environment variables have been moved\n into the Makefile, and should not be used within a Makefile's recipe.\n The #get_environment method will be removed by Vanagon 1.0.0.\n WARNING\n\n if environment.empty?\n \": no environment variables defined\"\n else\n environment_variables\n end\n end",
"def env\n @env ||= ActiveSupport::StringInquirer.new(ENV[\"CASSANDRA_ENV\"] || ENV[\"RACK_ENV\"] || \"development\")\n end",
"def detect_env\n @environments.find{|env_name,proc|\n instance_eval(&proc)\n } \n end",
"def env\n @_env ||= ActiveSupport::EnvironmentInquirer.new(ENV[\"RAILS_ENV\"].presence || ENV[\"RACK_ENV\"].presence || \"development\")\n end",
"def env(key)\n if key.nil?\n nil\n else\n ENV[key]\n end\n end",
"def env\n defined?(Rails) ? Rails.env.to_sym : @env\n end",
"def environments\n fetch(:environments, nil) || [fetch(:environment, 'production')]\n end",
"def env\n ENV[\"RACK_ENV\"] || ENV[\"RAILS_ENV\"] || \"development\"\n end",
"def env\n return Rails.env if defined?(Rails) && defined?(Rails.env)\n\n # https://github.com/rails/rails/blob/1ccc407e9dc95bda4d404c192bbb9ce2b8bb7424/railties/lib/rails.rb#L67\n @env ||= ActiveSupport::StringInquirer.new(\n ENV['RAILS_ENV'].presence || ENV['RACK_ENV'].presence || 'development'\n )\n end",
"def environment\n\n return @environment || :development\n\n end",
"def environment\n ENV['RACK_ENV'] || 'development'\n end",
"def environment_name\n return @environment_name if @environment_name.is_a? String\n if ENV['EY_ENVIRONMENT_NAME']\n @environment_name = ENV['EY_ENVIRONMENT_NAME']\n elsif engine_yard_cloud_api.possible_to_detect_environment_from_git_config?\n @environment_name = engine_yard_cloud_api.environment_name\n end\n raise RuntimeError, \"[engineyard-metadata gem] You need to run this from the application repo, set EY.metadata.environment_name= or set ENV['EY_ENVIRONMENT_NAME']\" unless @environment_name.to_s.strip.length > 0\n @environment_name\n end",
"def env_or_config(variable, default=(no_default_set=true; nil))\n # Make sure the configured configuration is loaded, if possible\n init\n\n # Environment variables for known options override environment specific\n # options, too\n env_var = var_from_env(variable, default)\n if env_var != default\n return env_var\n end\n\n if self.has_env?(variable)\n return self.env(variable)\n elsif self.has_config?(variable)\n return self.config(variable)\n else\n if no_default_set == true\n raise \"Unknown environment or configuration variable '(#{@env}.)#{variable}' and no default given\"\n end\n return default\n end\n end",
"def get_env(name)\n ENV[name]\n end",
"def current_environment\n ENV['RUBY_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n end",
"def environment\n @environment ||= ENV['HUBBLE_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n end",
"def get_environment\n if @environment.empty?\n \":\"\n else\n env = @environment.map { |key, value| %(#{key}=\"#{value}\") }\n \"export #{env.join(' ')}\"\n end\n end",
"def get_environment\n\n fetch_environment || get_expression_pool.fetch_engine_environment\n end",
"def config\n @config ||= YAML.load_file(config_file)[environment]\n end",
"def environment\n \"production\"\n end",
"def environment\n verify_environment\n ENV['ENV']\nend",
"def env\n # Look for a GAMEWORK_ENV constant\n _env = Object.const_defined?('GAMEWORK_ENV') && GAMEWORK_ENV\n # otherwise default to 'development'\n @env ||= ActiveSupport::StringInquirer.new(_env || 'development')\n end",
"def get_root_environment\n\n fetch_environment.get_root_environment\n end",
"def container_env(engine)\n env = if @cluster.env_variables['PLATFORM'].include?('aws')\n {\n 'KUBECONFIG' => '/kubeconfig',\n\n 'BRIDGE_AUTH_USERNAME' => @cluster.config_file.admin_credentials[0],\n 'BRIDGE_AUTH_PASSWORD' => @cluster.config_file.admin_credentials[1],\n 'BRIDGE_BASE_ADDRESS' => 'https://' + @cluster.tectonic_console_url,\n 'BRIDGE_BASE_PATH' => '/'\n }\n else\n {\n 'KUBECONFIG' => '/kubeconfig',\n\n 'BRIDGE_AUTH_USERNAME' => @cluster.tectonic_admin_email,\n 'BRIDGE_AUTH_PASSWORD' => @cluster.tectonic_admin_password,\n 'BRIDGE_BASE_ADDRESS' => 'https://' + @cluster.tectonic_console_url,\n 'BRIDGE_BASE_PATH' => '/'\n }\n end\n\n return env.map { |k, v| \"-e #{k}='#{v}'\" }.join(' ').chomp if engine == 'docker'\n return env.map { |k, v| \"--set-env #{k}='#{v}'\" }.join(' ').chomp if engine == 'rkt'\n raise 'unknown container engine'\n end",
"def environment\n options['environment'] || :development\n end",
"def environment(override = nil)\n override || @environment || autodetect_environment\n end",
"def myservices_environment_details_host\n ENV['ENV_DETAILS'].nil? ? 'esu2v871:9080' : ENV['ENV_DETAILS']\n end",
"def env\n legacy_env || app_env\n end",
"def is_production?\n %w(prod production).include?(node.chef_environment)\n end",
"def environment\n @environment ||= nil\n end",
"def env\n site.env\n end",
"def get_config(name, default)\n return ENV[name].nil? ? default : ENV[name]\nend",
"def default_environment\n nil\n end",
"def env=(value)\n if value == 'auto'\n value = if in_rails?\n Rails.env\n else\n \"production\"\n end\n end\n\n @environment = value.to_s == 'production' ? 'production' : 'development'\n end",
"def get_env(name)\n @ant.instance_eval(\"@env_%s\" % name)\n end",
"def load_env(environment=nil)\n environment ||= \"production\"\n load_dot_env \".env\" if environment == \"production\"\n load_dot_env \".env.#{environment}\"\nend",
"def get_acceptance_environment\n DeliveryGolang::Helpers.get_acceptance_environment(node)\n end",
"def default_puppet_env_name\n ENV['PUPPET_ENV'] || Puppet[:environment]\n end",
"def default_puppet_env_name\n ENV['PUPPET_ENV'] || Puppet[:environment]\n end",
"def environment_name(url = nil)\n url ||= self.url\n uri = URI(url)\n\n if (uri.host == 'localhost')\n if uri.port.nil?\n uri.host;\n else\n \"#{uri.host}:#{uri.port}\"\n end\n else\n name = case uri.host\n when /(?:origin-)?www\\d?(?:\\.pos)?(?:\\.siteb)?\\.([^\\.]+)(?:\\.fds)?\\.com/,\n /(?:m|m2qa1|mdev1|mockmacys|local)\\.([^\\.]+)(?:\\.fds)?\\.com/, # mobile env\n /([^\\.]+)\\.\\w+\\.\\w+\\.griddynamics\\.net/, # partial env\n /([^\\.]+)\\.stage2\\.cistages\\.fds/, # stage 2 env\n /([^\\-]+)-staging.bloomingdales\\.com/, #BCOM Heroku Staging Env\n /([^\\.]+).bloomingdales\\.com/, #BCOM Heroku Production Env\n /([^\\.]+)\\.cistages\\.fds/,\n /([^\\.]+)\\.macysbackstage\\.com/,\n /([^\\.]+)\\.herokuapp\\.com/,\n /([^\\.]+)\\.c4d\\.devops\\.fds\\.com/,\n /sstportal/\n Regexp.last_match.captures.first\n else\n raise URI::InvalidURIError, \"URI was not recognized: '#{url}'.\"\n end\n name\n end\n end",
"def env\n image = options[:image] || app\n config = api.get_config_vars(app).body\n\n config.keys.sort.each do |key|\n puts \"#{key}=#{config[key]}\"\n end\n end",
"def environments\n @environments ||= [:production]\n end",
"def env_config; end",
"def env_config; end",
"def env_config; end",
"def env_config; end",
"def target_environment\n return unless application = applications.first\n application.split(\"-\").first\n end",
"def app_env\n @_app_env ||= PlatformAPI.connect_oauth(heroku_api_key).config_var.info_for_app(app_name)\n end",
"def environment(env = File.basename($0, '.*'))\n env = ENV[env] || ENV[env.upcase] or return\n require 'shellwords'\n parse(*Shellwords.shellwords(env))\n end",
"def get_environments_layout\n @environment.present? ? \"environment\" : \"application\"\n end",
"def config_for(environment=:development)\n if self.config.present?\n env_config = self.config[environment.to_s]\n else\n env_config = {\n 'host' => ENV['RIAK_HOST'],\n 'http_port' => ENV['RIAK_HTTP_PORT'],\n 'pb_port' => ENV['RIAK_PB_PORT']\n }\n end\n env_config\n end",
"def get_env_mappings()\n {\n 'prd' => 'production',\n 'prv' => 'preview',\n 'rev' => 'review',\n 'stg' => 'staging',\n 'qa' => 'qa',\n 'dev' => 'development',\n 'dvp' => 'devops',\n }\nend",
"def get_env(key)\n\n end",
"def config_file\n env_config['config_file'] || raise('environment problem:environment information not loaded')\n end",
"def environment\n return @vars unless @vars.nil?\n\n # If not set, Try to find them...\n glob_path = File.join(@deployment_home, @settings.env_file_glob_path)\n regexp_find = glob_path.gsub(/\\*/, '(.*)')\n Dir[glob_path].each do | file_name |\n # Get the environment name from the file part of the glob path:\n # e.g. given ./environments/ci_mgt/kb8or.yaml\n # get ci_mgt from ./environments/*/kb8or.yaml\n /#{regexp_find}/.match(file_name)\n env_name = $1\n if env_name == @env_name\n debug \"env=#{env_name}\"\n # Ensure we set the defaults as vars BEFORE we add environment specifics:\n @vars = @settings.defaults\n env_vars = Context.resolve_env_file(file_name)\n @vars = @vars.merge(env_vars)\n @vars = @vars.merge(@overridden_vars)\n @vars['env'] = env_name\n @environment_file = file_name\n break\n end\n end\n # Now finaly, update the settings now we know the environment!\n unless @vars\n @vars = {}\n end\n @settings = @settings.new(@vars)\n update_k8context\n debug \"vars=#{vars}\"\n @vars\n end",
"def env\n @env || {}\n end",
"def delivery_environment(node)\n if is_change_loaded?(node)\n if node['delivery']['change']['stage'] == 'acceptance'\n get_acceptance_environment(node)\n else\n node['delivery']['change']['stage']\n end\n end\n end",
"def delivery_environment(node)\n if node['delivery']['change']['stage'] == 'acceptance'\n get_acceptance_environment(node)\n else\n node['delivery']['change']['stage']\n end\n end",
"def golang_environment\n DeliveryGolang::Helpers.golang_environment(node)\n end"
] | [
"0.7434109",
"0.729148",
"0.729148",
"0.722927",
"0.69439954",
"0.6834882",
"0.6802396",
"0.67666334",
"0.67666334",
"0.67045647",
"0.6703618",
"0.66951555",
"0.6649619",
"0.6637568",
"0.6636658",
"0.66002995",
"0.66002995",
"0.65810573",
"0.65581447",
"0.64899784",
"0.64612097",
"0.64469904",
"0.6446711",
"0.6421136",
"0.6380433",
"0.6377067",
"0.6372109",
"0.63699657",
"0.6365881",
"0.63488925",
"0.6348321",
"0.63367635",
"0.63228077",
"0.63222533",
"0.63165814",
"0.63113815",
"0.6296533",
"0.62843835",
"0.62699276",
"0.62669396",
"0.62620014",
"0.6246036",
"0.6225284",
"0.6216411",
"0.620076",
"0.6199169",
"0.6192584",
"0.6168532",
"0.61314845",
"0.61314636",
"0.61229473",
"0.6105821",
"0.60931814",
"0.6086553",
"0.606688",
"0.6064687",
"0.60606724",
"0.6050821",
"0.6044865",
"0.6030941",
"0.602867",
"0.60216975",
"0.60075533",
"0.6006495",
"0.5995508",
"0.5987104",
"0.5954143",
"0.5935241",
"0.59215665",
"0.5914531",
"0.59139633",
"0.58990365",
"0.5884186",
"0.58763754",
"0.5871302",
"0.5868871",
"0.58467263",
"0.58416367",
"0.58369535",
"0.58369535",
"0.58336955",
"0.5824585",
"0.5816877",
"0.58060825",
"0.58060825",
"0.58060825",
"0.58060825",
"0.5802523",
"0.57977057",
"0.57874185",
"0.5785209",
"0.578253",
"0.57682467",
"0.5753292",
"0.5753018",
"0.5749752",
"0.5747177",
"0.57388276",
"0.5732303",
"0.57133037"
] | 0.83173084 | 0 |
Group the list of node configs into a hash keyed by their environments. A nil or empty environment will be interpreted as 'production'. | def group_by_environment(node_configs)
node_configs.group_by do |config|
node_environment(config)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modules_per_environment(node_configs)\n node_configs = group_by_environment(node_configs)\n modules = node_configs.map do |env, configs|\n [env, configs.map { |c| c['modules'] }.flatten.uniq]\n end\n Hash[modules]\nend",
"def environments\n environment_config.keys\n end",
"def environments\n fetch(:environments, nil) || [fetch(:environment, 'production')]\n end",
"def all_environments\n environments = apps.each_with_object([]) do |(app, hsh), arr|\n hsh.each { |env, app_name| arr << env }\n end\n environments.uniq\n end",
"def environments\n @environments ||= [:production]\n end",
"def get_env_mappings()\n {\n 'prd' => 'production',\n 'prv' => 'preview',\n 'rev' => 'review',\n 'stg' => 'staging',\n 'qa' => 'qa',\n 'dev' => 'development',\n 'dvp' => 'devops',\n }\nend",
"def environments\n _get(\"/system/environments\") { |json| json }\n end",
"def envs_details\n current_envs = {}\n show_envs.each do |e|\n z = Pem::Env.new(e, self)\n current_envs[e] = z.mods\n end\n\n current_envs\n end",
"def canonicalize_environments(manifest)\n canonicalize_key(manifest, :environments) do |environments|\n Hash[\n environments.map do |key, environment|\n [key, canonicalize(environment)]\n end\n ]\n end\n end",
"def envs_details\n current_envs = {}\n show_envs.each do |e|\n z = PemEnv.new(e, self)\n current_envs[e] = z.mods\n end\n\n current_envs\n end",
"def build_environment_hash\n parsed_variables = {}\n @env.each do |env_row|\n # Each row can potentially contain multiple environment\n # variables\n variables = extract_variables(env_row)\n\n variables.each do |variables_with_values|\n variables_with_values.each do |key, value|\n parsed_variables[key] = value\n end\n end\n end\n\n @override_envs.each do |env|\n parsed_variables = parsed_variables.merge env\n end\n\n parsed_variables\n end",
"def node_environment(node_config)\n env = node_config['environment']\n (env.nil? || env.empty?) ? 'production' : env\nend",
"def known_environments\n return [] unless config?\n config.environments.map { |name, _| environments.find_or_create_by!(name: name) }\n end",
"def matched_configs\n [@full_config['environments'][environment], @full_config['nodes'][fqdn]]\n end",
"def names\n envs.map { |config| config.name }\n end",
"def environment_names\n @environment_names ||= [nil] + env.tags.collect {|name, tag| tag['environment']}.compact\n end",
"def environments\n Environment.list\n end",
"def load!\n configs = {}\n @array.each_with_index do |obj, idx|\n next unless obj.start_with?('--' + @env_prefix)\n\n value = extract_value(obj, idx + 1)\n key = obj.split('=').first\n .sub(/^--#{@env_prefix}_?/, '')\n .downcase.split('__')\n recursive_set(configs, key, split_env_string(value))\n end\n configs\n end",
"def environments\n requires :label, :application_name\n service.environments.all({\n 'ApplicationName' => application_name,\n 'VersionLabel' => label\n })\n end",
"def app_environments(env_filter=\"\")\n apps.each_with_object([]) do |(app, hsh), arr|\n hsh.each { |env, app_name| arr << self.class.app_name(app, env) if (env_filter.nil? || env_filter.empty?) || env == env_filter }\n end\n end",
"def app_environments\n @app_environments ||= apps.map { |app| app.app_environments }.flatten\n end",
"def generic_envs\n\t\t\treturn [\"production\", \"sandbox\"]\n\t\tend",
"def env_config\n @env_config ||= {}\n end",
"def environment_hash\n @environment_hash ||= build_environment_hash\n end",
"def environments; end",
"def environments(*args)\n @environments = args.map{|arg| arg.to_sym }\n end",
"def node_environment\n if node['ingenerator'] && node['ingenerator']['node_environment']\n node['ingenerator']['node_environment'].to_sym\n else\n :production\n end\n end",
"def application_environment\n {\n infra: {\n provider: cluster.config.provider,\n },\n platform: {\n feature_set: current_feature_set,\n infra: {\n resources: {\n storage: {\n buckets:\n infra.settings.components.object_storage.components.each_with_object({}) do |(name, config), hash|\n hash[name] = Hash.new\n hash[name]['name'] = \"#{name}-#{bucket_base}\"\n config.to_hash.reject { |key| key.eql?(:services) }.each_pair { |key, value| hash[name][key] = value }\n end,\n services:\n infra.settings.components.object_storage.components.each_with_object({}) do |(name, config), hash|\n config.services.each do |dir|\n hash[dir] = \"#{name}\"\n end\n end\n },\n cdns: infra.settings.components.cdn.components.to_hash\n }\n }\n }\n }\n end",
"def all_environments\n envs = []\n find('').sort.each do |file|\n envs << File.basename(file)\n end\n envs\n end",
"def environment *environments, &block\n old = @environments.dup\n @environments.concat environments.map { |e| e.to_s }\n\n begin\n yield\n ensure\n @environments = old\n end\n end",
"def env_hash\n hash = {}\n request.env.each do |key, value|\n hash[key] = value if key =~ /^(HTTP|REQUEST|REMOTE).*/\n end\n puts hash.to_s\n hash\n end",
"def environment *environments, &block\n old = @environments\n @environments = @environments.dup.concat environments.map { |e| e.to_s }\n\n instance_eval(&block)\n ensure\n @environments = old\n end",
"def implied_environments\n []\n end",
"def environments\n env_path = File.join(@path, \"config/deploy/*.rb\")\n Dir[env_path].map { |path| File.basename(path, \".*\") }\n end",
"def smash_configs\n # private overrides public general config\n a = remove_environments(@general_config_pub)\n b = remove_environments(@general_config_priv)\n general = a.merge(b)\n\n # private overrides public collection config\n c = remove_environments(@collection_config_pub)\n d = remove_environments(@collection_config_priv)\n collection = c.merge(d)\n\n # collection overrides general config\n return general.merge(collection)\n end",
"def build_hosts_list(env_vms)\n\n int_id = 10\n\n first = true\n env_vms.each do |vm, vmconfig|\n vmconfig[\"networks\"].each do |name, netcfg|\n if netcfg[\"type\"] == \"private\" then\n if netcfg['ip'].nil? then\n netcfg['ip'] = \"192.168.50.\" + int_id.to_s\n #add the default IP to the environment definnition\n env_vms[vm][\"networks\"][name][\"ip\"] = \"192.168.50.\" + int_id.to_s\n int_id += 1\n end\n if first then\n $base_vars = \"vms_hosts={\"\n $base_vars << \"\\\"#{netcfg['ip']}\\\":\\\"#{vm}\\\"\"\n first = false\n elsif\n $base_vars << \",\\\"#{netcfg['ip']}\\\":\\\"#{vm}\\\"\"\n end\n end\n end if vmconfig[\"networks\"]\n end\n $base_vars << \"}\" if $base_vars\nend",
"def env\n env = super || {}\n\n env[:QUEUE] ||= queue\n env[:JOBS_PER_FORK] ||= jobs_per_fork if jobs_per_fork\n env[:MINUTES_PER_FORK] ||= minutes_per_fork if minutes_per_fork\n env[:SHUFFLE] ||= 1 if shuffle\n\n Hash[env.map { |k, v| [k, v.to_s] }]\n end",
"def environment_variables\n global_variables = @config.environment_variables\n process_vars = @config.process_options[@name] ? @config.process_options[@name]['env'] || {} : {}\n process_local_vars = @config.local_process_options[@name] ? @config.local_process_options[@name]['env'] || {} : {}\n global_variables.merge(process_vars.merge(process_local_vars)).each_with_object({}) do |(key, value), hash|\n hash[key.to_s] = value.to_s\n end\n end",
"def env\n env_hash = {}\n env_hash[\"NODE_PATH\"] = asset_paths unless uses_exorcist\n env_hash[\"NODE_ENV\"] = config.node_env || Rails.env\n env_hash\n end",
"def host_port_map\n Dir[Ros.deployments_dir].each_with_object([]) do |file, ary|\n name = File.basename(file).gsub('.yml', '')\n Ros.load_env(name)\n infra_type = Settings.meta.components.provider.split('/').last\n if infra_type.eql? 'instance'\n ary.append({ host: Settings.infra.endpoint.host, port: Settings.platform.nginx_host_port })\n end\n end\n end",
"def combined_host_tags\n # Combine (union) all arrays. Removes duplicates if found.\n node_env.split | node_roles | node_policy_tags | node_tags\n end",
"def groups(*groups)\n hash = groups.extract_options!\n env = Rails.env\n groups.unshift(:default, env)\n groups.concat ENV[\"RAILS_GROUPS\"].to_s.split(\",\")\n groups.concat hash.map { |k, v| k if v.map(&:to_s).include?(env) }\n groups.compact!\n groups.uniq!\n groups\n end",
"def environ\n case environment\n when 'production' then :prd\n when 'staging' then :stg\n when 'test' then :tst\n when 'development' then :dev\n end\n end",
"def aggregate_missing_env_vars\n example_env_vars.inject([]) do |array, key_and_value|\n key = key_and_value[0]\n\n begin\n ENV.fetch(key)\n array\n rescue KeyError\n array << key\n end\n end\n end",
"def nodes_for_environment(name)\n ridley.partial_search(:node, \"chef_environment:#{name}\", [\"fqdn\", \"cloud.public_hostname\", \"name\", \"os\"])\n end",
"def stack(app_env)\n name, env = app_env.split(SEPARATOR)\n stack = settings['stack'] || {}\n (stack[name] && stack[name][env]) || stack['all']\n end",
"def domains(app_env)\n name, env = app_env.split(SEPARATOR)\n domains = self.settings['domains'] || {}\n domains_from_app_config = (domains[name] && domains[name][env]) || []\n domains_from_global_config = (domains['all'] && domains['all'][env]) || []\n\n domains_from_app_config + domains_from_global_config\n end",
"def config\n config = {}\n config['recipes'] = []\n config['recipes'] |= hash_path(@default_config, 'recipes', 'global') || []\n config['recipes'] |= hash_path(@default_config, 'recipes', @platform) || []\n @group_configs.each do |group_name, group_config|\n config['recipes'] |= hash_path(group_config, 'recipes', 'global') || []\n config['recipes'] |= hash_path(group_config, 'recipes', @platform) || []\n end\n people_recipes = @people_config['recipes'] || {}\n config['recipes'] |= people_recipes['global'] || []\n config['recipes'] |= people_recipes[@platform] || []\n config['attributes'] = {}\n config['attributes'].deep_merge!(@default_config['attributes'] || {}) { |key, old, new| Array.wrap(old) + Array.wrap(new) }\n @group_configs.each do |group_name, group_config|\n config['attributes'].deep_merge!(group_config['attributes']) { |key, old, new| Array.wrap(old) + Array.wrap(new) } unless group_config['attributes'].nil?\n end\n people_attributes = @people_config['attributes'] || {}\n config['attributes'].deep_merge!(people_attributes) { |key, old, new| Array.wrap(old) + Array.wrap(new) }\n config\n end",
"def env_values\n @parse[@env] || @parse[@env.to_s] || {}\n end",
"def environment\n @env_vars ||= VARS.reduce({}) do |hash, (key, value)|\n hash.merge(\"#{prefix}_#{value}\" => send(key))\n end.merge(env)\n end",
"def obtain_tenant_environments\n envs = Array.new\n chef_api_connect.search.query(:environment, 'tenant_environment:*', start: 0).rows.each do |environ|\n if environ['default_attributes']['fconfig']['tenant_environment'] == \"true\"\n envs << environ['name']\n end\n end\n return envs\nend",
"def environment_variables\n return [] unless options[\"environment_variables\"]\n options[\"environment_variables\"].map do |options|\n EnvironmentVariable.new options\n end\n end",
"def nodes_like_me\n nodes[:environment => @node.environment]\n end",
"def dfs(n)\n case n\n when Hash\n n.each do |k,v|\n @stack.push k\n dfs(v)\n @stack.pop\n end\n else\n stripped = Array.new(@stack)\n stripped.shift #strip off the :development or :production tag\n if @stack.first == @environment\n @env_vars[stripped.join('__').upcase] = n\n end\n tmp = Array.new(@stack).push \"<%= ENV['#{stripped.join('__').upcase}'] %>\"\n @new_config.deep_merge!(tmp.reverse.inject { |mem, var| {var => mem}})\n end\nend",
"def environment\n return @vars unless @vars.nil?\n\n # If not set, Try to find them...\n glob_path = File.join(@deployment_home, @settings.env_file_glob_path)\n regexp_find = glob_path.gsub(/\\*/, '(.*)')\n Dir[glob_path].each do | file_name |\n # Get the environment name from the file part of the glob path:\n # e.g. given ./environments/ci_mgt/kb8or.yaml\n # get ci_mgt from ./environments/*/kb8or.yaml\n /#{regexp_find}/.match(file_name)\n env_name = $1\n if env_name == @env_name\n debug \"env=#{env_name}\"\n # Ensure we set the defaults as vars BEFORE we add environment specifics:\n @vars = @settings.defaults\n env_vars = Context.resolve_env_file(file_name)\n @vars = @vars.merge(env_vars)\n @vars = @vars.merge(@overridden_vars)\n @vars['env'] = env_name\n @environment_file = file_name\n break\n end\n end\n # Now finaly, update the settings now we know the environment!\n unless @vars\n @vars = {}\n end\n @settings = @settings.new(@vars)\n update_k8context\n debug \"vars=#{vars}\"\n @vars\n end",
"def <<(*environments)\n environments.flatten!\n environments.each do |env|\n env_name = (env.respond_to? :name) ? env.name : nil\n envs << env unless name? env_name\n end\n envs.count\n end",
"def env_keys\n mapping.values\n end",
"def config_from_env\n CONFIGURABLE_WITH_ENV.each_with_object({}) do |option, env_vars|\n if value = option_from_env(option)\n env_vars[option] = value\n end\n end\n end",
"def app_config\n {\n env: Rails.env,\n host: ENV[\"RENDER_EXTERNAL_URL\"],\n veue: {\n env: ENV[\"VEUE_ENV\"] || \"dev\",\n revision: ENV[\"RENDER_GIT_COMMIT\"] || `git rev-parse HEAD`,\n branch: ENV[\"RENDER_GIT_BRANCH\"] || `git branch --show-current`,\n },\n service: {\n id: ENV[\"RENDER_SERVICE_ID\"],\n name: ENV[\"RENDER_SERVICE_NAME\"],\n pod: ENV[\"RENDER_POD_NAME\"],\n },\n appsignal: {\n key: ENV[\"APPSIGNAL_FRONTEND_KEY\"],\n },\n }\n end",
"def environment_as_hash\n returning Hash.new do |h|\n ENV.keys.each do |k|\n if k && k =~ /:/\n h[k] = ENV[k].split ':'\n else\n h[k] = ENV[k]\n end\n end\n end\nend",
"def for_the(environment)\n begin\n settings = @configuration_data[environment.to_s] || raise\n \n settings_hash = {}\n settings.each_key { |key| settings_hash[key.intern] = settings[key]}\n settings_hash\n rescue\n raise NoEnvironmentError, \"Can't find \\\"#{environment}\\\" section in config.\"\n end \n end",
"def environment \n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env \n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\" \n end\nend",
"def env\n image = options[:image] || app\n config = api.get_config_vars(app).body\n\n config.keys.sort.each do |key|\n puts \"#{key}=#{config[key]}\"\n end\n end",
"def environment\n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\"\n end\nend",
"def environment\n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\"\n end\nend",
"def container_env(engine)\n env = if @cluster.env_variables['PLATFORM'].include?('aws')\n {\n 'KUBECONFIG' => '/kubeconfig',\n\n 'BRIDGE_AUTH_USERNAME' => @cluster.config_file.admin_credentials[0],\n 'BRIDGE_AUTH_PASSWORD' => @cluster.config_file.admin_credentials[1],\n 'BRIDGE_BASE_ADDRESS' => 'https://' + @cluster.tectonic_console_url,\n 'BRIDGE_BASE_PATH' => '/'\n }\n else\n {\n 'KUBECONFIG' => '/kubeconfig',\n\n 'BRIDGE_AUTH_USERNAME' => @cluster.tectonic_admin_email,\n 'BRIDGE_AUTH_PASSWORD' => @cluster.tectonic_admin_password,\n 'BRIDGE_BASE_ADDRESS' => 'https://' + @cluster.tectonic_console_url,\n 'BRIDGE_BASE_PATH' => '/'\n }\n end\n\n return env.map { |k, v| \"-e #{k}='#{v}'\" }.join(' ').chomp if engine == 'docker'\n return env.map { |k, v| \"--set-env #{k}='#{v}'\" }.join(' ').chomp if engine == 'rkt'\n raise 'unknown container engine'\n end",
"def environments(host, port)\n uri = URI::HTTP.build(host: host, port: port, path: '/environments')\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n response = http.get(uri.path, \"Accept\" => \"application/json\")\n end",
"def env\n env = job[:env]\n env = env - (config[:env].is_a?(Hash) && config[:env][:global] || []) if env\n env = env - config[:global_env] if config[:global_env].is_a?(Array)\n env\n end",
"def config(app_env)\n name, env = app_env.split(SEPARATOR)\n config = self.settings['config'] || {}\n all = config['all'] || {}\n\n app_configs = (config[name] && config[name].reject { |k,v| v.class == Hash }) || {}\n # overwrite app configs with the environment specific ones\n merged_environment_configs = app_configs.merge((config[name] && config[name][env]) || {})\n\n # overwrite all configs with the environment specific ones\n all.merge(merged_environment_configs)\n end",
"def config(app_env)\n config = self.settings['config'] || {}\n all = config['all'] || {}\n\n # overwrite all configs with the environment specific ones\n all.merge(config[app_env] || {})\n end",
"def stack(app_env)\n stacks = self.settings['stacks'] || {}\n stacks[app_env] || stacks['all']\n end",
"def default_environment_variables\n environment_variables.select &:default\n end",
"def config_for(environment=:development)\n if self.config.present?\n env_config = self.config[environment.to_s]\n else\n env_config = {\n 'host' => ENV['RIAK_HOST'],\n 'http_port' => ENV['RIAK_HTTP_PORT'],\n 'pb_port' => ENV['RIAK_PB_PORT']\n }\n end\n env_config\n end",
"def deploy_order_by_group\n step =0\n deployement_step = compute_role_deployement_step\n deployement_host_step = []\n while @env.length >0 do\n deployement_host_step[step]=[]\n deployement_host_step[step+1]=[]\n nb_machine_before = @env.length\n #pp \" @env length before #{@env.length}\"\n\n @env.each { |name, node|\n list_role = node[:roles] ? node[:roles]: []\n\n if list_role.length == 0 then\n @env.delete(name)\n next\n end\n\n nb_role_choosen = 0\n\n list_role.each { |role|\n # pick the role\n if !deployement_step[step][role].nil? and deployement_step[step][role] > 0 then\n nb_role_choosen = nb_role_choosen + 1\n else\n break\n end\n }\n\n if nb_role_choosen == list_role.length and list_role.length !=0 then\n # all roles statified, add machine to the step et delete her from the list_role\n deployement_host_step[step].push(name)\n @env.delete(name)\n #pp \"DELETE HOST #{name}\"\n # solder deployed\n list_role.each { |role|\n deployement_step[step][role] = deployement_step[step][role] - 1\n }\n end\n }\n # verify if roles remains , if it's true, add them to the next step\n deployement_step[step].each { |role, number|\n if number > 0 then\n if deployement_step[step+1].nil? then\n deployement_step[step+1] = {}\n end\n deployement_step[step+1][role] = deployement_step[step+1][role].nil? ? number : deployement_step[step+1][role] + number\n end\n }\n #pp \" @env length after #{@env.length}\"\n nb_machine_after = @env.length\n step = step + 1\n if nb_machine_before == nb_machine_after then\n break\n end\n end\n return deployement_host_step\n end",
"def environments\n get_chef_files_absolute_paths environments_path\n end",
"def calculate_env_vars\n found = Beaker::Options::OptionsHash.new\n found = found.merge(format_found_env_vars(collect_env_vars(ENVIRONMENT_SPEC)))\n found[:answers] = select_env_by_regex('\\\\Aq_')\n\n found.delete_if { |_key, value| value.nil? or value.empty? }\n found\n end",
"def env_without_bundler(env)\n re = /\\ABUNDLE|RBENV|GEM/\n\n bundler_keys = env.select { |var, _| var.to_s.match(re) }.keys\n bundler_keys.reduce({}) do |hash, (k, _)|\n hash[k] = nil\n hash\n end\n end",
"def configure (*envs, &block)\n\n (@configures ||= []) << [ envs.collect { |e| e.to_s }, block ]\n end",
"def to_env\n CONFIGURABLE_WITH_ENV.each_with_object({}) do |option, env|\n unless (value = @config[option]).nil?\n env[\"#{ ViteRuby::ENV_PREFIX }_#{ option.upcase }\"] = value.to_s\n end\n end.merge(ViteRuby.env)\n end",
"def env_hash\n read_env || reset_env unless defined?(DataCache.env_hash)\n DataCache.env_hash\n end",
"def sites\n @list.map {|partition_name, partition| partition.sites.map {|site| {site => partition_name} }}.flatten(1)\n end",
"def config_list(regex)\n\t\tcmd = \"git config -f #{@config_file} \" +\n\t\t \"--get-regexp 'environment.#{@env}.#{regex}'\"\n\n\t\tbegin\n\t\t\t@command.\n\t\t\t run_command_stdout(cmd).\n\t\t\t split(\"\\n\").\n\t\t\t map { |l| l.split(/\\s+/, 2) }.\n\t\t\t map { |item|\t[item[0].gsub(\"environment.#{@env}.\", ''), item[1]] }\n\t\trescue Giddyup::CommandWrapper::CommandFailed => e\n\t\t\tif e.status.exitstatus == 1\n\t\t\t\t# \"Nothing found\", OK then\n\t\t\t\treturn []\n\t\t\telse\n\t\t\t\traise RuntimeError,\n\t\t\t\t \"Failed to get config list environment.#{@env}.#{regex}\"\n\t\t\tend\n\t\tend\n\tend",
"def [](env)\n @environments[env.to_s].freeze\n end",
"def env_config; end",
"def env_config; end",
"def env_config; end",
"def env_config; end",
"def hash_from_env(env)\n return {} unless env\n env.split(',').each_with_object({}) do |item, hash|\n map = item.split(':')\n hash.store(map[0], map[1])\n end\nend",
"def process_environment(env)\n request_data = { \n :url => env['REQUEST_URI'],\n :ip_address => env['HTTP_X_FORWARDED_FOR'] ? env['HTTP_X_FORWARDED_FOR'] : env['REMOTE_ADDR']\n }\n request_data[:user] = env['HTTP_USER_EMAIL'] if env['HTTP_USER_EMAIL']\n\n env['rack.input'].rewind\n parameters = ''\n env['rack.input'].each { |line| parameters += line }\n request_data[:parameters] = parameters if parameters\n\n server_name = env[\"SERVER_NAME\"].split('.').first\n env_name = @email_options['environment_name'][server_name]\n\n { :environment_data => env.map { |l| \" * #{l}\" }.join(\"\\n\"),\n :request_data => request_data,\n :server_name => server_name,\n :env_name => env_name\n }\n end",
"def with_first_env(rows)\n rows.each { |row| (row[:env] ||= []).concat([first_env]).uniq! unless row[:env] } if first_env\n rows\n end",
"def host_definitions(monitor_config)\n logger.debug { \"#{self.class}##{__method__}\" }\n host_defs = []\n monitor_config.groups.each do |group|\n group.hosts.each do |host|\n hdef = host.instance_values.symbolize_keys\n hdef[:monitor_type] = monitor_config.monitor_type\n hdef[:role_name] = group.role\n %i[executable_path ssh_identity user_name\n sampling_interval active].each do |sym|\n\n # take values from monitor_config unless the hdef contains the key\n hdef[sym] = monitor_config.send(sym) unless hdef.key?(sym)\n end\n hdef[:active] = true if hdef[:active].nil?\n host_defs.push(hdef)\n end\n end\n host_defs\n end",
"def pool_configurations\n ActiveRecord::Base.configurations.map do |name, config|\n next unless name.to_s =~ /#{ReplicaPools.config.environment}_pool_(.*)_name_(.*)/\n [name, $1, $2]\n end.compact\n end",
"def env_types\n DataCache.env_types\n end",
"def domains(app_env)\n domains = self.settings['domains'] || {}\n domains[app_env] || []\n end",
"def environment_for_connect\n @environment_report ||= Agent.config[:send_environment_info] ? Array(EnvironmentReport.new) : []\n end",
"def pdb_get_environment(facts)\n if facts.is_a?(Hash) && !facts['trusted'].nil? && !facts['trusted']['value'].nil? && !facts['trusted']['value']['extensions'].nil? && !facts['trusted']['value']['extensions']['pp_environment'].nil?\n environment = facts['trusted']['value']['extensions']['pp_environment']\n Puppet.info(\"#{log_prefix} puppet environment for node is: environment=#{environment}\")\n environment\n else\n \"Unknown\"\n end\n end",
"def environment name, config=nil, &block\n environments[name] = klass.configure(config, &block)\n end",
"def get_environments_layout\n @environment.present? ? \"environment\" : \"application\"\n end",
"def flatten_configurations\n all_settings = all_configurations.settings\n flattened_configurations = []\n\n debug_configurations.each do |b|\n b.settings = default_debug_settings.merge!(all_settings).merge!(b.settings)\n flattened_configurations << b\n end\n\n release_configurations.each do |b|\n b.settings = default_release_settings.merge!(all_settings).merge!(b.settings)\n flattened_configurations << b\n end\n\n flattened_configurations\n end",
"def env_vars\n @env ||= calculate_env_vars\n end"
] | [
"0.7234255",
"0.68260694",
"0.66575277",
"0.65260625",
"0.6470043",
"0.6170826",
"0.6169138",
"0.61430985",
"0.61017185",
"0.6069006",
"0.60683566",
"0.6031708",
"0.6026988",
"0.6017535",
"0.6013884",
"0.5921596",
"0.5902307",
"0.5901868",
"0.5872974",
"0.5826732",
"0.57969403",
"0.5793735",
"0.57890546",
"0.57158184",
"0.5693146",
"0.56781316",
"0.5631968",
"0.5615368",
"0.55867076",
"0.5566517",
"0.55659306",
"0.5554994",
"0.55516946",
"0.5503067",
"0.54934365",
"0.54908246",
"0.5490435",
"0.5464011",
"0.5419095",
"0.54116607",
"0.5396221",
"0.5377354",
"0.5374593",
"0.5366998",
"0.53598803",
"0.53371316",
"0.53193265",
"0.53116226",
"0.52975446",
"0.52961427",
"0.52931064",
"0.5288494",
"0.5282827",
"0.52822596",
"0.5268187",
"0.52653503",
"0.5222597",
"0.5222084",
"0.5173431",
"0.51688635",
"0.5153837",
"0.51497805",
"0.5142212",
"0.5131537",
"0.5131537",
"0.5128608",
"0.51119804",
"0.51088494",
"0.51054114",
"0.5101545",
"0.50768507",
"0.50692165",
"0.50537086",
"0.50528127",
"0.50527143",
"0.50483453",
"0.5048145",
"0.50476074",
"0.5037938",
"0.5031945",
"0.50221586",
"0.50212044",
"0.50119984",
"0.50080234",
"0.50080234",
"0.50080234",
"0.50080234",
"0.50041854",
"0.5002044",
"0.49988705",
"0.49961308",
"0.49844152",
"0.49766064",
"0.49676",
"0.49641564",
"0.49615625",
"0.49609587",
"0.49544364",
"0.4949572",
"0.49484748"
] | 0.74446887 | 0 |
Returns a hash from environments to modules; removes duplicate modules. | def modules_per_environment(node_configs)
node_configs = group_by_environment(node_configs)
modules = node_configs.map do |env, configs|
[env, configs.map { |c| c['modules'] }.flatten.uniq]
end
Hash[modules]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modules_hash\n @modules\n end",
"def modules_hash\n @modules\n end",
"def modules_hash\n @modules_hash\n end",
"def unique_modules\n @unique_modules\n end",
"def global_modules\n node['rsyncd']['globals'].reduce({}) do |hash, (key, value)|\n hash[snake_to_space(key)] = value unless value.nil?\n hash\n end\n end",
"def all_modules\n modules_hash.values\n end",
"def environment_hash\n @environment_hash ||= build_environment_hash\n end",
"def browser_hash_for(mod)\n mod.constants(false).each_with_object({}) do |c, h|\n if (o = mod.const_get(c)).is_a?(Module) then\n begin\n h[c] = o.constants(false).any? { |c| o.const_get(c).is_a? Module }\n rescue\n next\n end\n end\n end\n end",
"def module_names\n @cache[:modules]\n end",
"def modules\n modules = {}\n\n begin\n mods = Pathname.new(@conf['mod_dir']).children.select(&:directory?)\n\n mods.each do |m|\n modules[m.basename.to_s] = mod_versions(m)\n end\n rescue StandardError => err\n Pem.log_error(err, @logger)\n raise(err)\n end\n\n modules\n end",
"def module_types\n\t\tmodule_sets.keys.dup\n\tend",
"def rsync_modules\n rsync_resources.reduce({}) do |hash, resource|\n if resource.config_path == new_resource.config_path && (\n resource.action == :add ||\n resource.action.include?(:add)\n )\n hash[resource.name] ||= {}\n resource_attributes.each do |key|\n value = resource.send(key)\n next if value.nil?\n hash[resource.name][snake_to_space(key)] = value\n end\n end\n\n hash\n end\n end",
"def composite_keys \n Hash.new.tap do |hash|\n SPREE_MODULES.each do |mod|\n hash.merge! get_translation_keys(\"spree_#{mod}\")\n end\n end\n end",
"def envs_details\n current_envs = {}\n show_envs.each do |e|\n z = PemEnv.new(e, self)\n current_envs[e] = z.mods\n end\n\n current_envs\n end",
"def envs_details\n current_envs = {}\n show_envs.each do |e|\n z = Pem::Env.new(e, self)\n current_envs[e] = z.mods\n end\n\n current_envs\n end",
"def env_without_bundler(env)\n re = /\\ABUNDLE|RBENV|GEM/\n\n bundler_keys = env.select { |var, _| var.to_s.match(re) }.keys\n bundler_keys.reduce({}) do |hash, (k, _)|\n hash[k] = nil\n hash\n end\n end",
"def hash\n [specs, platform, requires_frameworks].hash\n end",
"def env_hash\n read_env || reset_env unless defined?(DataCache.env_hash)\n DataCache.env_hash\n end",
"def find_module(name, version)\n e = []\n\n @envs.each do |k, v|\n next unless v.keys.include?(name) && v[name] == version\n e << k\n end\n\n e\n end",
"def find_module(name, version)\n e = []\n\n @envs.each do |k, v|\n next unless v.keys.include?(name) && v[name] == version\n e << k\n end\n\n e\n end",
"def unique_classes_and_modules\n @unique_classes + @unique_modules\n end",
"def collect_cache_module_data\n return unless collect_module_exists?\n collect_keys.each do |key|\n mod_array = collect_module[key]\n next if mod_array.blank?\n mod_cache_array = Array.new\n mod_array.delete_if do |hash|\n hash[:cache] != false ? (mod_cache_array.push(hash) and true) : false\n end\n collect_module.delete(key) if mod_array.blank?\n next if mod_cache_array.blank?\n collect_module_data_for(key, mod_cache_array)\n end\n end",
"def module_names(set)\n\t\tmodule_sets[set] ? module_sets[set].keys.dup : []\n\tend",
"def all_classes_and_modules\n @classes_hash.values + @modules_hash.values\n end",
"def hash\n [hint,name,ordinal,module_name].hash\n end",
"def hash\n [dep_mgr_name, name, version, license].hash\n end",
"def environment_as_hash\n returning Hash.new do |h|\n ENV.keys.each do |k|\n if k && k =~ /:/\n h[k] = ENV[k].split ':'\n else\n h[k] = ENV[k]\n end\n end\n end\nend",
"def modules\n @module_ids.collect { |idx| BModule.store[idx] }\n end",
"def selfHash\n dirHash(Pathname.new(__FILE__).dirname, /\\.rb$/)\nend",
"def bsd_modules(path)\n modules = Mash.new\n so = shell_out(\"#{Ohai.abs_path(path)}\")\n so.stdout.lines do |line|\n # 1 7 0xc0400000 97f830 kernel\n if line =~ /(\\d+)\\s+(\\d+)\\s+([0-9a-fx]+)\\s+([0-9a-fx]+)\\s+([a-zA-Z0-9\\_]+)/\n modules[$5] = { :size => $4, :refcount => $2 }\n end\n end\n modules\n end",
"def included_in_modules\n modules = []\n ObjectSpace.each_object(Module) { |k| modules << k if k.included_modules.include?(self) }\n\n modules.reverse.inject([]) do |unique_modules, klass|\n unique_modules << klass unless unique_modules.collect { |k| k.to_s }.include?(klass.to_s)\n unique_modules\n end\n end",
"def all_environments\n environments = apps.each_with_object([]) do |(app, hsh), arr|\n hsh.each { |env, app_name| arr << env }\n end\n environments.uniq\n end",
"def classes\n return @classes if @classes\n\n @classes = {}\n\n @stores.each do |store|\n store.cache[:modules].each do |mod|\n # using default block causes searched-for modules to be added\n @classes[mod] ||= []\n @classes[mod] << store\n end\n end\n\n @classes\n end",
"def modules\n @modules.values\n end",
"def modules\n @modules.values\n end",
"def rsync_modules\n rsync_resources.each_with_object({}) do |resource, hash|\n next unless resource.config_path == new_resource.config_path && (\n resource.action == :add ||\n resource.action.include?(:add)\n )\n hash[resource.name] ||= {}\n resource_attributes.each do |key|\n value = resource.send(key)\n next if value.nil?\n hash[resource.name][attribute_to_directive(key)] = value\n end\n end\nend",
"def classes\n return @classes if @classes\n @classes = {}\n @stores.each do |store|\n store.cache[:modules].each do |mod|\n # using default block causes searched-for modules to be added\n @classes[mod] ||= []\n @classes[mod] << store\n end\n end\n @classes\n end",
"def global_modules\n node['rsyncd']['globals'].each_with_object({}) do |(key, value), hash|\n hash[attribute_to_directive(key)] = value unless value.nil?\n end\nend",
"def get_unref_symbols\n unref = []\n @modules.each do |mod|\n mod.symbols.values.each do |s|\n unless s.referenced?\n unref << s.name\n end\n end\n end\n unref\n end",
"def environments\n environment_config.keys\n end",
"def rehash\n @system_commands = {}\n end",
"def bsd_modules(path)\n modules = Mash.new\n so = shell_out(Ohai.abs_path(path).to_s)\n so.stdout.lines do |line|\n # 1 7 0xc0400000 97f830 kernel\n if line =~ /(\\d+)\\s+(\\d+)\\s+([0-9a-fx]+)\\s+([0-9a-fx]+)\\s+([a-zA-Z0-9\\_]+)/\n modules[$5] = { size: $4, refcount: $2 }\n end\n end\n modules\n end",
"def dev_pod_hashes_map\n @dev_pod_hashes_map ||=\n dev_pod_sources.map { |name, attribs| [name, FolderChecksum.git_checksum(attribs[:path])] }.to_h\n end",
"def hash\n [class_id, object_type, admin_evac_state, admin_inband_interface_state, alarm_summary, available_memory, device_mo_id, dn, ethernet_mode, ethernet_switching_mode, fault_summary, fc_mode, fc_switching_mode, firmware, inband_ip_address, inband_ip_gateway, inband_ip_mask, inband_vlan, ipv4_address, management_mode, model, name, num_ether_ports, num_ether_ports_configured, num_ether_ports_link_up, num_expansion_modules, num_fc_ports, num_fc_ports_configured, num_fc_ports_link_up, oper_evac_state, operability, out_of_band_ip_address, out_of_band_ip_gateway, out_of_band_ip_mask, out_of_band_ipv4_address, out_of_band_ipv4_gateway, out_of_band_ipv4_mask, out_of_band_ipv6_address, out_of_band_ipv6_gateway, out_of_band_ipv6_prefix, out_of_band_mac, presence, revision, rn, serial, source_object_type, switch_id, thermal, total_memory, vendor, version, registered_device].hash\n end",
"def get_indifferent_cached_deployments\r\n HashWithIndifferentAccess.new get_cached_deployments\r\n end",
"def symbolize\n Hash.new\n end",
"def instance_variables_hash\n instance_variables.inject({}) do |acc, iv|\n acc[iv.to_s[1..-1]] = instance_variable_get(iv) unless [:@env, :@top].include?(iv.to_sym)\n acc\n end\n end",
"def exploits\n\t\treturn module_sets[MODULE_EXPLOIT]\n\tend",
"def env_hash\n hash = {}\n request.env.each do |key, value|\n hash[key] = value if key =~ /^(HTTP|REQUEST|REMOTE).*/\n end\n puts hash.to_s\n hash\n end",
"def env_keys\n mapping.values\n end",
"def hash\n instance_variables.map do |var|\n instance_variable_get(var).hash\n end.reduce(:^)\n end",
"def powenv(pow_app)\n powenv_path = \"#{@pow_path}/#{pow_app}/.powenv\"\n powenv = File.open(powenv_path).readlines if File.exists?(powenv_path)\n\n hash = {}\n powenv.each do |line|\n hash[$1.strip.to_sym] = $2.strip if line =~ /\\s?export\\s?(.+)=(.+)/i\n end unless powenv.nil?\n\n return hash.empty? ? nil : hash\n end",
"def env_to_hash(environment)\n return environment if environment.is_a?(Hash)\n\n environment.to_h { |v| v.split(\"=\", 2) }\n end",
"def unloadable_cpaths\n to_unload.keys.freeze\n end",
"def generate_hash\n @groups.flatten.inject([]) {|hash, stone| hash << stone.to_s}.sort.hash\n end",
"def to_hash\n stack.inject { |h, layer| Util.deep_merge h, layer }\n end",
"def all_product_hash\n hash = {}\n items = @all_products\n for prod in items\n hash[prod] = {}\n end\n return hash\n end",
"def to_hash\n @to_hash ||= Util::NonNilHashBuilder.build do |h|\n h.add(:application, application)\n h.add(:class_name, class_name)\n h.add(:file, file)\n h.add(:function, function)\n h.add(:line, line)\n h.add(:module_name, module_name)\n h.add(:vm_pid, vm_pid)\n end\n end",
"def module_config\r\n []\r\n end",
"def hash_from_env(env)\n return {} unless env\n env.split(',').each_with_object({}) do |item, hash|\n map = item.split(':')\n hash.store(map[0], map[1])\n end\nend",
"def assets_hash(scope)\n @assets_hash ||= scope.environment.each_logical_path.each_with_object({ :url => '', :path => '' }) do |logical_path, assets_hash|\n extensions = EXCLUDED_EXTENSIONS.join('|')\n unless File.extname(logical_path) =~ Regexp.new(\"^(\\.(#{extensions})|)$\")\n path_to_asset = scope.path_to_asset(logical_path)\n assets_hash[:url] << \"('#{logical_path}' url(\\\"#{path_to_asset}\\\")) \"\n assets_hash[:path] << \"('#{logical_path}' \\\"#{path_to_asset}\\\") \"\n end\n end\n end",
"def rm_installed_modules_from_hosts(beginning_hash, ending_hash)\n ending_hash.each do |host, mod_array|\n mod_array.each do |mod|\n if ! beginning_hash[host].include? mod\n on host, \"rm -rf '#{mod}'\"\n end\n end\n end\n end",
"def hash\n [code, scope].hash\n end",
"def export_env(script)\n environment = script.job_environment\n (environment ? environment : {}).tap{\n |hsh|\n hsh['SINGULARITY_BINDPATH'] = singularity_bindpath(script.native)\n }.map{\n |key, value| \"export #{key}=#{Shellwords.escape(value)}\"\n }.sort.join(\"\\n\")\n end",
"def to_module\n hash = self\n Module.new do\n hash.each_pair do |key, value|\n define_method key.to_sym do\n value\n end\n end\n end\n end",
"def process_global_variables\n result = {}\n\n config['variables.global.each-pallet']&.each do |dst_key, kind|\n result[dst_key] ||= {}\n\n jack.each(kind: kind) do |pallet|\n result[dst_key][pallet.full_name] = pallet.to_hash.except('pallet')\n end\n end\n\n config['variables.global.each-leaf-pallet']&.each do |dst_key, kind|\n result[dst_key] ||= {}\n\n jack.each(kind: kind) do |pallet|\n next unless pallet.children(kind: kind).empty?\n\n result[dst_key][pallet.full_name] = pallet.to_hash.except('pallet')\n end\n end\n\n result\n end",
"def modules_paths\n puppet_environment.full_modulepath\n end",
"def to_hash\n hash = Hash[instance_variables.map { |var| [var[1..-1].to_sym, instance_variable_get(var)] }]\n hash.delete(:root)\n hash.delete(:nodes)\n hash.delete(:sequences)\n hash\n end",
"def collect_module_data\n return unless collect_module_exists?\n collect_keys.each do |key|\n mod_array = collect_module[key]\n next if mod_array.blank?\n collect_module_data_for(key, mod_array)\n end\n end",
"def app_modules\n @app_modules ||= []\n end",
"def update_includes\n includes.reject! do |include|\n mod = include.module\n !(String === mod) && @store.modules_hash[mod.full_name].nil?\n end\n\n includes.uniq!\n end",
"def modules_paths\n puppet_environment.full_modulepath\n end",
"def canonicalize_environments(manifest)\n canonicalize_key(manifest, :environments) do |environments|\n Hash[\n environments.map do |key, environment|\n [key, canonicalize(environment)]\n end\n ]\n end\n end",
"def assets\n uniq = {}\n sets = manifests.map(&:assets)\n sets.each do |assets|\n assets.each do |rel_path, abs_path|\n uniq[rel_path] = abs_path unless uniq.key?(rel_path)\n end\n end\n uniq\n end",
"def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end",
"def hash\r\n [user_id, project_id, release, build, _module, requirement, test_case, test_cycle, test_suite, test_run, defect, report, project_setting, session, project, schedule].hash\r\n end",
"def environment_loaders\n name = compiler.loaders.public_environment_loader.loader_name\n end",
"def environment_loaders\n name = compiler.loaders.public_environment_loader.loader_name\n end",
"def mod_versions(mod)\n versions = {}\n\n Pathname.new(mod).children.select(&:directory?).each do |m|\n version = m.basename.to_s\n deets = YAML.safe_load(File.open(\"#{mod}/#{version}/.pemversion\"))\n versions[version] = deets\n end\n\n versions\n end",
"def build_initial_hash\n new_hash = {}\n\n # Release context\n release_context = Contexts::Release.from_env\n if release_context\n add_to!(new_hash, release_context)\n end\n\n # System context\n hostname = Socket.gethostname\n pid = Process.pid\n system_context = Contexts::System.new(hostname: hostname, pid: pid)\n add_to!(new_hash, system_context)\n\n # Runtime context\n thread_object_id = Thread.current.object_id\n runtime_context = Contexts::Runtime.new(vm_pid: thread_object_id)\n add_to!(new_hash, runtime_context)\n\n new_hash\n end",
"def to_hash\n Hash[instance_variables.map { |var| [var[1..-1].to_sym, instance_variable_get(var)]}]\n end",
"def get_hash()\n\t\t\treturn @config.clone()\n\t\tend",
"def create_versions_hash\n hash = Hash.new { |h, k| h[k] = [] }\n\n versions.each do |version|\n hash[version[0]] << version\n end\n\n hash\n end",
"def gems\n @gems ||= begin\n gems = locks.dup\n gems.each do |name, g|\n if gem_declarations.has_key?(name)\n g[:declared_groups] = gem_declarations[name][:groups]\n else\n g[:declared_groups] = []\n end\n g[:groups] = g[:declared_groups].dup\n end\n # Transitivize groups (since dependencies are already transitive, this is easy)\n gems.each do |name, g|\n g[:dependencies].each do |dep|\n gems[dep][:groups] |= gems[name][:declared_groups].dup\n end\n end\n gems\n end\n end",
"def name_and_class\n @engine_name_and_class ||= Hash[*engines.collect { |e| [engine_name(e), engine_class_name(e)] }.flatten]\n engine_name_and_class.dup\n end",
"def smash_configs\n # private overrides public general config\n a = remove_environments(@general_config_pub)\n b = remove_environments(@general_config_priv)\n general = a.merge(b)\n\n # private overrides public collection config\n c = remove_environments(@collection_config_pub)\n d = remove_environments(@collection_config_priv)\n collection = c.merge(d)\n\n # collection overrides general config\n return general.merge(collection)\n end",
"def faker_modules\n FFaker\n .constants\n .reject { |const| UTILS_MODULES.include?(const) }\n .select { |const| FFaker.const_get(const).instance_of?(Module) }\n .sort\n .map { |const| FFaker.const_get(const) }\nend",
"def build_environment_hash\n parsed_variables = {}\n @env.each do |env_row|\n # Each row can potentially contain multiple environment\n # variables\n variables = extract_variables(env_row)\n\n variables.each do |variables_with_values|\n variables_with_values.each do |key, value|\n parsed_variables[key] = value\n end\n end\n end\n\n @override_envs.each do |env|\n parsed_variables = parsed_variables.merge env\n end\n\n parsed_variables\n end",
"def _compiled_assets_initial_hash\n CompiledAssetsHash.new\n end",
"def gem_declarations\n @gem_declarations ||= begin\n Bundler.with_clean_env do\n # Set BUNDLE_GEMFILE to the new gemfile temporarily so all bundler's things work\n # This works around some issues in bundler 1.11.2.\n ENV[\"BUNDLE_GEMFILE\"] = gemfile_path\n\n parsed_gemfile = Bundler::Dsl.new\n parsed_gemfile.eval_gemfile(gemfile_path)\n parsed_gemfile.complete_overrides if parsed_gemfile.respond_to?(:complete_overrides)\n\n result = {}\n parsed_gemfile.dependencies.each do |dep|\n groups = dep.groups.empty? ? [:default] : dep.groups\n result[dep.name] = { groups: groups, platforms: dep.platforms }\n end\n result\n end\n end\n end",
"def get_clean_env\n # blank out bundler and gem path modifications, will be re-setup by new call\n new_env = {}\n new_env['BUNDLER_ORIG_MANPATH'] = nil\n new_env['BUNDLER_ORIG_PATH'] = nil\n new_env['BUNDLER_VERSION'] = nil\n new_env['BUNDLE_BIN_PATH'] = nil\n new_env['RUBYLIB'] = nil\n new_env['RUBYOPT'] = nil\n\n # DLM: preserve GEM_HOME and GEM_PATH set by current bundle because we are not supporting bundle\n # requires to ruby gems will work, will fail if we require a native gem\n new_env['GEM_PATH'] = nil\n new_env['GEM_HOME'] = nil\n\n # DLM: for now, ignore current bundle in case it has binary dependencies in it\n # bundle_gemfile = ENV['BUNDLE_GEMFILE']\n # bundle_path = ENV['BUNDLE_PATH']\n # if bundle_gemfile.nil? || bundle_path.nil?\n new_env['BUNDLE_GEMFILE'] = nil\n new_env['BUNDLE_PATH'] = nil\n new_env['BUNDLE_WITHOUT'] = nil\n # else\n # new_env['BUNDLE_GEMFILE'] = bundle_gemfile\n # new_env['BUNDLE_PATH'] = bundle_path\n # end\n\n return new_env\n end",
"def modules\n @modules ||= Array.new\n @modules\nend",
"def dependent_modules\n out = [ ]\n @dependencies.each { |dependency| out << @module_set[dependency] }\n out\n end",
"def combined_hash\n y = if @process_global\n normalize(global_yaml).rmerge(normalize(yaml))\n else\n normalize(yaml)\n end\n @process_local ? y.rmerge(normalize(local_yaml)) : y\n end",
"def to_hash\n\t\t@classes.map { |name,klass| klass.to_hash }.reduce({}) { |sum,v| sum.merge( v) }\n\tend",
"def to_h\n {host: host, lib: lib, bin: bin, moabhomedir: moabhomedir}\n end",
"def env_types\n DataCache.env_types\n end",
"def process_config(hash)\n return _compile(hash).to_hash_struct unless keys_to_sym?\n _compile(hash).keys_to_sym.to_hash_struct\n end",
"def symbols_in_program_memory\n @symbol_set.symbols_in_memory(:program_memory)\n end",
"def dependency_states\n states = {}\n deps.each do |dep|\n gem = Polisher::Gem.new :name => dep.name\n states.merge! dep.name => gem.state(:check => dep)\n end\n states\n end"
] | [
"0.68974185",
"0.68974185",
"0.67499155",
"0.63170797",
"0.62764794",
"0.61536616",
"0.60655314",
"0.6028512",
"0.60182786",
"0.5964805",
"0.59135616",
"0.58405316",
"0.57757044",
"0.573321",
"0.56737626",
"0.56425565",
"0.56408525",
"0.56319124",
"0.5620412",
"0.5587188",
"0.55539507",
"0.552929",
"0.5513205",
"0.5489668",
"0.54388654",
"0.5432278",
"0.5428625",
"0.5421282",
"0.54181904",
"0.53770965",
"0.5364215",
"0.5346505",
"0.5340677",
"0.53331566",
"0.53331566",
"0.5325084",
"0.5323868",
"0.5300945",
"0.52879405",
"0.5248033",
"0.5243361",
"0.52249676",
"0.5222319",
"0.5218267",
"0.5217759",
"0.52073157",
"0.5204503",
"0.5190374",
"0.51899654",
"0.5181289",
"0.5157659",
"0.514912",
"0.51412344",
"0.5135424",
"0.51204973",
"0.50901574",
"0.507333",
"0.5070316",
"0.5061411",
"0.505509",
"0.50525916",
"0.5049296",
"0.5047919",
"0.504474",
"0.504443",
"0.5044084",
"0.5033278",
"0.50288826",
"0.5027239",
"0.5026537",
"0.50262463",
"0.5026035",
"0.50228465",
"0.5016898",
"0.5010439",
"0.49994206",
"0.49910632",
"0.49910632",
"0.4975695",
"0.49666092",
"0.4964711",
"0.49617139",
"0.49579337",
"0.49432525",
"0.49417618",
"0.49348372",
"0.4934062",
"0.49327406",
"0.49258614",
"0.49255085",
"0.49252918",
"0.4918994",
"0.49103123",
"0.4904369",
"0.48972857",
"0.4896248",
"0.48960465",
"0.48911625",
"0.488968",
"0.48832148"
] | 0.71670455 | 0 |
Returns the path to the local hiera.yaml file for the specified hiera. | def hiera_configpath(hiera)
File.join('config', 'hieras', hiera, 'hiera.yaml')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hiera_datadir\n # This output lets us know where Hiera is configured to look on the system\n puppet_lookup_info = run_shell('puppet lookup --explain test__simp__test').stdout.strip.lines\n puppet_config_check = run_shell('puppet agent --configprint manifest').stdout\n\n if puppet_config_check.nil? || puppet_config_check.empty?\n fail(\"No output returned from `puppet config print manifest`\")\n end\n\n puppet_env_path = File.dirname(puppet_config_check)\n\n # We'll just take the first match since Hiera will find things there\n puppet_lookup_info = puppet_lookup_info.grep(/Path \"/).grep(Regexp.new(puppet_env_path))\n\n # Grep always returns an Array\n if puppet_lookup_info.empty?\n fail(\"Could not determine hiera data directory under #{puppet_env_path}\")\n end\n\n # Snag the actual path without the extra bits\n puppet_lookup_info = puppet_lookup_info.first.strip.split('\"').last\n\n # Make the parent directories exist\n run_shell(\"mkdir -p #{File.dirname(puppet_lookup_info)}\", acceptable_exit_codes: [0])\n\n # We just want the data directory name\n datadir_name = puppet_lookup_info.split(puppet_env_path).last\n\n # Grab the file separator to add back later\n file_sep = datadir_name[0]\n\n # Snag the first entry (this is the data directory)\n datadir_name = datadir_name.split(file_sep)[1]\n\n # Constitute the full path to the data directory\n datadir_path = puppet_env_path + file_sep + datadir_name\n\n # Return the path to the data directory\n return datadir_path\nend",
"def filepathFromAbsOrRel(absOrRel)\n if(absOrRel[\"isRelative\"].to_i != 0) then\n adir = Pathname.new(File.dirname($filepathYaml)).join(absOrRel[\"path\"])\n else\n Pathname.new(absOrRel[\"path\"])\n end\nend",
"def hiera_datadirs(hiera)\n configpath = hiera_configpath(hiera)\n config = YAML.load_file(configpath)\n backends = [config[:backends]].flatten\n datadirs = backends.map { |be| config[be.to_sym][:datadir] }.uniq\n datadirs.map do |datadir|\n localpath = File.join('config', 'hieras', hiera, File.basename(datadir))\n [localpath, datadir]\n end\nend",
"def install_hiera_config(logger, options)\n # Validate hiera config file\n hiera_config = options[:hiera_config]\n unless hiera_config.is_a?(String)\n raise ArgumentError, \"Called install_hiera_config with a #{hiera_config.class} argument\"\n end\n file_src = if hiera_config.start_with? '/'\n hiera_config\n elsif hiera_config =~ %r{^environments/#{Regexp.escape(environment)}/}\n File.join(@tempdir, hiera_config)\n else\n File.join(@tempdir, 'environments', environment, hiera_config)\n end\n raise Errno::ENOENT, \"hiera.yaml (#{file_src}) wasn't found\" unless File.file?(file_src)\n\n # Munge datadir in hiera config file\n obj = YAML.load_file(file_src)\n (obj[:backends] || %w(yaml json)).each do |key|\n next unless obj.key?(key.to_sym)\n if options[:hiera_path_strip].is_a?(String)\n next if obj[key.to_sym][:datadir].nil?\n rexp1 = Regexp.new('^' + options[:hiera_path_strip])\n obj[key.to_sym][:datadir].sub!(rexp1, @tempdir)\n elsif options[:hiera_path].is_a?(String)\n obj[key.to_sym][:datadir] = File.join(@tempdir, 'environments', environment, options[:hiera_path])\n end\n rexp2 = Regexp.new('%{(::)?environment}')\n obj[key.to_sym][:datadir].sub!(rexp2, environment)\n\n # Make sure the dirctory exists. If not, log a warning. This is *probably* a setup error, but we don't\n # want it to be fatal in case (for example) someone is doing an octocatalog-diff to verify moving this\n # directory around or even setting up Hiera for the very first time.\n unless File.directory?(obj[key.to_sym][:datadir])\n message = \"WARNING: Hiera datadir for #{key} doesn't seem to exist at #{obj[key.to_sym][:datadir]}\"\n logger.warn message\n end\n end\n\n # Write properly formatted hiera config file into temporary directory\n File.open(File.join(@tempdir, 'hiera.yaml'), 'w') { |f| f.write(obj.to_yaml.gsub('!ruby/sym ', ':')) }\n logger.debug(\"Installed hiera.yaml from #{file_src} to #{File.join(@tempdir, 'hiera.yaml')}\")\n end",
"def yaml_path\n \"#{user_directory}/.yolo/config.yml\"\n end",
"def get_path(filename)\n\n Pathname(__FILE__).ascend{ |directory|\n path = directory + \"ansiblealexa.yml\"; break path if path.file?\n }\n\nend",
"def path_for(config); File.expand_path(File.join('../fixtures', config), __FILE__) ;end",
"def path\n File.join(RH_CONFIG[\"location\"], self.parent.pid.gsub(/:/,\"_\"), \"data\", self.name.first) unless self.parent.nil? or self.name.empty?\n end",
"def config_filepath(name)\n File.expand_path(\"../fixtures/configs/#{name}.yaml\", __dir__)\nend",
"def local_backup_path\n [local_directory, Confluence.filename].join('/')\n end",
"def hiera_file_names\n return @hiera_file_names if @hiera_file_names\n error \"No #{Noop::Config.dir_path_hiera} directory!\" unless Noop::Config.dir_path_hiera.directory?\n exclude = [ Noop::Config.dir_name_hiera_override, Noop::Config.dir_name_globals, Noop::Config.file_name_hiera_plugins ]\n @hiera_file_names = find_files(Noop::Config.dir_path_hiera, Noop::Config.dir_path_hiera, exclude) do |file|\n file.to_s.end_with? '.yaml'\n end\n end",
"def path\n @path ||= begin\n dir = File.join Dir.home, \".relaton\", \"iec\"\n FileUtils.mkdir_p dir\n File.join dir, \"index.yaml\"\n end\n end",
"def yaml_file\n @yaml_file ||= begin\n filename = self.class.to_s.split(\"::\").last\n filename << \"-#{storage_id}\" if storage_id\n File.join(Config.data_path, package.trigger, \"#{filename}.yml\")\n end\n end",
"def path()\n file = File.join(Eddy.config.tmp_dir, \"eddy_persistent_data.json\")\n # FileUtils.mkdir_p(File.dirname(file))\n return Pathname.new(file)\n end",
"def local_path\n File.join([\"Subassemblies\", \"#{self.name}.craft\"])\n end",
"def chef_config_path\n if Chef::Config['config_file']\n ::File.dirname(Chef::Config['config_file'])\n else\n raise(\"No chef config file defined. Are you running \\\nchef-solo? If so you will need to define a path for the ohai_plugin as the \\\npath cannot be determined\")\n end\n end",
"def data_path name\n File.join File.dirname(__FILE__), 'data', \"#{ name }.yml\"\nend",
"def path_from_hoard\n Pathname(path).relative_path_from(Pathname(hoard_path)).to_s\n end",
"def path\n @path ||= File.dirname @config_file\n end",
"def full_path\n container.root.join(path)\n end",
"def full_path\n container.root.join(path)\n end",
"def path\n @configuration.path\n end",
"def infos_path\n\t@infos_path ||= File.join(main_folder, 'infos.yaml')\nend",
"def path\n (public_path + sitemaps_path + filename).expand_path.to_s\n end",
"def graph_relative_path\n File.join('qa_server', 'charts')\n end",
"def template_path(name)\n File.join(__dir__, 'config', \"#{name}.yml.erb\")\n end",
"def repository_path(name)\n File.expand_path(\"../fixtures/#{name}\", __FILE__)\n end",
"def path\n data.fetch(\"path\") { relative_path }\n end",
"def config_path\n if result = chef_api_config_path\n Pathname(result).expand_path\n else\n Pathname(\"\")\n end\n end",
"def subauthorities_path\n if config[:local_path].starts_with?(File::Separator)\n config[:local_path]\n else\n Rails.root.join(config[:local_path]).to_s # TODO: Rails.root.join returns class Pathname, which may be ok. Added to_s because of failing regression test.\n end\n end",
"def path\n File.join Dubya.root_path, 'vendor/wiki'\n end",
"def to_relative_path\n File.join('.', to.path(identify).to_s)\n end",
"def local_path\n fetch_path(DevTools.gem_root)\n end",
"def config_path\n @config_path ||= local_config_path\n end",
"def relroot\n Pathname.new(File.expand_path(path)).\n relative_path_from(Pathname.new(File.expand_path(root))).to_s\n end",
"def get_uplift_config_file \n config_dir_path = get_uplift_config_folder\n file_name = \".vagrant-network.yaml\"\n\n return File.join(config_dir_path, file_name) \n end",
"def config_path\n @config_path ||= 'config/spinach.yml'\n end",
"def path()\n return ::File.join(@root, @name)\n end",
"def schema_dump_path\n File.join ASSETS_ROOT, \"schema_dump_5_1.yml\"\n end",
"def terrafile_path\n 'Terrafile'\nend",
"def config_path\n ::Rails.root.to_s + \"/config/#{self.name.split('::').last.underscore.pluralize}.yml\"\n end",
"def dot_kitchen_yml\n File.join(Dir.pwd, \".kitchen.yml\")\n end",
"def config_path\n test? ? \"config-test.yml\" : \"config.yml\"\n end",
"def config_path(arg = nil)\n set_or_return(:config_path,\n arg,\n kind_of: String,\n default: '/etc/hipache.json')\n end",
"def ohai_plugin_path\n \"/etc/chef/ohai_plugins\"\n end",
"def local_path\n src = if %i(direct repo).include?(new_resource.source)\n package_metadata[:url]\n else\n new_resource.source.to_s\n end\n ::File.join(Chef::Config[:file_cache_path], ::File.basename(src))\n end",
"def config_path\n ENV.fetch(\"SIMPLE_SCHEDULER_CONFIG\", \"config/simple_scheduler.yml\")\n end",
"def hiera_stub\n config = Hiera::Config.load(hiera_config)\n config[:logger] = 'puppet'\n Hiera.new(:config => config)\nend",
"def figure_path(file)\n return file if Pathname.new(file).absolute?\n $LOAD_PATH.each do |path|\n found = File.join(path, file)\n return File.expand_path(found) if File.file?(found)\n end\n file\n end",
"def data_path(filename)\n File.join(File.dirname(__FILE__), 'repo', filename)\n end",
"def relative_config_file\n File.join(@settings[:config_dir], @settings[:config_file])\n end",
"def relative_path\n File.join(@repo, @bundle)\n end",
"def path_in_public\n (sitemaps_path + filename).to_s\n end",
"def remote_backup_path\n [remote_directory, Confluence.filename].join('/')\n end",
"def root_file_path; end",
"def path\n # TODO: is this trip really necessary?!\n data.fetch(\"path\") { relative_path }\n end",
"def local_plugin_repo(plugin)\n File.join(\"#{PROJECT_ROOT}\", \"sensu-plugins-#{plugin}\")\nend",
"def full_path\n File.dirname(File.expand_path(serialized_filename))\n end",
"def path\n path = @file.sub(File.expand_path(root_path), '')\n\n # if xx.haml (but not xx.html.haml), \n if tilt?\n path = path.sub(/\\.[^\\.]*$/, \"\")\n path += \".#{default_ext}\" unless File.basename(path).include?('.')\n end\n\n path\n end",
"def hiera(key, default = nil)\n @hiera.lookup(key, nil, @scope) || @scope.dig(*key.split('.')) || default\n end",
"def default_concierge_variables_path\n Hanami.root.join(\"config\", \"environment_variables.yml\").to_s\n end",
"def configuration_file_path; end",
"def relative_path\n name\n end",
"def file() = pathname.relative_path_from(Cnfs.config.paths.definitions)",
"def abs_filepath\n @epub.manifest.abs_path_from_id(@id)\n end",
"def full_defined_path()\n return nil if is_root?\n return name if parent.is_root?\n return \"#{parent.full_defined_path}.#{name}\"\n end",
"def generate_hiera_template\n ssh_key = Bebox::Project.public_ssh_key_from_file(self.project_root, self.name)\n project_name = Bebox::Project.shortname_from_file(self.project_root)\n Bebox::PROVISION_STEPS.each do |step|\n step_dir = Bebox::Provision.step_name(step)\n generate_file_from_template(\"#{Bebox::FilesHelper.templates_path}/puppet/#{step}/hiera/data/environment.yaml.erb\", \"#{self.project_root}/puppet/steps/#{step_dir}/hiera/data/#{self.name}.yaml\", {step_dir: step_dir, ssh_key: ssh_key, project_name: project_name})\n end\n end",
"def find_config_path\n path = Pathname(Pathname.pwd).ascend{|d| h=d+config_filename; break h if h.file?}\n end",
"def fixtures_path\n Berkshelf.root.join(\"spec/fixtures\")\n end",
"def definition_root\n Rails.root.join('data', 'HCA_metadata', self.version)\n end",
"def staging_root\n Pathname.new(CookbookOmnifetch.cache_path).join(\".cache_tmp\", \"metadata-installer\")\n end",
"def path\n return github_url if github_url.is_local_dir?\n\n path_to_name = File.join( @@strategies_location, username, name )\n File.join path_to_name, get_github_repo_name(github_url)\n end",
"def relative_path\n @relative_path ||= absolute_path.sub(/^#{Bookshelf::remote_folder}\\/?/,'')\n end",
"def yaml_path\n File.join(base_path, \"resource_map.yml\")\n end",
"def filepath\n base = storage_root_path\n if base\n File.join(base, storage_key)\n else\n raise StandardError.new(\"no filesystem path found for datafile: #{self.web_id}\")\n end\n end",
"def set_hieradata(hieradata)\n @temp_hieradata_dirs ||= []\n data_dir = Dir.mktmpdir('hieradata')\n @temp_hieradata_dirs << data_dir\n\n fh = File.open(File.join(data_dir, 'common.yaml'), 'w')\n if hieradata.is_a?(String)\n fh.puts(hieradata)\n else\n fh.puts(hieradata.to_yaml)\n end\n fh.close\n\n run_shell(\"mkdir -p #{File.dirname(data_dir)}\", acceptable_exit_codes: [0])\n result = upload_file(File.join(data_dir, 'common.yaml'), File.join(@hiera_datadir, 'common.yaml'), ENV['TARGET_HOST'], options: {}, config: nil, inventory: inventory_hash_from_inventory_file)\n raise \"error uploading hiera file to #{ENV['TARGET_HOST']}\" if result[0][\"status\"] !~ %r{success}\nend",
"def locate_baboon_configuration_file(specific_file_path=nil)\n config_file = nil\n default_baboon_file_path = 'config/baboon.yml'\n \n if specific_file_path.nil?\n if File.exists?(default_baboon_file_path)\n config_file = default_baboon_file_path\n else\n Find.find('.') do |path|\n if path.include?('baboon.yml')\n config_file = path\n break\n end\n end\n end\n else\n config_file = specific_file\n end\n \n config_file\n end",
"def local_path\n @io.local_path\n end",
"def bundle_directory\n @yaml[\"paths\"][\"bundle_directory\"]\n end",
"def local_yaml\n parse_yaml_string(yaml_string(local_config_file), local_config_file)\n end",
"def full_path_from_edict_file(filename=\"\")\n return Rails.root.join(\"data/cedict/#{filename}\").to_s\n end",
"def vault_path_name(args, parameter)\n pref = config.get(:vault, :pseudo_parameter_path)\n # If we have a stack name use it, otherwise try to get from env and fallback to just template name\n stack = args.first[:sparkle_stack]\n stack_name = args.first[:stack_name].nil? ? ENV.fetch('STACK_NAME', stack.name).to_s : args.first[:stack_name]\n project = config[:options][:tags].fetch('Project', 'SparkleFormation')\n\n # When running in a detectable CI environment assume that we have rights to save a generic secret\n # but honor user preference value if set\n vault_path = if ci_environment?\n # write to vault at generic path\n base = pref.nil? ? \"secret\" : pref\n File.join(base, project, stack_name, parameter)\n else\n base = pref.nil? ? \"cubbyhole\" : pref\n # or for local dev use cubbyhole\n File.join(base, project, stack_name, parameter)\n end\n vault_path\n end",
"def manifest_path\n path = @config[\"manifest\"][\"path\"] if @config[\"manifest\"]\n return Licensed::Git.repository_root.join(path) if path\n\n @config.cache_path.join(\"manifest.json\")\n end",
"def chef_repo_path\n File.join(ENV['HOME'], '.kitchen', \"pantry_#{config[:port]}\")\n end",
"def get_local_dir\n return @resource[:local_dir]\n end",
"def config_file\n File.join(root, 'config.yml')\n end",
"def fixture_path\n File.join(__dir__, '../chef/fixtures')\n end",
"def path_for(package)\n \"#{package.path}.metadata.json\"\n end",
"def relative_path\n @local_path.relative_path_from(@platform.local_path)\n end",
"def path(name,ext='.msgpack')\n Puppet[:lastrunreport]\n end",
"def maintenance_config_file_path\n File.join shared_path, 'config', 'maintenance.json'\n end",
"def load_path\n data[:load_path].nil? ? \"\" : data[:load_path]\n end",
"def root\n default_path = if Dir.glob(\".ufo/.balancer/profiles/*\").empty?\n '.'\n else\n '.ufo'\n end\n path = ENV['BALANCER_ROOT'] || default_path\n Pathname.new(path)\n end",
"def dotfile_path\n return nil if !root_path\n root_path.join(config.global.vagrant.dotfile_name)\n end",
"def path\n @path ||= File.join(folder,\".xHF#{name}\")\n end",
"def config_path\n NginxStage.pun_config_path(user: user)\n end",
"def provider_root(lookup_invocation)\n configuration_path(lookup_invocation).parent\n end",
"def kitchen_yml\n File.join(Dir.pwd, \"kitchen.yml\")\n end",
"def config_file\n \"#{confdir}/config.yml\"\n end",
"def filepath\n\t\t\tFile.join(TsungWrapper.config_dir, 'data', @filename)\n\t\tend"
] | [
"0.6186646",
"0.603547",
"0.6025256",
"0.5864132",
"0.5863631",
"0.5824347",
"0.5793109",
"0.5759246",
"0.5739312",
"0.5705098",
"0.5667579",
"0.5639628",
"0.560354",
"0.5603295",
"0.5563946",
"0.5553217",
"0.55365145",
"0.5533156",
"0.54939014",
"0.5479283",
"0.5479283",
"0.54776335",
"0.54614764",
"0.5445713",
"0.5438251",
"0.5427748",
"0.54156595",
"0.54117715",
"0.53950644",
"0.5381213",
"0.537924",
"0.5363981",
"0.5359303",
"0.5358947",
"0.53494376",
"0.5344033",
"0.5323178",
"0.53061306",
"0.5299846",
"0.52963287",
"0.52760994",
"0.527065",
"0.52603275",
"0.5254187",
"0.52534497",
"0.5245705",
"0.52420926",
"0.5239984",
"0.5234745",
"0.5233769",
"0.5233121",
"0.5227476",
"0.5221934",
"0.522147",
"0.52203363",
"0.52189016",
"0.5212724",
"0.5205619",
"0.52049917",
"0.52012724",
"0.5200104",
"0.5191779",
"0.51874375",
"0.51693296",
"0.5157801",
"0.51553804",
"0.51544577",
"0.51449066",
"0.51367056",
"0.5122004",
"0.5121558",
"0.5117611",
"0.5116238",
"0.51143914",
"0.5108625",
"0.51072395",
"0.50981337",
"0.50956076",
"0.5094588",
"0.5093602",
"0.5088861",
"0.5084095",
"0.5078699",
"0.50772643",
"0.507588",
"0.50726277",
"0.5068862",
"0.50684667",
"0.506714",
"0.5060265",
"0.5047844",
"0.5047309",
"0.5040113",
"0.5040086",
"0.503872",
"0.5037588",
"0.50344455",
"0.5030195",
"0.50286317",
"0.50285685"
] | 0.7937551 | 0 |
Returns a list of pairs of datadir filepaths for the given hiera. The pairs contain the local and target filepaths, respectively. | def hiera_datadirs(hiera)
configpath = hiera_configpath(hiera)
config = YAML.load_file(configpath)
backends = [config[:backends]].flatten
datadirs = backends.map { |be| config[be.to_sym][:datadir] }.uniq
datadirs.map do |datadir|
localpath = File.join('config', 'hieras', hiera, File.basename(datadir))
[localpath, datadir]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paths(arrs)\n arrs.inject([[]]) do |paths, arr|\n arr.map {|e| paths.map {|path| path + [e]}}.flatten(1)\n end\n end",
"def hiera_datadir\n # This output lets us know where Hiera is configured to look on the system\n puppet_lookup_info = run_shell('puppet lookup --explain test__simp__test').stdout.strip.lines\n puppet_config_check = run_shell('puppet agent --configprint manifest').stdout\n\n if puppet_config_check.nil? || puppet_config_check.empty?\n fail(\"No output returned from `puppet config print manifest`\")\n end\n\n puppet_env_path = File.dirname(puppet_config_check)\n\n # We'll just take the first match since Hiera will find things there\n puppet_lookup_info = puppet_lookup_info.grep(/Path \"/).grep(Regexp.new(puppet_env_path))\n\n # Grep always returns an Array\n if puppet_lookup_info.empty?\n fail(\"Could not determine hiera data directory under #{puppet_env_path}\")\n end\n\n # Snag the actual path without the extra bits\n puppet_lookup_info = puppet_lookup_info.first.strip.split('\"').last\n\n # Make the parent directories exist\n run_shell(\"mkdir -p #{File.dirname(puppet_lookup_info)}\", acceptable_exit_codes: [0])\n\n # We just want the data directory name\n datadir_name = puppet_lookup_info.split(puppet_env_path).last\n\n # Grab the file separator to add back later\n file_sep = datadir_name[0]\n\n # Snag the first entry (this is the data directory)\n datadir_name = datadir_name.split(file_sep)[1]\n\n # Constitute the full path to the data directory\n datadir_path = puppet_env_path + file_sep + datadir_name\n\n # Return the path to the data directory\n return datadir_path\nend",
"def get_filepaths(target_dir)\n dirpaths = [target_dir + \"/subnodes\", target_dir + \"/headnodes\"]\n filepaths = []\n dirpaths.each do |dirpath|\n Dir[dirpath+\"/*\"].each do |filepath|\n filepaths << filepath\n end\n end\n return filepaths\n end",
"def find_alternative_paths\n reset\n \n @pairs.reverse!\n find_paths\n @pairs.reverse!\n\n @pairs.map{|pair| pair.path}\n end",
"def hiera_file_names\n return @hiera_file_names if @hiera_file_names\n error \"No #{Noop::Config.dir_path_hiera} directory!\" unless Noop::Config.dir_path_hiera.directory?\n exclude = [ Noop::Config.dir_name_hiera_override, Noop::Config.dir_name_globals, Noop::Config.file_name_hiera_plugins ]\n @hiera_file_names = find_files(Noop::Config.dir_path_hiera, Noop::Config.dir_path_hiera, exclude) do |file|\n file.to_s.end_with? '.yaml'\n end\n end",
"def resolve_paths\n [dataset_dir, parent.dataset_dir]\n end",
"def hiera_configpath(hiera)\n File.join('config', 'hieras', hiera, 'hiera.yaml')\nend",
"def possible_paths(opts)\n # file_names is implemented in each store.\n file_names(opts).map { |file_name| possible_paths_file(opts, file_name) }.flatten\n end",
"def all_data_paths(path)\n each_data_path(path).to_a\n end",
"def SubPaths()\n #puts \"Searching subpaths in #{to_s()}\"\n entries = Dir.entries(AbsolutePath())\n subPaths = []\n \n #puts \"Found entries #{entries}\"\n \n entries.each do |entry|\n if(entry == \"..\" || entry == \".\")\n next\n end\n \n copy = CreateCopy()\n \n #puts \"Copy is #{copy}\"\n \n copy.RelativePath = JoinPaths([copy.RelativePath, entry])\n subPaths.push(copy)\n \n #puts \"Created path #{copy} for entry #{entry}\"\n end\n \n return subPaths\n end",
"def paths\n @paths ||= [\n data_path,\n output_path,\n converted_path,\n converted_fail_path,\n unpacked_path,\n unpacked_fail_path,\n recreated_path,\n ]\n end",
"def file_paths(file_tree, path_so_far = \"\")\n paths = []\n file_tree.keys.each do |key|\n if file_tree[key] == true\n extended_path = path_so_far + \"#{key}\"\n paths << extended_path\n else\n extended_path = path_so_far + \"#{key}/\"\n paths += file_paths(file_tree[key], extended_path)\n end\n end\n paths\nend",
"def get_child_paths(challenge)\n challenge.fetch('children').map {|challenge_name| \"#{challenge_name}.yaml\" }\n end",
"def ingest_paths\n path = Pathname.new(Figgy.config[\"ingest_folder_path\"]).join(ingest_directory)\n return [] unless path.exist?\n path.children.select(&:directory?)\n end",
"def retrieve_dirs(_base, dir, dot_dirs); end",
"def paths\n names = Array.new\n each_tarball_entry { |entry| names << Pathname.new(entry).cleanpath.to_s }\n names - ['.']\n end",
"def find_paths(dir=\"\")\n base = File.join(@source, dir)\n entries = Dir.chdir(base) { filter_entries(Dir[\"*\"]) }\n paths = []\n\n entries.each do |entry|\n absolute_path = File.join(base, entry)\n relative_path = File.join(dir, entry)\n\n if File.directory?(absolute_path)\n paths.concat find_paths(relative_path)\n else\n paths << absolute_path\n end\n end\n paths\n end",
"def guest_paths(folders)\n folders.map { |parts| parts[2] }\n end",
"def binary_tree_paths(root)\n paths = []\n binary_tree_paths_recursive(root, [], paths)\n\n paths.map do |path|\n path.join(\"->\")\n end\nend",
"def mungle_paths(paths)\n return paths if terraform.pre_0_12?\n\n paths.map do |path|\n File.directory?(path) ? path : File.dirname(path)\n end.uniq\n end",
"def possible_paths_for(mappings)\n root_mappings.map{|root|\n mappings.first.map{|inner|\n mappings.last.map{|outer|\n ::File.join(root, inner, outer, '/') }}}.flatten\n end",
"def asset_paths\n search_path.children.select { |n| Cnfs::Core.asset_names.include?(base_name(n)) }.sort\n end",
"def directories\n directory_entries.map{ |f| FileObject[path, f] }\n end",
"def paths\n tree_path = File.join(File.dirname(__FILE__), 'rails_tree')\n [\"\", \"multitest\", \"results\"].inject([tree_path]) do |result, suffix|\n result << File.join(result[-1], suffix)\n end[1..3]\n end",
"def path_arr()\n return @paths\n end",
"def paths\n Array(@ruhoh.cascade.paths.map{|h| h[\"path\"]}).map { |path|\n collection_path = File.join(path, resource_name)\n next unless File.directory?(collection_path)\n\n collection_path\n }.compact\n end",
"def get_local_files_hierarchy(files, hierarchy = { dirs: [], files: [] })\n hierarchy[:files] = files\n\n dirs = files.inject([]) do |res, a|\n res << a.split('/').drop(1).inject([]) do |res, s|\n res << res.last.to_s + '/' + s\n end\n end\n dirs.map(&:pop) # delete last element from each array\n hierarchy[:dirs] = dirs.flatten.uniq\n\n return hierarchy\nend",
"def paths\n Array(config.path).map(&:to_s)\n end",
"def possible_paths_dir(opts)\n # partial_path is implemented in each store.\n @storage_paths.map { |path| File.join(path, partial_path(opts)) }\n end",
"def paths\n end_verts = ends\n paths = []\n vertices.each do |v|\n end_verts.each do |e|\n x = path?(v.id, e.id)\n if x.is_a?(Array)\n x[1] << v.data\n paths << x[1]\n end\n end\n end\n end_verts.each { |e| paths << e.data }\n paths\n end",
"def get_vault_paths(keys = 'secret/')\n # We need to work with an array\n if keys.is_a?(String)\n keys = [keys]\n else\n raise ArgumentError, 'The supplied path must be a string or an array of strings.' unless keys.is_a?(Array)\n end\n\n # the first element should have a slash on the end, otherwise\n # this function is likely being called improperly\n keys.each do |key|\n raise ArgumentError, \"The supplied path #{key} should end in a slash.\" unless key[-1] == '/'\n end\n\n # go through each key and add all sub-keys to the array\n keys.each do |key|\n Vault.logical.list(key).each do |subkey|\n # if the key has a slash on the end, we must go deeper\n keys.push(\"#{key}#{subkey}\") if subkey[-1] == '/'\n end\n end\n\n # Remove duplicates (probably unnecessary), and sort\n keys.uniq.sort\nend",
"def get_relative_paths(paths)\n paths.collect do |p|\n get_relative_path(p)\n end\n end",
"def resolve_downloads_paths!\n info(\"Resolving Downloads path from config.\")\n config[:downloads] = config[:downloads]\n .map do |source, destination|\n source = source.to_s\n destination = destination.gsub(\"%{instance_name}\", instance.name)\n info(\" resolving remote source's absolute path.\")\n unless source.match?('^/|^[a-zA-Z]:[\\\\/]') # is Absolute?\n info(\" '#{source}' is a relative path, resolving to: #{File.join(config[:root_path], source)}\")\n source = File.join(config[:root_path], source.to_s).to_s\n end\n\n if destination.match?('\\\\$|/$') # is Folder (ends with / or \\)\n destination = File.join(destination, File.basename(source)).to_s\n end\n info(\" Destination: #{destination}\")\n if !File.directory?(File.dirname(destination))\n FileUtils.mkdir_p(File.dirname(destination))\n else\n info(\" Directory #{File.dirname(destination)} seems to exist.\")\n end\n\n [ source, destination ]\n end\n nil # make sure we do not return anything\n end",
"def crawl_hiera_directory(directory)\n files = []\n Dir[directory + '/**/*.yaml'].each { |f| files << File.absolute_path(f) }\n return files\n end",
"def archive_paths\n [Pkg::Config.yum_archive_path, Pkg::Config.apt_archive_path, Pkg::Config.freight_archive_path, Pkg::Config.downloads_archive_path, '/opt/tmp-apt'].compact\n end",
"def relative_paths(smart_path)\n root = smart_path.generic_path\n found = []\n @path_index.each do |path|\n found << Pathname(path).relative_path_from(Pathname(root)).to_s if smart_path.valid_path?(path)\n end\n found\n end",
"def absolute_paths_for(relative_path)\n base_directories.inject([]) do |acc, dir|\n f = \"#{dir}/#{relative_path}\"\n File.exists?(f) ? acc << f : acc\n end\n end",
"def directory_paths\n pages.map { |p| File.dirname(p.path).split(\"/\")[0] }.uniq\n end",
"def recursive_find_directories_and_files dirname\r\n base_path = self.class.lookup('ExtAdminSection').path + \"/templates/\"\r\n \r\n directories = []\r\n files = []\r\n \r\n Find.find(File.join(base_path, dirname)) do |path|\r\n if FileTest.directory?(path)\r\n directories << path.gsub(base_path, '')\r\n else\r\n files << path.gsub(base_path, '')\r\n end\r\n end\r\n \r\n return directories, files\r\n end",
"def paths\n trail.paths.dup\n end",
"def subdir_paths(path)\n\tfolder_metadata = @client.metadata(path)\n\tcontents = folder_metadata['contents']\n\n\tsubdir_paths = []\n\tfor i in contents\n\t\tif i['is_dir']\n\t\t\tsubdir_paths << i['path']\n\t\tend\n\tend\n\tsubdir_paths\nend",
"def to_a = @paths.dup",
"def mount_paths_listing\n Dir[\"#{mounts_path}/*\"]\n end",
"def path_array\n a = []\n each_filename { |ea| a << ea }\n a\n end",
"def yay_paths\n\t\t\tresult = [current_path,local_yay_path,global_yay_path]\n\t\t\tgempaths.each { |v| \n\t\t\t\tresult.push gempath_to_yaypath(v)\n\t\t\t}\n\t\t\treturn result\n\t\tend",
"def paths\n @trail.paths.dup\n end",
"def directories\n directory.directoires\n end",
"def get_remote_files_hierarchy(files, root = '/', hierarchy = { dirs: [], files: [] })\n files.each do |node|\n case node['node_type']\n when 'directory'\n hierarchy[:dirs] << \"#{root}#{node['name']}\"\n get_remote_files_hierarchy(node['files'], root + node['name'] + '/', hierarchy)\n when 'file'\n hierarchy[:files] << \"#{root}#{node['name']}\"\n end\n end\n\n hierarchy\nend",
"def asset_paths\n paths = @parts.values.map(&:asset_path)\n paths << File.dirname(script) if script\n paths << File.dirname(stylesheet) if stylesheet\n paths.compact.uniq\n end",
"def file_paths\n @file_paths ||= begin\n files = []\n each_file do |path|\n files << path\n end\n files\n end\n end",
"def file_paths\n @file_paths ||= begin\n files = []\n each_file do |path|\n files << path\n end\n files\n end\n end",
"def filepaths\n object.object_files.map(&:relative_path)\n end",
"def all_data_dirs(path)\n each_data_dir(path).to_a\n end",
"def get_file_absolute_paths path\n get_file_names(path).map { |file| File.join(path, file) }\n end",
"def get_remote_files_hierarchy(files, root = '/', hierarchy = { dirs: [], files: [] })\n files.each do |node|\n case node['node_type']\n when 'directory'\n hierarchy[:dirs] << \"#{root}#{node['name']}\"\n get_remote_files_hierarchy(node['files'], root + node['name'] + '/', hierarchy)\n when 'file'\n hierarchy[:files] << \"#{root}#{node['name']}\"\n end\n end\n\n return hierarchy\nend",
"def paths\n @paths ||= []\n @paths\n end",
"def paths\n @paths ||= []\n @paths\n end",
"def get_chef_files_absolute_paths path\n get_file_absolute_paths(path).select { |file| is_valid_chef_component_file?(file) }\n end",
"def resolve_paths names\n if names.any?\n paths = []\n for name in names\n paths.concat Array(resolve_name name)\n end\n paths\n else\n Array(resolve_as_directory test_dir_name)\n end\n end",
"def get_to_links\n to_links = []\n\n dotfiles_dir = File.dirname(__FILE__)\n\n Dir.entries(dotfiles_dir).each do |filename|\n if File.directory? filename and not $exclude_list.include? filename\n subfiles = Dir.entries File.join dotfiles_dir, filename\n\n subfiles.each do |sfilename|\n if not sfilename.eql? '..' and not sfilename.eql? '.'\n full_path = File.join dotfiles_dir, filename, sfilename\n to_links << full_path\n end\n end\n\n end\n end\n\n to_links\nend",
"def resolve_paths names\n if context.tag_filters.any?\n # Bats doesn't support tags\n []\n elsif names.any?\n paths = []\n for name in names\n paths.concat Array(resolve_name name)\n end\n paths\n else\n [test_dir]\n end\n end",
"def get_directories_absolute_paths path\n dir_list = Dir[\"#{path}/*/\"]\n \n #Remove unnecessary directories\n dir_list.delete(File.join(path, \".\"))\n dir_list.delete(File.join(path, \"..\"))\n \n dir_list\n end",
"def all_related_data_files\n via_assay = related_assays.collect do |assay|\n assay.data_file_masters\n end.flatten.uniq.compact\n via_assay | related_data_files\n end",
"def common_dir(*paths)\n fail ArgumentError, 'At least one path is required' if paths.empty?\n\n paths.map do |path|\n new(path).dirname.ascendants\n end.inject(:&).first\n end",
"def _get_paths(params = {})\n zone = params[:zone]\n noverify = (params[:noverify] == 1) # TODO this is unused atm\n dmid = get_dmid(params[:domain])\n devices = refresh_device or raise MogileFS::Backend::NoDevicesError\n urls = []\n sql = <<-EOS\n SELECT fid FROM file\n WHERE dmid = #{dmid} AND dkey = '#{@my.quote(params[:key])}'\n LIMIT 1\n EOS\n\n res = query(sql).fetch_row\n res && res[0] or raise MogileFS::Backend::UnknownKeyError\n fid = res[0]\n sql = \"SELECT devid FROM file_on WHERE fid = '#{@my.quote(fid)}'\"\n query(sql).each do |devid,|\n unless devinfo = devices[devid.to_i]\n devices = refresh_device(true)\n devinfo = devices[devid.to_i] or next\n end\n devinfo[:readable] or next\n port = devinfo[:http_get_port]\n host = zone && zone == 'alt' ? devinfo[:altip] : devinfo[:hostip]\n uri = uri_for(devid, fid)\n urls << \"http://#{host}:#{port}#{uri}\"\n end\n urls\n end",
"def collect_paths(*paths)\n raw = [] # all paths and globs\n plus = Set.new # all paths to expand and add\n minus = Set.new # all paths to remove from plus set\n\n # assemble all globs and simple paths, reforming our glob notation to ruby globs\n paths.each do |paths_container|\n case (paths_container)\n when String then raw << (FilePathUtils::reform_glob(paths_container))\n when Array then paths_container.each {|path| raw << (FilePathUtils::reform_glob(path))}\n else raise \"Don't know how to handle #{paths_container.class}\"\n end\n end\n\n # iterate through each path and glob\n raw.each do |path|\n\n dirs = [] # container for only (expanded) paths\n\n # if a glob, expand it and slurp up all non-file paths\n if path.include?('*')\n # grab base directory only if globs are snug up to final path separator\n if (path =~ /\\/\\*+$/)\n dirs << FilePathUtils.extract_path(path)\n end\n\n # grab expanded sub-directory globs\n expanded = @file_wrapper.directory_listing( FilePathUtils.extract_path_no_aggregation_operators(path) )\n expanded.each do |entry|\n dirs << entry if @file_wrapper.directory?(entry)\n end\n\n # else just grab simple path\n # note: we could just run this through glob expansion but such an\n # approach doesn't handle a path not yet on disk)\n else\n dirs << FilePathUtils.extract_path_no_aggregation_operators(path)\n end\n\n # add dirs to the appropriate set based on path aggregation modifier if present\n FilePathUtils.add_path?(path) ? plus.merge(dirs) : minus.merge(dirs)\n end\n\n return (plus - minus).to_a.uniq\n end",
"def get_paths(namespace = MAIN_NAMESPACE)\n @paths[namespace] || []\n end",
"def related_data_files\n via_assay = assays.collect(&:data_files).flatten.uniq.compact\n via_assay | data_files\n end",
"def hiera_plugins\n return @hiera_plugins if @hiera_plugins\n @hiera_plugins = {}\n return @hiera_plugins unless Noop::Config.file_path_hiera_plugins.directory?\n Noop::Config.file_path_hiera_plugins.children.each do |hiera|\n next unless hiera.directory?\n hiera_name = hiera.basename.to_s\n hiera.children.each do |file|\n next unless file.file?\n next unless file.to_s.end_with? '.yaml'\n file = file.relative_path_from Noop::Config.dir_path_hiera\n @hiera_plugins[hiera_name] = [] unless @hiera_plugins[hiera_name]\n @hiera_plugins[hiera_name] << file\n end\n end\n @hiera_plugins\n end",
"def getDirs dir\n\t\tFind.find(dir)\t\n\tend",
"def directories\n @directories.values\n end",
"def paths(reload = false)\n thread_local_store.keys(reload).map(&:to_s)\n end",
"def data_path(match, options={})\n found = []\n systems.each do |system|\n found.concat system.data_path(match, options)\n end\n found.uniq\n end",
"def get_paths\n id = @data.delete('id')\n storage_volume_attachment = get_single_resource_instance\n if id\n get_path_by_id(storage_volume_attachment, id)\n else\n get_all_paths(storage_volume_attachment)\n end\n true\n end",
"def pathlist\n @path\n end",
"def dir_list\n path_from_env || default_path\n end",
"def init_paths\n drive = session.sys.config.getenv('SystemDrive')\n\n files =\n [\n 'unattend.xml',\n 'autounattend.xml'\n ]\n\n target_paths =\n [\n \"#{drive}\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\sysprep\\\\\",\n \"#{drive}\\\\Windows\\\\panther\\\\\",\n \"#{drive}\\\\Windows\\\\Panther\\Unattend\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\\"\n ]\n\n paths = []\n target_paths.each do |p|\n files.each do |f|\n paths << \"#{p}#{f}\"\n end\n end\n\n # If there is one for registry, we add it to the list too\n reg_path = get_registry_unattend_path\n paths << reg_path unless reg_path.empty?\n\n return paths\n end",
"def filePaths\n result = OpenStudio::PathVector.new\n if @workflow[:file_paths]\n @workflow[:file_paths].each do |file_path|\n result << OpenStudio.toPath(file_path)\n end\n else\n result << OpenStudio.toPath('./files')\n result << OpenStudio.toPath('./weather')\n result << OpenStudio.toPath('../../files')\n result << OpenStudio.toPath('../../weather')\n result << OpenStudio.toPath('./')\n end\n result\n end",
"def default_assembly_paths\n paths = []\n paths.concat %w( bin ).map{ |dir| \"#{root_path}/#{dir}\"}.select{ |dir| File.directory?(dir) }\n end",
"def metadata_paths(path)\n arr = []\n @metadata_tree.with_subtree(path, nil, nil, nil) do |node|\n arr << node.doc_path\n end\n arr\n end",
"def all_paths_source_target(graph)\n current_path = []\n results = []\n\n dfs(graph, results, 0, current_path)\n return results\nend",
"def directories\n [root_path, deploys_path, shared_path,\n log_path, checkout_path, scripts_path]\n end",
"def paths_to_array\n [{:paths => paths.collect {|p| p.to_array}}]\n end",
"def paths\n root.paths\n end",
"def taken_paths\n if @target.exist?\n @target.children.select { |path| jobdir_name?(path.basename.to_s) }\n else\n []\n end\n end",
"def list\n Dir.glob(\"#{@directory}/**/*\").reject(&File.directory?).map do |p|\n Pathname.new(p).relative_path_from(@directory)\n end\n end",
"def jurisdiction_paths(patients)\n jurisdiction_paths = Hash[Jurisdiction.find(patients.pluck(:jurisdiction_id).uniq).pluck(:id, :path).map { |id, path| [id, path] }]\n patients_jurisdiction_paths = {}\n patients.each do |patient|\n patients_jurisdiction_paths[patient.id] = jurisdiction_paths[patient.jurisdiction_id]\n end\n patients_jurisdiction_paths\n end",
"def breadcrumb_files\n Dir[*Gretel.breadcrumb_paths]\n end",
"def iterate_over_file_paths\n parsed_file.each do |hit|\n file_path_array << hit[0]\n end\n file_path_array\n end",
"def find_paths(&block)\n follow,kill,find,continue = SearchParams.process(&block)\n\n paths,path = [],[]\n search = lambda do |node|\n if find[node]\n paths << path.dup\n next if not continue[node]\n end\n next if kill[node]\n [*follow[node]].each do |n|\n next if path.include? n\n path.push(n)\n search[n]\n path.pop\n end\n end\n\n [*follow[self]].each do |n| \n path.push(n)\n search[n] \n path.pop\n end\n\n paths\n end",
"def get_bag_paths\n bag_paths = Array.new\n \n Dir.glob(@path).each do |entry|\n if !(File.directory? entry) || entry == \".\" || entry == \"..\"\n next\n end\n \n bag_paths.push entry\n end\n \n return bag_paths\n end",
"def san_paths\n san_array_node = self.sans.first.san_array_node\n return [] if san_array_node.nil?\n x = san_array_node.san_interfaces\n return [] if x.length < 1\n xx = x.enum_slice((x.length / 2)).to_a \n # permitation of san controllers\n san_port_array = xx.first.zip(xx.last).flatten(1)\n san_interfaces.map{|saniface| [saniface.first, \n san_port_array[saniface.last.split('.').last.to_i % san_port_array.length].last] }\n end",
"def build_paths\n mapping = {}\n mapping_config.each do |config|\n config['paths'].each do |path|\n next unless data_dir.start_with?(path) || path.start_with?(data_dir) || data_dir.empty?\n\n data_files(config, path).each do |filepath|\n # First matching config wins\n mapping[filepath] ||= config\n end\n end\n end\n mapping\n end",
"def GetDirectoryPathsFromRelativeBase(path)\n pathParts = path.RelativePathParts\n paths = []\n for i in 1..pathParts.length\n\tsubPath = ProjectPath.new(JoinPaths(pathParts.slice(0, i)))\n\tpaths.push(subPath)\n end\n return paths\n end",
"def files(uri)\n [].tap do |ary|\n ary.concat Dir[uri]\n search_paths.each { |p| ary.concat Dir[File.join p, uri] }\n end\n end",
"def _get_index_dir_paths(vendor_product_id, year=nil)\n paths=[]\n path=\"#{root_path}/index\"\n\n if year.nil?\n\n # get list of all year subdirectories\n\n Dir.entries(path).each { |year_subdir|\n\n next if year_subdir == '.' || year_subdir == '..'\n\n tmp=\"#{path}/#{year_subdir}/#{vendor_product_id}\"\n paths << tmp if Dir.exist? tmp\n }\n\n else\n paths << \"#{path}/#{year}/#{vendor_product_id}\"\n end\n\n paths\n end",
"def get_remote_files_hierarchy(files, root = '/', hierarchy = { dirs: [], files: [] })\n files.each do |node|\n case node['node_type']\n when 'branch'\n get_remote_files_hierarchy(node['files'], root + node['name'] + '/', hierarchy)\n when 'directory'\n hierarchy[:dirs] << \"#{root}#{node['name']}\"\n get_remote_files_hierarchy(node['files'], root + node['name'] + '/', hierarchy)\n when 'file'\n hierarchy[:files] << \"#{root}#{node['name']}\"\n end\n end\n\n return hierarchy\nend",
"def dirs_until_dodona_dir\n dir = @pwd\n children = [dir]\n loop do\n return [] if dir.root?\n return children if dir == @dodona_dir\n children.unshift dir\n dir = dir.parent\n end\n end",
"def common_directory paths\n dirs = paths.map{|path| path.split('/')}\n min_size = dirs.map{|splits| splits.size}.min\n dirs = dirs.map{|splits| splits[0...min_size]}\n uncommon_idx = dirs.transpose.each_with_index.find{|dirnames, idx| dirnames.uniq.length > 1}.last\n dirs[0][0...uncommon_idx].join('/')\n end",
"def relativize_paths(paths)\n return paths unless relativize_paths?\n paths.map do |path|\n path.gsub(%r{^#{@directory}/}, '')\n end\n end"
] | [
"0.60336673",
"0.60256386",
"0.601235",
"0.5936207",
"0.58613276",
"0.5835206",
"0.5623412",
"0.5613568",
"0.5536183",
"0.5530625",
"0.55179334",
"0.54826343",
"0.5477433",
"0.54733324",
"0.54641217",
"0.54577374",
"0.5449669",
"0.54428285",
"0.54393405",
"0.54370093",
"0.5435863",
"0.54167724",
"0.5403071",
"0.5398695",
"0.5380466",
"0.5363615",
"0.53459734",
"0.5335459",
"0.53343964",
"0.53174764",
"0.5297912",
"0.52971685",
"0.5288668",
"0.5279543",
"0.527529",
"0.5271327",
"0.5268954",
"0.52568537",
"0.5256287",
"0.5256225",
"0.5247426",
"0.52388376",
"0.5231342",
"0.5220259",
"0.521533",
"0.52104646",
"0.5205425",
"0.5202702",
"0.5196766",
"0.5194035",
"0.51915497",
"0.51809937",
"0.5173993",
"0.51678544",
"0.51659936",
"0.51624143",
"0.51624143",
"0.515438",
"0.5153387",
"0.5149817",
"0.51495075",
"0.51483107",
"0.51024145",
"0.5099664",
"0.50985384",
"0.50971985",
"0.50966704",
"0.5091512",
"0.50896984",
"0.50867087",
"0.50834346",
"0.50806403",
"0.5078622",
"0.50690764",
"0.506585",
"0.50650644",
"0.5059848",
"0.5045463",
"0.50454307",
"0.50387686",
"0.50380695",
"0.5037294",
"0.50309527",
"0.50154454",
"0.5013609",
"0.5012526",
"0.50097483",
"0.499748",
"0.49969172",
"0.49871188",
"0.49828282",
"0.4977001",
"0.49728286",
"0.49717933",
"0.49695897",
"0.4968351",
"0.4967442",
"0.49604768",
"0.49601495",
"0.49590546"
] | 0.7555087 | 0 |
GET /lists/1 GET /lists/1.xml | def show
@list = List.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @list }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @list_items }\n end\n end",
"def get_list(list_id)\n rest(\"get\", \"lists/#{list_id}\")\n end",
"def index\n @lists = List.find(:all)\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @lists }\n end\n end",
"def show\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_item }\n end\n end",
"def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list }\n end\n end",
"def get_list(user, list)\n get(\"/#{user}/lists/#{list}.json\")\n end",
"def index\n @list = List.find(params[:list_id])\n @items = @list.items\n\n respond_with @items\n end",
"def list\n get('/')\n end",
"def list\n url = prefix + \"list\"\n return response(url)\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def index\n @todo_lists = TodoList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @todo_lists }\n end\n end",
"def index(list_name, site_path = '', fields = [])\n url = computed_web_api_url(site_path)\n url = \"#{url}lists/GetByTitle('#{odata_escape_single_quote(list_name)}')/items\"\n url += \"?$select=#{fields.join(\",\")}\" if fields\n\n process_url( uri_escape(url), fields )\n end",
"def index\n @file_list = UploadedFileList.find(params[:uploaded_file_list_id])\n @file_list_items = @file_list.file_list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @file_list_items }\n end\n end",
"def get_lists(options={})\n visibility = options[:visibility]\n list_type = options[:list_type]\n folder_id = options[:folder_id]\n include_all_lists = options[:include_all_lists]\n include_tags = options[:include_tags]\n\n raise ArgumentError, \"visibility option is required\" unless visibility\n raise ArgumentError, \"list_type option is required\" unless list_type\n\n request_body = ''\n xml = Builder::XmlMarkup.new(:target => request_body, :indent => 1)\n\n xml.instruct!\n xml.Envelope do\n xml.Body do\n xml.GetLists do\n xml.VISIBILITY visibility\n xml.LIST_TYPE list_type\n xml.FOLDER_ID folder_id if folder_id.present?\n xml.INCLUDE_ALL_LISTS 'true' if include_all_lists.present?\n xml.INCLUDE_TAGS 'true' if include_tags.present?\n end\n end\n end\n\n doc = send_xml_api_request(request_body)\n result_dom(doc)['LIST']\n end",
"def index\n @article_lists = ArticleList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @article_lists }\n end\n end",
"def index\n @thing_lists = ThingList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @thing_lists }\n end\n end",
"def index\n @email_lists = EmailList.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @email_lists }\n end\n end",
"def list\n url = prefix + \"list\"\n return response(url)\n end",
"def show\n @mylist = Mylist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mylist }\n end\n end",
"def get_lists\n response = rest(\"get\", \"lists\")\n\n return response[\"lists\"]\n end",
"def show\n @list = List.find(params[:id])\n respond_with(@list)\n end",
"def index\n @playlists = Playlist.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playlists.to_xml }\n end\n end",
"def show\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(params[:list_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_item }\n end\n end",
"def get_list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/\", params)\n end",
"def index\n @list_items = List.find(params[:list_id]).list_items\n\n render json: @list_items\n end",
"def list(id)\n get(\"lists/#{id}\").list\n end",
"def get_list(id)\n record \"/todos/list/#{id}\"\n end",
"def show\n @list = current_project.lists.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"def list\n call(:get, path)\n end",
"def list\n get()\n end",
"def index\n @contact_lists = ContactList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contact_lists }\n end\n end",
"def index\n @warehouse_lists = get_warehouse_lists(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @warehouse_lists }\n end\n end",
"def list(*args)\n fail \"Unacceptable HTTP Method #{request.env['REQUEST_METHOD']} for list\" unless request.get?\n {:action => 'list',\n :args => args}\n end",
"def show\n @todo_list = TodoList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @todo_list }\n end\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/list\", params)\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/list\", params)\n end",
"def list_items_list(page_id = current_page_id, list_id = current_list_id)\n request \"page/#{page_id}/lists/#{list_id}/items/list\"\n end",
"def index\n @list_items = @list.list_items\n end",
"def index\n @lists = List.all\n @list = List.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def index\n @product_lists = ProductList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @product_lists }\n end\n end",
"def show\n @list_record = ListRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_record }\n end\n end",
"def show\n @list = List.find(params[:id])\n end",
"def show\n @list = List.find(params[:id])\n end",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def show\n @list = List.find(params[:id])\n end",
"def index\n @lists = current_project.lists\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def show\n @list_view = ListView.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_view }\n end\n end",
"def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"def test_list\n @builder.write_list('http://lancaster.myreadinglists.org/lists/4510B70F-7C50-D726-4A6C-B129F5EABB2C')\n end",
"def show\n @file_list = UploadedFileList.find(params[:uploaded_file_list_id])\n @file_list_item = @file_list.file_list_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @file_list_item }\n end\n end",
"def lists\n client.get_lists\n end",
"def get_lists(user)\n get(\"/#{user}/lists.json\")\n end",
"def index\n @wish_lists = WishList.find(:all, :order => 'created_at DESC').paginate :per_page => 20, :page => params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wish_lists }\n end\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}\", params)\n end",
"def show\n @order_list = OrderList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @order_list }\n end\n end",
"def set_list\n @list = @lists.find(params[:id])\n end",
"def start_list\n unless params[:version] == '2.0.3'\n raise ActionController::RoutingError.new('Not Found')\n end\n\t\t\n @event = Event.find(params[:id])\n respond_to do |format|\n format.xml { render :layout => false }\n end\n end",
"def show\n @checklist = Checklist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @checklist }\n end\n end",
"def show\n @thing_list = ThingList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"def create_list(name)\n path = \"lists\"\n params = { list: { name: name }}\n list = request(path, params, :post)\n list_id = list[:id]\n # output full list again\n show_list(list_id)\n end",
"def find_list\n @list = List.find(params[:id])\n end",
"def index\n @lists = List.all\n\n end",
"def index\n @tasks = current_user.lists.find(params[:list_id]).tasks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end",
"def index\n @runlists = Runlist.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @runlists }\n end\n end",
"def show\n @article_list = ArticleList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @article_list }\n end\n end",
"def new\n\t\t@list = List.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @list }\n\t\tend\n\tend",
"def index\n @list_cats = ListCat.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @list_cats }\n end\n end",
"def index\n @lists = @user.lists\n end",
"def getLists()\n url = \"https://api.nytimes.com/svc/books/v3/lists/names.json\"\n params = {}\n self.request(url, params)\n end",
"def index\n @shopping_lists = ShoppingList.find_all_by_user_id(session[:user_id])\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @shopping_lists }\n end\n end",
"def index\n @quote_lists = QuoteList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quote_lists }\n end\n end",
"def show\n @mailee_list = Mailee::List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mailee_list }\n end\n end",
"def index\n @lists = current_user.lists.includes(:tasks)\n @list_feeds = current_user.list_feeds.eager_build\n respond_with(@lists)\n end",
"def new\n @mylist = Mylist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mylist }\n end\n end",
"def find_list\n @list = @topic.lists.find(params[:list_id])\n end",
"def show\n @action_list = ActionList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @action_list }\n end\n end",
"def get_list_id(client,list_name)\n puts \"Getting the listName\" if @enable_debug_logging\n # Send the request to get the list info\n begin\n response = client.request(:get_list) do\n soap.body = {:listName => list_name}\n end\n rescue Savon::SOAP::Fault\n raise StandardError, \"The list '#{@parameters['list_name']}' cannot be found on the Sharepoint site\"\n rescue Exception => ex\n raise\n end\n\n # Retrieving the from the response\n return response.body[:get_list_response][:get_list_result][:list][:@name]\n end",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def index\n @blacklists = Blacklist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blacklists }\n end\n end",
"def index\n @url_lists = UrlList.all\n end",
"def show\n @group_list = GroupList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def get_list(list_name)\n @lib.get_list(list_name)\n end",
"def show\n @page_title = \"Task List\"\n @task_list = TaskList.find(params[:id])\n @tasks = Task.find(:all,\n :conditions => [\"task_list_id = ?\",@task_list.id]\n ) \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @task_list }\n end\n end",
"def lists\n result1 = call(\"Lists\", \"get_list_collection\")\n result2 = call(\"SiteData\", \"get_list_collection\")\n result2_by_id = {}\n result2.xpath(\"//sp:_sList\", NS).each do |element|\n data = {}\n element.children.each do |ch|\n data[ch.name] = ch.inner_text\n end\n result2_by_id[data[\"InternalName\"]] = data\n end\n result1.xpath(\"//sp:List\", NS).select { |list| list[\"Title\"] != \"User Information List\" }.map do |list|\n List.new(self, list[\"ID\"].to_s, list[\"Title\"].to_s, clean_attributes(list.attributes), result2_by_id[list[\"ID\"].to_s])\n end\n end",
"def show\n respond_to do |format|\n format.html\n format.json { render json: { status: 200, item: @list } }\n end\n end",
"def index\n @details = @listing.details.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @details }\n end\n end",
"def update\n @list = current_user.lists.find(params[:id])\n @list.update_attributes(params[:list])\n respond_with(@list, :location => my_list_url(@list))\n end",
"def show\n authenticate\n list = List.find(params[:id])\n items = list.items\n render json: {\n items: items,\n id: list.id\n }\n end",
"def index\n @lists = @organization.lists.all\n end",
"def lists\n Resources::Lists.new(self)\n end",
"def path\n \"/{databaseId}/items/list/\"\n end",
"def index\n @list_items = ListItem.all\n end",
"def index\n @list_items = ListItem.all\n end"
] | [
"0.7345432",
"0.73375726",
"0.72963923",
"0.692",
"0.69010794",
"0.66984206",
"0.6689478",
"0.6685211",
"0.6613234",
"0.6560278",
"0.6535424",
"0.6491924",
"0.6469646",
"0.6468288",
"0.6423837",
"0.6400867",
"0.6386313",
"0.6374874",
"0.63511574",
"0.63160855",
"0.6299484",
"0.6291888",
"0.62632823",
"0.62532765",
"0.6238775",
"0.62337327",
"0.6232398",
"0.6227126",
"0.6222875",
"0.621071",
"0.6190794",
"0.61863124",
"0.6185842",
"0.6179854",
"0.61739385",
"0.61739385",
"0.614923",
"0.61311686",
"0.61256623",
"0.6118939",
"0.60966074",
"0.60883516",
"0.60883516",
"0.60804325",
"0.6078664",
"0.6057629",
"0.60533863",
"0.6044454",
"0.6044454",
"0.6044454",
"0.6044454",
"0.603505",
"0.6026242",
"0.6025526",
"0.60201037",
"0.60192996",
"0.60176134",
"0.60176134",
"0.60176134",
"0.60176134",
"0.6016812",
"0.6013424",
"0.60084367",
"0.6008073",
"0.6006153",
"0.60055536",
"0.59868383",
"0.59819174",
"0.59797865",
"0.59783536",
"0.59574974",
"0.5948022",
"0.59131485",
"0.5892786",
"0.5889614",
"0.58737993",
"0.58735764",
"0.5873022",
"0.5855423",
"0.5854921",
"0.5854432",
"0.5853108",
"0.5831756",
"0.58289355",
"0.5825039",
"0.57992965",
"0.57831186",
"0.57828116",
"0.5780366",
"0.5771106",
"0.57710224",
"0.57668215",
"0.5764066",
"0.57636374",
"0.5756262",
"0.5756045",
"0.57542276",
"0.57528424",
"0.5751107",
"0.5751107"
] | 0.6892642 | 5 |
GET /lists/new GET /lists/new.xml | def new
@list = List.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @list }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @list = List.find(params[:id])\n @todolist = @list.todolists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todolist }\n end\n end",
"def new\n @mylist = Mylist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mylist }\n end\n end",
"def new\n @thing_list = ThingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"def new\n @page_title = \"Task List New\"\n @task_list = TaskList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task_list }\n end\n end",
"def new\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list_item }\n end\n end",
"def new\n @list = current_user.lists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @list = List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @list = List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @list = List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @todo_list = TodoList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todo_list }\n end\n end",
"def new\n @list = List.find(params[:list_id])\n @item = @list.items.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n end\n end",
"def new\n @list_view = ListView.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_view }\n end\n end",
"def new\n @action_list = ActionList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @action_list }\n end\n end",
"def new\n @list = @project.lists.new\n\n respond_to do |format|\n format.html { render layout: 'form' }# new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @list_record = ListRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_record }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @email_list = EmailList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email_list }\n end\n end",
"def new\n @order_list = OrderList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @order_list }\n end\n end",
"def new\n @user = User.new\n get_list\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @user }\n end\n end",
"def new\n @data_list = DataList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @data_list }\n end\n end",
"def new\n @mailinglist = Mailinglist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailinglist }\n end\n end",
"def new\n @whitelist = Whitelist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @whitelist }\n end\n end",
"def new\n @todo = @list.todos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todo }\n end\n end",
"def new\n @item = Item.new(:list_id => params[:list_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @item }\n end\n end",
"def create_list(name)\n path = \"lists\"\n params = { list: { name: name }}\n list = request(path, params, :post)\n list_id = list[:id]\n # output full list again\n show_list(list_id)\n end",
"def new\n @listing = Listing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @listing }\n end\n end",
"def new\n @draft_list = DraftList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @draft_list }\n end\n end",
"def new\n return error_status(true, :cannot_create_listitem) unless (ListItem.can_be_created_by(@logged_user, @list))\n \n @list_item = @list.list_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_item }\n end\n end",
"def new\n @list = List.new\n\n @list.list_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @book_list = BookList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book_list }\n end\n end",
"def new\n @wordlist = Wordlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wordlist }\n end\n end",
"def new\n @list_cat = ListCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_cat }\n end\n end",
"def new\n @wish_list = WishList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wish_list }\n end\n end",
"def new\n @group_list = GroupList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def new\n @task = Task.new(:task_list => TaskList.find(params[:task_list_id]))\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end",
"def new\n @fwlist = Fwlist.new\n \t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fwlist }\n end\n end",
"def new\n @list_of_value = Irm::ListOfValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_of_value }\n end\n end",
"def new\n @todos = Todos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todos }\n end\n end",
"def new\n @show_set_list = show.show_set_lists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @show_set_list }\n end\n end",
"def new\n @news_list = NewsList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_list }\n end\n end",
"def new\n @reminder_task_list = ReminderTaskList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reminder_task_list }\n end\n end",
"def new\n @tipo_lista = TipoLista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_lista }\n end\n end",
"def new\n @twitter_list = TwitterList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @twitter_list }\n end\n end",
"def new\n @favourites = Favourites.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @favourites }\n end\n end",
"def new\n @lista_precio = ListaPrecio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lista_precio }\n end\n end",
"def new\n @liste = Liste.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @liste }\n end\n end",
"def new\n @list_field_value = ListFieldValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_field_value }\n end\n end",
"def create_list(name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"post\", \"lists\", data)\n end",
"def new\n @task_list = @project.task_lists.new\n\n respond_with @task_lists\n end",
"def new\n @play_list = PlayList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @play_list }\n end\n end",
"def new\n @task = current_user.lists.find(params[:list_id]).tasks.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n end\n end",
"def new\n @program_list= Programlist.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @program_list}\n end\n end",
"def create\n @mylist = Mylist.new(params[:mylist])\n\n respond_to do |format|\n if @mylist.save\n format.html { redirect_to(@mylist, :notice => 'Mylist was successfully created.') }\n format.xml { render :xml => @mylist, :status => :created, :location => @mylist }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mylist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @shopping_list = ShoppingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shopping_list }\n end\n end",
"def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task_list }\n end\n end",
"def new\n @mat_list = MatList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mat_list }\n end\n end",
"def new\n @playlist = Playlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @playlist }\n end\n end",
"def new\n\n @mailee_list = Mailee::List.new :name => '', :active => '', :company => '', :description => '', :address => '', :phone => '', :site => ''\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailee_list }\n end\n end",
"def new\n @todo_list = TodoList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todo_list }\n end\n end",
"def get_all_new\n uri = [@@base_uri, 'all', 'getAllNew'].join('/')\n return get(uri)\n end",
"def new\n @todo = Todo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todo }\n end\n end",
"def new\n @todo = Todo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todo }\n end\n end",
"def new\n @listing_status = ListingStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @listing_status }\n end\n end",
"def new\n @price_list = PriceList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @price_list }\n end\n end",
"def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"def new\n @product_list = ProductList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_list }\n end\n end",
"def new\n respond_to do |format|\n format.html\n format.xml\n end\n end",
"def new\n @todo_list = TodoList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=>@todo_list}\n end\n end",
"def new\n @army_list = ArmyList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @army_list }\n end\n end",
"def new\n\t\t@list_config = ListConfig.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @list_config }\n\t\t\tformat.json { render :json => @list_config }\n\t\t\tformat.yaml { render :text => @list_config.to_yaml, :content_type => 'text/yaml' }\n\t\tend\n\tend",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end",
"def create\n @list = current_user.lists.new(new_list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to my_list_path(@list), notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: my_list_path(@list) }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"def new\n @wish_list_item = WishListItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wish_list_item }\n end\n end",
"def create\n @list = current_user.lists.build(params[:list])\n location = @list.save ? my_list_url(@list.id) : new_my_list_url\n respond_with(@list, :location => location )\n end",
"def new\n @blacklist = Blacklist.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @blacklist }\n end\n end",
"def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end",
"def new\n @to_do_list = ToDoList.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @to_do_list }\n end\n end",
"def new\n @lista = Lista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lista }\n end\n end",
"def create_list(params={})\n @obj.post('create-list', @auth.merge(params))\n end",
"def new\n @listing = Listing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.fbml # new.fbml.erb\n format.xml { render :xml => @listing }\n end\n end",
"def new\n @assistance_list = AssistanceList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assistance_list }\n end\n end",
"def new\n @movie_list = MovieList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie_list }\n end\n end",
"def new\n @search_list = SearchList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_list }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end",
"def new\n @item = Item.factory('local')\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"def new\n @ota_code_list_list = Ota::CodeList::List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ota_code_list_list }\n end\n end",
"def create\n @list = List.create!(list_params)\n json_response(@list, :created)\n end",
"def new\n\t\t@list = current_user.lists.find params[:list_id]\n\t\t@item = @list.items.build\n\tend",
"def new\n @stringlist = Stringlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stringlist }\n end\n end",
"def new\n @runlist = Runlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @runlist }\n end\n end",
"def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"def index\n @lists = List.all\n @list = List.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @import }\n end\n end",
"def new\n @chore_list = ChoreList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chore_list }\n end\n end",
"def new\n @checklist = Checklist.new\n @studentID = session[:userID]\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @checklist }\n end\n end",
"def create(name)\n Iterable.request(conf, '/lists').post(name: name)\n end",
"def new\n @checklist = Checklist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @checklist }\n end\n end"
] | [
"0.70856327",
"0.7079035",
"0.7074122",
"0.7035158",
"0.7033077",
"0.7019581",
"0.70163757",
"0.70163757",
"0.70163757",
"0.6988978",
"0.6954271",
"0.6898971",
"0.68669724",
"0.68494916",
"0.6849325",
"0.6820026",
"0.68136185",
"0.67286146",
"0.67181563",
"0.67121124",
"0.6702958",
"0.66846424",
"0.6682427",
"0.6669014",
"0.6667295",
"0.6659496",
"0.6656285",
"0.6654883",
"0.66540146",
"0.6644258",
"0.6635661",
"0.6600303",
"0.6592134",
"0.65800464",
"0.6573753",
"0.6566099",
"0.6555203",
"0.6553425",
"0.65187347",
"0.6514034",
"0.65083045",
"0.64991206",
"0.6493844",
"0.6455537",
"0.64365244",
"0.6431602",
"0.6426213",
"0.6421591",
"0.6411501",
"0.6411304",
"0.64086515",
"0.6404638",
"0.63984287",
"0.6390877",
"0.6378413",
"0.6376679",
"0.63748014",
"0.6373648",
"0.63668895",
"0.6358886",
"0.635474",
"0.635474",
"0.634578",
"0.6325388",
"0.63076335",
"0.6303927",
"0.62966394",
"0.6291816",
"0.6289346",
"0.6289045",
"0.6288291",
"0.62854606",
"0.6283284",
"0.6282282",
"0.62815297",
"0.6264405",
"0.6263519",
"0.62631094",
"0.62621266",
"0.62586534",
"0.6250742",
"0.6244591",
"0.62404364",
"0.6236115",
"0.6228196",
"0.62273186",
"0.62200916",
"0.62167436",
"0.6214536",
"0.6213849",
"0.6212941",
"0.62046915",
"0.62036514",
"0.62014943",
"0.61955726",
"0.6188446",
"0.6180845",
"0.6180456",
"0.618009",
"0.61684084"
] | 0.73274845 | 0 |
POST /lists POST /lists.xml | def create
@list = List.new(params[:list])
respond_to do |format|
if @list.save
format.html { redirect_to(@list, :notice => 'List was successfully created.') }
format.xml { render :xml => @list, :status => :created, :location => @list }
@perm = Permission.new(
:add => true,
:edit => true,
:own => true,
:del => true,
:user_id => session[:user_id],
:list_id => @list.id)
@perm.save
else
format.html { render :action => "new" }
format.xml { render :xml => @list.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_list(params={})\n @obj.post('create-list', @auth.merge(params))\n end",
"def create_list(name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"post\", \"lists\", data)\n end",
"def create_list(name)\n path = \"lists\"\n params = { list: { name: name }}\n list = request(path, params, :post)\n list_id = list[:id]\n # output full list again\n show_list(list_id)\n end",
"def create\n @list = List.create!(list_params)\n json_response(@list, :created)\n end",
"def create\n @list = @user.lists.create(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n nested = params[:list].delete(:list_items_attributes)\n\n @list = List.new( params[:list] )\n @list.user = current_user\n\n records = nested.collect do |_, fields| \n\n ListItem.new( { \"list\" => @list }.merge( fields ) ) if !item_blank?( fields )\n\n end.compact\n\n respond_to do |format|\n if @list.save && records.map( &:save ).all?\n\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n\n else\n\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"def create\n list = List.find(params[:list_id])\n @list_item = list.list_items.new(list_items_params)\n @list_item.save ? json_response(@list_item) : json_response(@list_item.errors, status = :not_acceptable)\n end",
"def test_list\n @builder.write_list('http://lancaster.myreadinglists.org/lists/4510B70F-7C50-D726-4A6C-B129F5EABB2C')\n end",
"def create\n @list = List.new(list_params)\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(params[:list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.new(params[:list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(name)\n Iterable.request(conf, '/lists').post(name: name)\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render action: 'show', status: :created, location: @list }\n else\n format.html { render action: 'new' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'Nice Work- List Created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n @list.user = current_user\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.build(params[:list])\n @list.user = current_user\n @user = @list.user\n respond_to do |format|\n if @list.save\n \n format.html { redirect_to root_path, notice: 'List was successfully created!' }\n format.json { render json: @user, status: :created, location: @user }\n else\n @feed_items = []\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(params[:list])\n if @list.save\n redirect_to @list, :notice =>\"List successfully created.\"\n else\n flash[:error] = \"Your list could not be saved.\"\n render :action => \"new\"\n end\n end",
"def create\n @list = current_user.lists.new(new_list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to my_list_path(@list), notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: my_list_path(@list) }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(params[:list])\n @list.feeds_by_id = ''\n @list.user_id = current_user.id\n \n @lists = current_user.lists\n @feeds = current_user.feeds\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to(@list, :notice => 'List was successfully created.') }\n format.xml { render :xml => @list, :status => :created, :location => @list }\n format.js {render :layout => false}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list.errors, :status => :unprocessable_entity }\n format.js {render :layout => false}\n end\n end\n end",
"def create\n @mylist = Mylist.new(params[:mylist])\n\n respond_to do |format|\n if @mylist.save\n format.html { redirect_to(@mylist, :notice => 'Mylist was successfully created.') }\n format.xml { render :xml => @mylist, :status => :created, :location => @mylist }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mylist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@list = List.new(list_params)\n\t\t@list.save\n\t\t\tredirect_to '/tasks'\n\tend",
"def list_params\n params.require(:list).permit(:title, \n :description, \n :list_type_id, \n :list_type,\n list_items_attributes: [:item, :id, :_destroy]\n )\n end",
"def create\n @list = List.new(list_params)\n if @list.save\n \t#flash notice on successful creation of a list\n \tflash[:notice] = \"List successfully added!\"\n redirect_to lists_path(@list)\n else\n render :new\n flash[:alert] = \"ERROR :(\"\n end\n end",
"def create\n @saved_list = SavedList.new(saved_list_params)\n\n respond_to do |format|\n if @saved_list.save\n format.html { redirect_to @saved_list, notice: \"Saved list was successfully created.\" }\n format.json { render :show, status: :created, location: @saved_list }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @saved_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.build(params[:list])\n location = @list.save ? my_list_url(@list.id) : new_my_list_url\n respond_with(@list, :location => location )\n end",
"def create_list(project_id, list)\n record \"/projects/#{project_id}/todos/create_list\", list\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'Funcionario adicionado com sucesso.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @order_list = OrderList.new(params[:order_list])\n\n respond_to do |format|\n if @order_list.save\n format.html { redirect_to(@order_list, :notice => 'OrderList was successfully created.') }\n format.xml { render :xml => @order_list, :status => :created, :location => @order_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @order_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_list(params)\n MailManager::List.create(params)\n end",
"def create\n @email_list = EmailList.new(params[:email_list])\n\n respond_to do |format|\n if @email_list.save\n format.html { redirect_to(@email_list, :notice => 'Email list was successfully created.') }\n format.xml { render :xml => @email_list, :status => :created, :location => @email_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @email_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def list_post(api_key, access_token, list, body, opts = {})\n list_post_with_http_info(api_key, access_token, list, body, opts)\n return nil\n end",
"def list_params\n params.require(:list).permit(:name,:amount,:body,:status,:group_id, :list )\n end",
"def lists_params\n params.require(:list).permit(:name)\n\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def create\n @list = List.new(list_params)\n # formatがhtmlで指定されていたら@listにリダイレクト、jsonで指定されていたらshowにリダイレクト?\n # 通常時ではHTML形式(いつもウェブサイト上で見る形)で結果を取得したいけど、明示的にJSON形式やXML形式を指定した場合は\n # JSON形式やXML形式で返すようにするメソッドらしい\n # 今回の運用ではhtmlの方しか使わない\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @data_list = DataList.new(params[:data_list])\n\n respond_to do |format|\n if @data_list.save\n format.html { redirect_to(@data_list, :notice => 'Data list was successfully created.') }\n format.xml { render :xml => @data_list, :status => :created, :location => @data_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @data_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name, :description)\n end",
"def create\n @list = @project.lists.new(params[:list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to [@project, @list], notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_list(id, list)\n record \"/todos/update_list/#{id}\", :list => list\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def add_list_item(content,page_id = current_page_id, list_id = current_list_id)\n # POST /ws/page/#{page_id}/lists/#{list_id}/items/add\n request \"page/#{page_id}/lists/#{list_id}/items/add\", \"item\" => { \"content\" => content }\n end",
"def create\n @list = List.new(list_params)\n if @list.save\n return redirect_to list_url(@list)\n else\n flash[:error] = \"U is broken yo\"\n return render :new\n end\n end",
"def create\n @page_title = \"Task List Create\"\n @task_list = TaskList.new(params[:task_list])\n\n respond_to do |format|\n if @task_list.save\n flash[:notice] = 'TaskList was successfully created.'\n format.html { redirect_to(@task_list) }\n format.xml { render :xml => @task_list, :status => :created, :location => @task_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_list(list_id, name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"patch\", \"lists/#{list_id}\", data)\n end",
"def list_params\n params.require(:list).permit(:name, :user_id)\n end",
"def create\n @list = List.new(list_params)\n respond_to do |format|\n if @list.save(list_params)\n if(cookies[:list].blank?)\n cookies[:list]=\"\"\n end\n cookies[:list]=cookies[:list]+\",#{@list.id}\"\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n \n else\n @lists=set_lists\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.find params[:list_id]\n @item = @list.items.build(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully created.' }\n #format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n #format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mailee_list = Mailee::List.new(params[:mailee_list])\n\n respond_to do |format|\n if @mailee_list.save\n format.html { redirect_to(@mailee_list, :notice => 'Mailee list was successfully created.') }\n format.xml { render :xml => @mailee_list, :status => :created, :location => @mailee_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mailee_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tags = Tag.all\n @list_item = @list.list_items.new(list_item_params)\n\n respond_to do |format|\n if @list_item.save\n format.html { redirect_to list_path(@list), notice: 'List item was successfully created.' }\n format.json { render :show, status: :created, location: @list_item }\n else\n format.html { render :new }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:title, :description)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def create\n @group_list = GroupList.new(params[:group_list])\n\n respond_to do |format|\n if @group_list.save\n format.html { redirect_to(@group_list, :notice => 'Group list was successfully created.') }\n format.xml { render :xml => @group_list, :status => :created, :location => @group_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_list(name)\n Wunderlist::List.new(name, false, self).save\n end",
"def create_list(name:)\n check_token\n list = Todoable::List.new(name: name)\n response = self.class.post(\n '/lists', body: list.post_body, headers: headers\n )\n check_and_raise_errors(response)\n attributes = response.parsed_response.merge!('items' => [])\n Todoable::List.build_from_response(attributes)\n end",
"def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end",
"def list_params\n params.require(:list).permit(:name, :date, :family_id)\n end",
"def create\n @twitter_list = TwitterList.new(params[:twitter_list])\n\n respond_to do |format|\n if @twitter_list.save\n format.html { redirect_to @twitter_list, notice: 'Twitter list was successfully created.' }\n format.json { render json: @twitter_list, status: :created, location: @twitter_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @twitter_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name, :position)\n end",
"def create\n @list = List.new(list_params)\n\n if @list.save\n respond_successfully(I18n.t('integral.backend.lists.notification.creation_success'), backend_list_path(@list))\n else\n respond_failure(I18n.t('integral.backend.lists.notification.creation_failure'), :new)\n end\n end",
"def list_params\n params.require(:list).permit(:todo)\n end",
"def create\n @action_list = ActionList.new(params[:action_list])\n\n respond_to do |format|\n if @action_list.save\n format.html { redirect_to(@action_list, :notice => 'ActionList was successfully created.') }\n format.xml { render :xml => @action_list, :status => :created, :location => @action_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @action_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @list_element = ListElement.new(list_element_params)\n\n respond_to do |format|\n if @list_element.save\n format.html { redirect_to @list_element, notice: 'List element was successfully created.' }\n format.json { render :show, status: :created, location: @list_element }\n else\n format.html { render :new }\n format.json { render json: @list_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list_of_value = Irm::ListOfValue.new(params[:irm_list_of_value])\n\n respond_to do |format|\n if @list_of_value.save\n format.html { redirect_to({:action => \"index\"}, :notice => t(:successfully_created)) }\n format.xml { render :xml => @list_of_value, :status => :created, :location => @list_of_value }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list_of_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n @list_item = @list.list_items.create!(list_item_params)\n #@list_item = @list.list_items.create!(params[:list_item])\n\n respond_to do |format|\n if @list_item.save\n format.html { redirect_to list_path(@list), notice: 'List item was successfully created.' }\n format.json { render :show, status: :created, location: @list_item }\n else\n format.html { render :new }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @task_list = TaskList.new(task_list_params)\n\n respond_to do |format|\n if @task_list.save\n @task_lists = TaskList.all\n format.html { render :index, notice: 'Task list was successfully created.' }\n format.json { render :show, status: :created, location: @task_list }\n else\n format.html { render :new }\n format.json { render json: @task_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n # Create new saved list table entry\n @saved_list = SavedList.new\n\n # Store attributes\n @saved_list.login_id = params[:login_id]\n @saved_list.list_name = params[:list_name]\n @saved_list.saved_user_list = true\n @saved_list.date_saved = params[:date_saved]\n\n # Save the saved list\n respond_to do |format|\n if @saved_list.save\n\n # Create new user saved list entries for all users in list\n @user_ids = params[\"user_ids\"]\n @user_ids.each do |user_id|\n SavedListUser.create(saved_list_id: @saved_list.id, user_id: user_id)\n end\n\n format.html { redirect_to @saved_list, notice: 'Saved list was successfully created.' }\n format.json { render :show, status: :created, location: @saved_list }\n else\n format.html { render :new }\n format.json { render json: @saved_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n ListItem.transaction do\n item = Item.new(item_params)\n item.save\n\n @list_item = ListItem.new(list_item_params)\n @list_item.item_id = item.id\n @list_item.list_id = params[:list_id]\n\n\n if @list_item.save\n render json: @list_item, status: :created\n else\n render json: @list_item.errors, status: :unprocessable_entity\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name, :permalink, :description, :picurl)\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list.entity, notice: 'La liste de propositions pour la semaine ' + @list.date.to_time.strftime(\"%W\") + ' a été créée avec succès.' }\n format.json { render action: 'show', status: :created, location: @list }\n else\n format.html { render action: 'new' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @list_items }\n end\n end",
"def list_params\n params.require(:list).permit(:title, :position)\n end",
"def list_params\n params.require(:list).permit(:name, :user_id, :position)\n end",
"def create\n @list = List.new(list_params)\n @list.save\n broadcast\n end",
"def create\n @thing_list = ThingList.new(params[:thing_list])\n\n respond_to do |format|\n if @thing_list.save\n format.html { redirect_to(@thing_list, :notice => 'Thing list was successfully created.') }\n format.xml { render :xml => @thing_list, :status => :created, :location => @thing_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @thing_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def createItemOfList\n results1 = checkUser(params[:target_account]) #userid user to give the money\n if results1.code == 200\n parameters={user_id: (@current_user[\"id\"]).to_i, description: (params[:description]), date_pay: params[:date_pay], cost: params[:cost], target_account: params[:target_account], state_pay:params[:state_pay]}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.101:4055/lists\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n elsif results1.code == 404\n renderError(\"Not Found\", 404, \"The resource does not exist\")\n end\n end",
"def create\n @ml_list = Ml::List.new(ml_list_params)\n authorize! :create, @ml_list\n\n respond_to do |format|\n if @ml_list.save\n format.html { redirect_to @ml_list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @ml_list }\n else\n\n format.html { render :new }\n format.json { render json: @ml_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.build(params[:list])\n respond_to do |format|\n format.js\n end\n end",
"def list_params\n params.require(:list).permit(:title, :category_id, :body)\n end",
"def create\n @list = @organization.lists.build(list_params.merge(creator: authed_user))\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to [@list.organization, @list], notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: [@list.organization, @list] }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = current_user.lists.find(params[:id])\n @list.update_attributes(params[:list])\n respond_with(@list, :location => my_list_url(@list))\n end",
"def update_list(user, list, options={})\n post(\"/#{user}/lists/#{list}.json\", options)\n end",
"def create\n @book_list = BookList.new(params[:book_list])\n\n respond_to do |format|\n if @book_list.save\n format.html { redirect_to(@book_list, :notice => 'Book list was successfully created.') }\n format.xml { render :xml => @book_list, :status => :created, :location => @book_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @book_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def push_list(stream, *array)\n post stream, 'list' => array.flatten.map{|item| {'listItem' => item}}\n end",
"def set_post(api_key, access_token, list, list_item_id, body, opts = {})\n data, _status_code, _headers = set_post_with_http_info(api_key, access_token, list, list_item_id, body, opts)\n return data\n end",
"def list_params\n params.require(:list).permit(:user_id, :name, :privacy, :status, :description, \n user:[:name, :id], task:[:id, :list_id, :title, :note, :completed])\n end",
"def create\n @item = Item.create(item_params)\n @items = List.find(item_params[:list_id]).items.order(\"id ASC\")\n @list_id = item_params[:list_id]\n end",
"def create\n @task_list = TaskList.new(params[:task_list])\n respond_to do |format|\n if @task_list.save\n format.html { redirect_to @task_list, notice: 'Task list was successfully created.' }\n format.json { render json: @task_list, status: :created, location: @task_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list_record = ListRecord.new(params[:list_record])\n\n respond_to do |format|\n if @list_record.save\n format.html { redirect_to(@list_record, :notice => 'List record was successfully created.') }\n format.xml { render :xml => @list_record, :status => :created, :location => @list_record }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n list = current_user.lists.build(params[:list])\n list.current_users << current_user\n\n if list.save\n flash[:notice] = t('messages.list.success.create', title: list.title)\n redirect_to list_experts_url(list)\n else\n flash[:alert] = t('messages.list.errors.create')\n redirect_to lists_url\n end\n end",
"def create\n @list = Blog::List.new(list_params)\n\n respond_to do |format|\n if @list.save\n ActionCable.server.broadcast \"board\",\n { commit: 'addList', \n payload: render_to_string(:show, formats: [:json]) }\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mail_list = MailList.new(mail_list_params)\n\n respond_to do |format|\n if @mail_list.save\n format.html { redirect_to [:admin, @mail_list], notice: 'Mail list was successfully created.' }\n format.json { render action: 'show', status: :created, location: @mail_list }\n else\n format.html { render action: 'new' }\n format.json { render json: @mail_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @email_list = EmailList.new(email_list_params)\n\n respond_to do |format|\n if @email_list.save\n format.html { redirect_to @email_list, notice: 'Email list was successfully created.' }\n format.json { render :show, status: :created, location: @email_list }\n else\n format.html { render :new }\n format.json { render json: @email_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name, :position)\n end",
"def new\n @list = List.new\n\n @list.list_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def list_params\n params.require(:list).permit(:title, :description, :is_deleted)\n end",
"def create\n @list = List.new(params[:list])\n @list.user = current_user\n if @list.save\n user_session.select_list @list\n flash[:notice] = 'Lista criada com sucesso!'\n redirect_to edit_list_nomes_path\n else\n flash[:notice] = 'Não foi possível uma nova lista!'\n render :action => \"new\"\n end\n end"
] | [
"0.7125083",
"0.7066784",
"0.6921468",
"0.6768993",
"0.6612775",
"0.65280986",
"0.65194136",
"0.6486917",
"0.6486426",
"0.64758843",
"0.64758843",
"0.6463956",
"0.6449232",
"0.64285964",
"0.6419513",
"0.6307411",
"0.6306979",
"0.62993675",
"0.6290997",
"0.6286385",
"0.6283033",
"0.6271515",
"0.62508506",
"0.62456226",
"0.6243116",
"0.62427616",
"0.62332404",
"0.6232325",
"0.62245274",
"0.6219401",
"0.6209914",
"0.61992204",
"0.6196532",
"0.6196041",
"0.61888677",
"0.6176762",
"0.6176762",
"0.6176762",
"0.61629295",
"0.6148956",
"0.6144818",
"0.61447555",
"0.6138433",
"0.6134069",
"0.61031383",
"0.6101795",
"0.6100058",
"0.60959697",
"0.60932165",
"0.607956",
"0.60780543",
"0.6074389",
"0.6066385",
"0.6056608",
"0.60511184",
"0.60483176",
"0.6046949",
"0.6019035",
"0.601674",
"0.6015131",
"0.6004359",
"0.59933037",
"0.59898937",
"0.5988551",
"0.59816104",
"0.5977648",
"0.59711194",
"0.5966211",
"0.5965577",
"0.59639484",
"0.59625083",
"0.5956456",
"0.59551543",
"0.5954045",
"0.5950487",
"0.59504354",
"0.5950259",
"0.5945789",
"0.59442127",
"0.594022",
"0.59394276",
"0.5930316",
"0.5914839",
"0.5913428",
"0.59115577",
"0.59100723",
"0.59084654",
"0.5908006",
"0.589186",
"0.5886402",
"0.5884129",
"0.588204",
"0.58755946",
"0.58742076",
"0.5873785",
"0.58726615",
"0.58700985",
"0.5867561",
"0.58629936",
"0.5860177"
] | 0.60221297 | 57 |
PUT /lists/1 PUT /lists/1.xml | def update
@list = List.find(params[:id])
respond_to do |format|
if @list.update_attributes(params[:list])
format.html { redirect_to(root_url) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @list.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_list(list_id, name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"patch\", \"lists/#{list_id}\", data)\n end",
"def update_list(id, list)\n record \"/todos/update_list/#{id}\", :list => list\n end",
"def update\n @list = current_user.lists.find(params[:id])\n @list.update_attributes(params[:list])\n respond_with(@list, :location => my_list_url(@list))\n end",
"def update_list(user, list, options={})\n post(\"/#{user}/lists/#{list}.json\", options)\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_list(list_id:, name:)\n check_token\n list = Todoable::List.new(name: name)\n response = self.class.patch(\n \"/lists/#{list_id}\",\n body: list.post_body,\n headers: headers,\n format: :text\n )\n check_and_raise_errors(response)\n # This endpoint returns a plaintext body: \"<new name> updated\", so\n # while I'd like to return a List with ListItems, that would require\n # first looking up the list which isn't ideal. So we'll return true, ask\n # todoable to fix this endpoint, and make developers keep track of the\n # name change\n true\n end",
"def update\n @list.update_attributes list_params\n end",
"def update\n \n list_attributes = params[:list] || params[:check_list]\n \n if @list.update(list_attributes)\n flash[:notice] = t(:list_saved)\n redirect_to @list\n else\n render :action => 'edit'\n end\n end",
"def update_list(access_token, list)\n url = Util::Config.get('endpoints.base_url') + sprintf(Util::Config.get('endpoints.list'), list.id)\n url = build_url(url)\n payload = list.to_json\n response = RestClient.put(url, payload, get_headers(access_token))\n Components::ContactList.create(JSON.parse(response.body))\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n item = @list.list_items.find(params[:id])\n\n if item.update_attributes(params[:list_item])\n render json: item\n else\n error(t('messages.list_item.errors.update'))\n end\n end",
"def update\n @list = List.find(params[:id])\n @show_list = true\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { render @list }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @adventure.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(_list_params)\n format.html { redirect_to @list, notice: \"List was successfully updated.\" }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rename_list(list_id, name)\n path = \"lists/#{list_id}\"\n params = { list: { name: name }}\n request(path, params, :put )\n \n # output full list again\n show_list(list_id)\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'The List was updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @list\n\n if @list.update(list_params)\n json_response(@list.decorate, :ok)\n else\n json_response(@list.errors, :unprocessable_entity)\n end\n end",
"def update\n @list = @project.lists.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to [@project, @list], notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: 'form', action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'Changes and Additions Successful.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(existing_list_params)\n format.html { redirect_to my_list_path(@list), notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: my_list_path(@list) }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page_title = \"Task List Update\"\n @task_list = TaskList.find(params[:id])\n\n respond_to do |format|\n if @task_list.update_attributes(params[:task_list])\n flash[:notice] = 'TaskList was successfully updated.'\n format.html { redirect_to(@task_list) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @task_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @mylist = Mylist.find(params[:id])\n\n respond_to do |format|\n if @mylist.update_attributes(params[:mylist])\n format.html { redirect_to(@mylist, :notice => 'Mylist was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mylist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @todo_list = TodoList.find(params[:id])\n\n respond_to do |format|\n if @todo_list.update_attributes(params[:todo_list])\n flash[:notice] = 'TodoList was successfully updated.'\n format.html { redirect_to(@todo_list) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @todo_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @email_list = EmailList.find(params[:id])\n\n respond_to do |format|\n if @email_list.update_attributes(params[:email_list])\n format.html { redirect_to(@email_list, :notice => 'Email list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @email_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_list(list_name, text)\n update_value(\"#{list_name}-list\", text)\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to [@list.organization, @list], notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: [@list.organization, @list] }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @thing_list = ThingList.find(params[:id])\n\n respond_to do |format|\n if @thing_list.update_attributes(params[:thing_list])\n format.html { redirect_to(@thing_list, :notice => 'Thing list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thing_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n \n @list_item = ListItem.find(params[:id])\n\n if @list_item.update(list_item_params)\n head :no_content\n else\n render json: @list_item.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to management_lists_path, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_list\n current_path = '/api/v1/update'\n @conn.get(current_path)\n end",
"def editList\n\t\t@list = List.find(params[:id])\n\tend",
"def update\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n\n if @list_item.update_attributes(params[:list_item])\n flash[:success] = \"List item was successfully updated.\"\n redirect_to list_path(@list) \n else\n flash[:errror] = \"Unable to update item.\"\n redirect_to edit_list_list_item_path(@list, @list_item)\n end\n end",
"def save\n raise NotImplementedError, \"Lists can't be edited through the API\"\n end",
"def update\n @order_list = OrderList.find(params[:id])\n\n respond_to do |format|\n if @order_list.update_attributes(params[:order_list])\n format.html { redirect_to(@order_list, :notice => 'OrderList was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @order_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n nested = params[:list].delete( :list_items_attributes )\n\n new_items = []\n\n if nested then\n nested.each do |i, r|\n\n if !r.key?( \"id\" )\n\n new_items << ListItem.new( { \"list\" => @list }.merge( r ) ) if !item_blank?( r )\n\n nested.delete( i )\n\n else\n\n r[ \"_destroy\" ] = \"true\" if item_blank?( r )\n\n end\n\n end\n end\n\n respond_to do |format|\n if @list.update_attributes( params[ :list ] ) && \n @list.update_attributes( list_items_attributes: (nested || {}) ) &&\n new_items.map( &:save ).all? then\n\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n\n else\n\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"def update_list(item_name, item_list, quantity)\n add_list(item_name, item_list, quantity)\nend",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: blog_list_path(@list) }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @book_list = BookList.find(params[:id])\n\n respond_to do |format|\n if @book_list.update_attributes(params[:book_list])\n format.html { redirect_to(@book_list, :notice => 'Book list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @book_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @item.update_attributes(item_params)\n @items = List.find(item_params[:list_id]).items.order(\"id ASC\")\n @list_id = @item.list.id\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n\n else\n format.html { render :edit }\n\n end\n end\n end",
"def update\n @action_list = ActionList.find(params[:id])\n\n respond_to do |format|\n if @action_list.update_attributes(params[:action_list])\n format.html { redirect_to(@action_list, :notice => 'ActionList was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @action_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_list\n @list = @lists.find(params[:id])\n end",
"def update\n @list_of_value = Irm::ListOfValue.find(params[:id])\n\n respond_to do |format|\n if @list_of_value.update_attributes(params[:irm_list_of_value])\n format.html { redirect_to({:action => \"index\"}, :notice => t(:successfully_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list_of_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @saved_list.update(saved_list_params)\n format.html { redirect_to @saved_list, notice: \"Saved list was successfully updated.\" }\n format.json { render :show, status: :ok, location: @saved_list }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @saved_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n flash[:notice] = '修改成功!'\n format.html { redirect_to action: \"index_admin\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \t@list = current_user.lists.find params[:list_id]\n @item = @list.items.find(params[:id])\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully updated.' }\n #format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n #format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @data_list = DataList.find(params[:id])\n\n respond_to do |format|\n if @data_list.update_attributes(params[:data_list])\n format.html { redirect_to(@data_list, :notice => 'Data list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @data_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n @mailee_list = Mailee::List.find(params[:id])\n\n respond_to do |format|\n if @mailee_list.update_attributes(params[:mailee_list])\n format.html { redirect_to(@mailee_list, :notice => 'Mailee list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mailee_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n @list.user = current_user\n @user = @list.user\n\n respond_to do |format|\n if @list.update_attributes(params[:todo])\n format.html { redirect_to root_path, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list= List.find(params[:id])\n if @list.update(list_params)\n \tflash[:notice] = \"List successfully updated!\"\n redirect_to list_path(@list)\n else\n render :edit\n flash[:alert] = \"ERROR :(\"\n end\n end",
"def set_list\n @list = List.find(params[:list_id])\n end",
"def set_list\n @list = List.find(params[:list_id])\n end",
"def set_list\n @list = List.find(params[:list_id])\n end",
"def update\n @task_list = TaskList.find(params[:id])\n respond_to do |format|\n if @task_list.update_attributes(params[:task_list])\n format.html { redirect_to @task_list, notice: 'Task list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list.entity, notice: 'La Liste de propositions pour la semaine ' + @list.date.to_time.strftime(\"%W\") + ' a été modifiée avec succès.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ota_code_list_list = Ota::CodeList::List.find(params[:id])\n\n respond_to do |format|\n if @ota_code_list_list.update_attributes(params[:ota_code_list_list])\n format.html { redirect_to(@ota_code_list_list, :notice => 'List was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ota_code_list_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @twitter_list = TwitterList.find(params[:id])\n\n respond_to do |format|\n if @twitter_list.update_attributes(params[:twitter_list])\n format.html { redirect_to @twitter_list, notice: 'Twitter list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @twitter_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(id:, name:)\n list = client.update_list(id: id, name: name)\n\n Todoable::List.new(list)\n end",
"def update\n @todo_list = TodoList.find(params[:id])\n\n respond_to do |format|\n if @todo_list.update_attributes(params[:todo_list])\n format.html { redirect_to @todo_list, :notice=>\"Todo list was successfully updated.\"}\n format.json { head :ok }\n else\n format.html { render :action=>\"edit\" }\n format.json { render :json=>@todo_list.errors, :status=>\"unprocessable_entry\" }\n end\n end\n end",
"def update(options = {})\n self.merge!(Vermonster::Client.connection.put(\"lists/#{self[\"id\"]}\", \"{\\\"list\\\": #{options.to_json}}\").body)\n end",
"def update\n respond_to do |format|\n if @task_list.update(task_list_params)\n @task_lists = TaskList.all\n format.html { render :index, notice: 'Task list was successfully updated.' }\n format.json { render :show, status: :ok, location: @task_list }\n else\n format.html { render :edit }\n format.json { render json: @task_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list_view = ListView.find(params[:id])\n\n respond_to do |format|\n if @list_view.update_attributes(params[:list_view])\n format.html { redirect_to(@list_view, :notice => 'List view was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list_view.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def update\n # @task_list = TaskList.find(params[:id])\n\n respond_to do |format|\n if @task_list.update_attributes(params[:task_list])\n format.html { redirect_to @task_list, notice: 'Task list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo_list = TodoList.find(params[:id])\n\n respond_to do |format|\n if @todo_list.update_attributes(params[:todo_list])\n format.html { redirect_to @todo_list, notice: 'Todo list was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @todo_list.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.7174831",
"0.7108598",
"0.67610824",
"0.6572841",
"0.65460837",
"0.6532652",
"0.6532652",
"0.6461191",
"0.64486414",
"0.64202404",
"0.6397813",
"0.6348516",
"0.6335764",
"0.6333402",
"0.63244444",
"0.6320316",
"0.6307662",
"0.6307662",
"0.6307662",
"0.6307662",
"0.6307662",
"0.6289122",
"0.6289122",
"0.6277117",
"0.6261465",
"0.6246715",
"0.62391317",
"0.62372196",
"0.6235226",
"0.6231929",
"0.6218898",
"0.62182194",
"0.6217109",
"0.6212991",
"0.6206139",
"0.6204327",
"0.6197868",
"0.61941695",
"0.61835027",
"0.6174022",
"0.6172708",
"0.61681455",
"0.61598474",
"0.61586964",
"0.6143635",
"0.6141656",
"0.612733",
"0.6111609",
"0.6105262",
"0.6072149",
"0.606431",
"0.6059227",
"0.60472816",
"0.6041419",
"0.60393685",
"0.6034552",
"0.6022196",
"0.60206413",
"0.6004068",
"0.59830815",
"0.5957729",
"0.5957729",
"0.5957729",
"0.59521264",
"0.5936624",
"0.59329885",
"0.5929117",
"0.59268594",
"0.5921931",
"0.5918749",
"0.59081537",
"0.5907244",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.59044236",
"0.5897513",
"0.5897513",
"0.5897513",
"0.5897513",
"0.58944005",
"0.58863133"
] | 0.67906475 | 2 |
DELETE /lists/1 DELETE /lists/1.xml | def destroy
@list = List.find(params[:id])
@list.destroy
respond_to do |format|
format.html { redirect_to(root_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_list(list_id)\n rest(\"delete\", \"lists/#{list_id}\")\n\n return true\n end",
"def delete(list_id)\n Iterable.request(conf, \"/lists/#{list_id}\").delete\n end",
"def delete_list(user, list)\n delete(\"/#{user}/lists/#{list}.json\")\n end",
"def delete_list(id)\n query(\"DELETE FROM todos WHERE list_id = $1\", id)\n query(\"DELETE FROM lists WHERE id = $1\", id)\n end",
"def destroy\n @mylist = Mylist.find(params[:id])\n @mylist.destroy\n\n respond_to do |format|\n format.html { redirect_to(mylists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @checklist = Checklist.find(params[:id])\n @checklist.destroy\n\n respond_to do |format|\n format.html { redirect_to(checklists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @email_list = EmailList.find(params[:id])\n @email_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(email_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @order_list = OrderList.find(params[:id])\n @order_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(order_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @data_list = DataList.find(params[:id])\n @data_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(data_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @action_list = ActionList.find(params[:id])\n @action_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(action_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mailee_list = Mailee::List.find(params[:id])\n @mailee_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(mailee_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n listentries = List.find(:all,:conditions => \"list_cat_id = #{params[:id]}\")\n for listentry in listentries \n listentry.destroy\n end\n @list_cat = ListCat.find(params[:id])\n @list_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => 'lists') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group_list = GroupList.find(params[:id])\n @group_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page_title = \"Task List Delete\"\n @task_list = TaskList.find(params[:id])\n @task_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(task_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list = @project.lists.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to project_lists_url(@project) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n @list_item.destroy\n\n if @list_item.destroy\n flash[:success] = \"Item deleted\"\n redirect_to list_path(@list)\n else\n flash[:error] = \"Item not deleted\"\n redirect_to list_path(@list)\n end\n end",
"def delete_list(params={})\n @obj.delete('delete', @auth.merge(params))\n end",
"def delete_item(list_id:, id:)\n path = \"lists/#{list_id}/items/#{id}\"\n request(method: :delete, path: path)\n end",
"def destroy\n @book_list = BookList.find(params[:id])\n @book_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(book_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @thing_list = ThingList.find(params[:id])\n @thing_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(thing_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n flash[:notice] = \"List successfully deleted\"\n \n @lists = current_user.lists\n @feeds = current_user.feeds\n\n respond_to do |format|\n format.html { redirect_to(lists_url) }\n format.xml { head :ok }\n format.js {render :layout => false}\n end\n end",
"def destroy\n @list_item.destroy\n\n head :no_content\n end",
"def destroy\n @list = current_user.lists.find(list_params)\n @list.destroy\n flash[:success] = \"List deleted\"\n redirect_to current_user\n end",
"def delete(email, list_id = nil)\n query = \"email=#{CGI.escape(email)}\"\n query += \"&list_id=#{list_id}\" if list_id\n\n del \"#{@endpoint}?#{query}\", nil\n end",
"def destroy\n @wordlist = Wordlist.find(params[:id])\n @wordlist.destroy\n\n respond_to do |format|\n format.html { redirect_to(wordlists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n \t@list = current_user.lists.find params[:list_id]\n @item = @list.items.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully removed.' }\n #format.json { head :no_content }\n end\n end",
"def destroy\n @list_id = @item.list.id\n @item.destroy\n @items = List.find(@list_id).items.order(\"id ASC\")\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: \"List was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def delete_list_item(client, uri, headers)\n # log what we are doing\n log(:info, \"Deleting Sharepoint list item at: #{uri}\")\n\n # send the delete request and return the response\n client.delete(uri, headers)\n end",
"def destroy\n @list = current_user.lists.find(params[:id])\n @list.destroy\n respond_with(@list, :location => my_lists_url)\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'The List was destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to my_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to management_lists_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n redirect_to lists_url, notice: 'List was successfully destroyed.'\n end",
"def destroy\n @list_view = ListView.find(params[:id])\n @list_view.destroy\n\n respond_to do |format|\n format.html { redirect_to(list_views_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n # @list=List.find(params[:list_id])\n @list_item=@list.list_items.find(params[:id])\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to @list, notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @chore_list = ChoreList.find(params[:id])\n @chore_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(chore_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @saved_list.destroy\n respond_to do |format|\n format.html { redirect_to saved_lists_url, notice: \"Saved list was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_record = ListRecord.find(params[:id])\n @list_record.destroy\n\n respond_to do |format|\n format.html { redirect_to(list_records_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'Funcionario deletado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def delete_list(id:)\n check_token\n response = self.class.delete(\"/lists/#{id}\", headers: headers)\n check_and_raise_errors(response)\n true\n end",
"def destroy\n @check_list.destroy\n respond_to do |format|\n format.html { redirect_to check_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_item = ListItem.find(params[:id])\n @list_item.destroy\n\n respond_to do |format|\n format.html { render :nothing => true}\n format.json { head :no_content }\n end\n end",
"def destroy\n @liste = Liste.find(params[:id])\n @liste.destroy\n\n respond_to do |format|\n format.html { redirect_to listes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n flash[:notice] = \"you have successfully destroyed.\"\n redirect_to root_url\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to organization_lists_url(@organization), notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fwlist = Fwlist.find(params[:id])\n @fwlist.destroy\n\t\n respond_to do |format|\n format.html { redirect_to fwlists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :delete, @ml_list\n @ml_list.destroy\n respond_to do |format|\n format.html { redirect_to ml_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @checklist = Checklist.find(params[:id])\n @checklist.destroy\n\n respond_to do |format|\n format.html { redirect_to checklists_url }\n format.json { head :no_content }\n end\n end",
"def delete_item(list_item)\n @list.delete(list_item)\n @list\n end",
"def destroy\n @mailinglist = Mailinglist.find(params[:id])\n @mailinglist.destroy\n\n respond_to do |format|\n format.html { redirect_to(mailinglists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reminder_task_list = ReminderTaskList.find(params[:id])\n @reminder_task_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(reminder_task_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to list_types_url, notice: \"Check ya later list.\" }\n format.json { head :no_content }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @mat_list = MatList.find(params[:id])\n @mat_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(mat_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @shopping_list = ShoppingList.find(params[:id])\n @shopping_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(shopping_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n if current_list? @list\n set_current_list nil\n end\n @list.destroy\n flash[:notice] = 'Lista removida com sucesso!'\n redirect_to(new_list_path)\n end",
"def destroy\n authorize @list\n @list.destroy\n head :no_content\n end",
"def destroy\n @check_list.destroy\n respond_to do |format|\n format.html { redirect_to check_lists_url, notice: 'Чек-лист успешно удален.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @assistance_list = AssistanceList.find(params[:id])\n @assistance_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(assistance_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @todo_list = TodoList.find(params[:id])\n @todo_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(@project) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_wish_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list_of_value = Irm::ListOfValue.find(params[:id])\n @list_of_value.destroy\n\n respond_to do |format|\n format.html { redirect_to(list_of_values_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n list = List.find(params[:list_id])\n list.destroy\n \n redirect_to '/liverpool/index'\n end",
"def destroy\n @listitem.destroy\n head :no_content\nend",
"def destroy\n @bulk_insert_list.destroy\n respond_to do |format|\n format.html { redirect_to bulk_insert_lists_url, notice: 'Bulk insert list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_multiple\n\t @list.delete(params[:id])\n\t redirect_to '/tasks'\n\tend",
"def delete_todo_from_list(list_id, todo_id)\n sql = \"DELETE FROM todos WHERE id = $1 AND list_id = $2\"\n query(sql, todo_id, list_id)\n end",
"def delete\n Checklist.find(params[:format]).destroy\n flash[:notice] = \"Delete successful\"\n redirect_to '/'\n end",
"def destroy\n @email_list.destroy\n respond_to do |format|\n format.html { redirect_to email_lists_url, notice: 'Email list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(item, list)\n\tlist.delete(item)\nend",
"def destroy1\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @check_list.destroy\n respond_to do |format|\n format.html { redirect_to check_lists_url, notice: \"Check list was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @document_list.destroy\n respond_to do |format|\n format.html { redirect_to document_lists_url, notice: 'Document list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_list.destroy\n respond_to do |format|\n format.html { redirect_to item_lists_url, notice: 'Item list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @play_list = PlayList.find(params[:id])\n @play_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(play_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n if @list.name == 'Default'\n format.html { redirect_to @user.lists.find_by(name: 'Default'), data: { confirm: 'You can\\'t delete your default list'} }\n else\n @list.destroy\n respond_to do |format|\n format.html { redirect_to @user.lists.find_by(name: 'Default') }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @program_list= Programlist.find(params[:id])\n @program_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(programlists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @price_list = PriceList.find(params[:id])\n @price_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(price_lists_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def destroy\n @mail_list.destroy\n respond_to do |format|\n format.html { redirect_to admin_mail_lists_url, notice: 'Mail list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @todo_list = TodoList.find(params[:id])\n @todo_list.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_lists_url }\n format.json { head :ok }\n end\n end"
] | [
"0.74714243",
"0.7290611",
"0.703505",
"0.70157504",
"0.69659823",
"0.6884975",
"0.6883083",
"0.6878157",
"0.68778455",
"0.6837181",
"0.6837181",
"0.6837181",
"0.681098",
"0.67993176",
"0.6776809",
"0.67693955",
"0.67681295",
"0.6760802",
"0.6760802",
"0.6760802",
"0.67200255",
"0.6691531",
"0.66882366",
"0.667479",
"0.6670135",
"0.6669748",
"0.6667068",
"0.66502994",
"0.6642723",
"0.6641648",
"0.66335016",
"0.65846395",
"0.6577349",
"0.6569515",
"0.6567622",
"0.6557977",
"0.6557977",
"0.6557977",
"0.6557977",
"0.6557977",
"0.6557977",
"0.6557977",
"0.65529966",
"0.6552956",
"0.6532203",
"0.6531132",
"0.65253496",
"0.6512805",
"0.650627",
"0.6497598",
"0.64877075",
"0.64867646",
"0.64856285",
"0.6471701",
"0.646931",
"0.6465622",
"0.6454065",
"0.644547",
"0.64332354",
"0.6431495",
"0.6430582",
"0.6430476",
"0.64261484",
"0.64255774",
"0.64204156",
"0.6413704",
"0.6412448",
"0.6408428",
"0.6394549",
"0.6393044",
"0.63926226",
"0.6381561",
"0.63813514",
"0.6380194",
"0.6367508",
"0.6358568",
"0.6347588",
"0.6335392",
"0.63237375",
"0.63109225",
"0.6310344",
"0.6306744",
"0.6301873",
"0.6298659",
"0.62966245",
"0.6278325",
"0.627418",
"0.62739265",
"0.62724024",
"0.6268314",
"0.6264416",
"0.62579614",
"0.6256731",
"0.62562674",
"0.62492716",
"0.6246906",
"0.62396795",
"0.6236975",
"0.6234449",
"0.6224602"
] | 0.70058084 | 4 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: backend_servers, type: String name: host_id, type: String name: load_balancer_id, type: String name: owner_account, type: String | def add_backend_servers(optional={})
args = self.class.new_params
args[:query]['Action'] = 'AddBackendServers'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :backend_servers
args[:query]['BackendServers'] = optional[:backend_servers]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_parameters; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def rest_endpoint=(_arg0); end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request_params; end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def http=(_arg0); end",
"def service_endpoint; end",
"def service_endpoint; end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def set_backend_servers(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetBackendServers'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_servers\n\t\t\targs[:query]['BackendServers'] = optional[:backend_servers]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_backend_servers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeBackendServers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def update!(**args)\n @backend_type = args[:backend_type] if args.key?(:backend_type)\n @backend_uri = args[:backend_uri] if args.key?(:backend_uri)\n @backends = args[:backends] if args.key?(:backends)\n @health_check_uri = args[:health_check_uri] if args.key?(:health_check_uri)\n @load_balancer_type = args[:load_balancer_type] if args.key?(:load_balancer_type)\n end",
"def http_options; end",
"def http; end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def endpoints; end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def request(*args); end",
"def http_options=(_arg0); end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def build_request(method); end",
"def request_method; end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def rest_endpoint; end",
"def add_backend_servers(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'AddBackendServers'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_servers\n\t\t\targs[:query]['BackendServers'] = optional[:backend_servers]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def adjust_params \n #if request is like this:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations\n if params[:action] == 'index'\n \n # If it is \n # GET /relations\n # Then we cannot sevice this request, must specify the entity.\n# if !params[:database_id] and !params[:entity_id]\n# render :text => 'GET /relations is not available', :status => 400\n# return false;\n# end\n\n # But in the remaining two cases:\n # * /entities/relations\n # * /databases/entities/relations\n # Allow the class\n return true;\n end\n \n # if it is:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations/\n # Becasue show needs to have an ID, therefore\n # any of the above URL will do and no context is needed.\n #FIXME: What other possibility the show action might face?\n if params[:action] == 'show'\n return true;\n end\n \n #If its like this:\n # POST /relations\n # POST /entities/relations\n # POST /databases/entities/relations\n # NOTE: For now, the relation resource should be totally complete\n # even if the call is being as a nested resource.\n #\n if params[:action] == 'create'\n \n #if it is like this:\n # POST /relations\n # Then the relations resource should be complete in\n # every respect.\n if !params[:database_id] and !params[:entity_id]\n #return true if valid_relation_resource?\n # Otherwise, the resource is not vaild and we need to tell the user\n #render :json => report_errors(nil, 'The provided realtion resource is incomplete')[0], \n # :status => 400 and return false;\n end\n \n # But if its something like this:\n # POST /entities/:entity_id/relations\n # POST /databases/entities/:entity_id/relations\n #\n if params[:database_id] or params[:entity_id]\n # Then if the relation resource is valid, \n # the entity_id parameter is altogather ignored.\n #return true if valid_relation_resource? \n end\n return true\n end\n \n # if its either of these:\n # PUT /relations\n # PUT /entities/relations\n # PUT /databases/entities/relations\n #\n if params[:action] == 'update'\n # Set the params[:relation_id] because\n # the underlying Admin::EntitiesController#add_link function\n # expects it\n params[:relation_id] = params[:id] and return true;\n end\n \n # If it is either of these:\n # DELETE /relations\n # DELETE /entities/relations\n # DELETE /databases/entities/relations\n #\n if params[:action] == 'destroy'\n \n # For now, you can only make a nested call.\n #PENDING: This would change when the rest call would include the user\n # authenticiy information which would help to determine whether the \n # relation being deleted belongs to the user or not.\n if !params[:entity_id]\n render :json => report_errors(nil, 'DELETE /relations call is not available for now. Call DELETE /entities/relations instead')[0],\n :status => 400 and return false\n end\n \n params[:source_id] = params[:entity_id]\n return true;\n \n end\n \n # In all cases, the request is not handled by this controller!\n render :json => report_errors(nil, \"The requested action is \\\"#{params[:action]}\\\" \" + \n \" on controller \\\"#{params[:controller]}\\\" while I am\" + \n \" \\\"#{self.class.name}\\\" and cannot handle your request.\")[0],:status => 400 and return false;\n \n end",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n endpoint_data = params.require(:data).require(:attributes).permit(:verb, :path,\n { response: [:code, :body, { headers: {} }] })\n { path: endpoint_data[:path], verb: endpoint_data[:verb], response_code: endpoint_data[:response][:code],\n body: endpoint_data[:response][:body], headers: endpoint_data[:response][:headers] }\n end",
"def http_params\n {}\n end",
"def valid_params_request?; end",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def perform(arguments = {})\n case type.to_sym\n when :post, :get\n api.public_send(type, path, @arguments.merge(arguments))\n else\n raise ArgumentError, \"Unregistered request type #{request_type}\"\n end\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def get_endpoint()\n end",
"def request_method_symbol; end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def method_missing(method_name, *args)\n payload = Kauplus::Client.authenticate_payload(args.first)\n if method_name.match(/(get|post|multipart_post|put|delete|head)_(.*)/)\n Kauplus::Client.send($1, \"#{@resource}/#{$2}\", payload)\n else\n Kauplus::Client.get(\"#{@resource}/#{method_name}\", payload)\n end\n end",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def query_parameters; end",
"def set_api(*args); end",
"def set_api(*args); end",
"def service_type_name\n \"REST\"\n end",
"def payment_methods_post_with_http_info(create_payment_method_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentMethodsApi.payment_methods_post ...'\n end\n # verify the required parameter 'create_payment_method_request' is set\n if @api_client.config.client_side_validation && create_payment_method_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_payment_method_request' when calling PaymentMethodsApi.payment_methods_post\"\n end\n # resource path\n local_var_path = '/payment-methods'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Trace-Id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n header_params[:'End-User-Device-Id'] = opts[:'end_user_device_id'] if !opts[:'end_user_device_id'].nil?\n header_params[:'End-User-Ip'] = opts[:'end_user_ip'] if !opts[:'end_user_ip'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_payment_method_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PaymentMethod'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BearerAuth']\n\n new_options = opts.merge(\n :operation => :\"PaymentMethodsApi.payment_methods_post\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentMethodsApi#payment_methods_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_method\n raise \"Implement in child class\"\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def bi_service\n end",
"def platform_endpoint; end",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.update_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.update_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.update_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.update_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#update_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def operations\n # Base URI works as-is.\n end",
"def api_only=(_arg0); end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def params_to_api_args(type)\n args = params.to_unsafe_h.symbolize_keys.except(:controller)\n args[:method] = request.method\n args[:action] = type\n args.delete(:format)\n args\n end",
"def set_request; end",
"def request(endpoint, request, &block); end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def cloud_params\n params.require(:cloud).permit(:api, :url, :ip_addresses, :port, :token, :shared_secret, :bucket, :platform_id)\n end",
"def initialize(*)\n super\n @json_rpc_call_id = 0\n @json_rpc_endpoint = URI.parse(currency.rpc)\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def url_field(object_name, method, options = T.unsafe(nil)); end",
"def endpoint\n raise NotImplementedError\n end",
"def send_request(method, params, &block); end",
"def request(*args)\n end",
"def endpoint=(_arg0); end",
"def service_request(service); end",
"def perform(request, options); end",
"def build_request(*args); end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end"
] | [
"0.6474627",
"0.6289442",
"0.6230481",
"0.6017509",
"0.58854175",
"0.5771842",
"0.57512516",
"0.5707569",
"0.5659567",
"0.5629907",
"0.5601322",
"0.55060434",
"0.5479961",
"0.5479961",
"0.5479961",
"0.5479961",
"0.54543763",
"0.54415727",
"0.5439501",
"0.53967047",
"0.5386634",
"0.5385464",
"0.5371564",
"0.5339211",
"0.5339211",
"0.53329605",
"0.5315769",
"0.53142434",
"0.5313003",
"0.5308045",
"0.5299951",
"0.52976894",
"0.52976894",
"0.52944887",
"0.5276897",
"0.5269086",
"0.5258393",
"0.52401066",
"0.5233981",
"0.52323014",
"0.52323014",
"0.52266586",
"0.52038413",
"0.51907504",
"0.5178392",
"0.5178301",
"0.5167485",
"0.51601994",
"0.5149908",
"0.5133731",
"0.5116439",
"0.5112947",
"0.51073855",
"0.5106363",
"0.5105106",
"0.5098593",
"0.5084711",
"0.50804406",
"0.5070431",
"0.5061592",
"0.505638",
"0.5054252",
"0.50514054",
"0.50497556",
"0.50497556",
"0.5047865",
"0.50472486",
"0.5046499",
"0.50371414",
"0.50235873",
"0.50162905",
"0.5016032",
"0.5011987",
"0.5008824",
"0.5006397",
"0.5006012",
"0.50017005",
"0.49957097",
"0.4995695",
"0.49945378",
"0.49890205",
"0.4986048",
"0.4970844",
"0.496992",
"0.49670762",
"0.49653396",
"0.49623868",
"0.4950005",
"0.4949532",
"0.49459487",
"0.49450794",
"0.49405777",
"0.49403742",
"0.49373186",
"0.4931702",
"0.4931148",
"0.4931148",
"0.4931148",
"0.4931148",
"0.4931148"
] | 0.5156724 | 48 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: address, type: String name: client_token, type: String name: is_public_address, type: String name: load_balancer_mode, type: String name: load_balancer_name, type: String name: owner_account, type: String name: owner_id, type: Long name: resource_owner_account, type: String name: resource_owner_id, type: Long | def create_load_balancer(optional={})
args = self.class.new_params
args[:query]['Action'] = 'CreateLoadBalancer'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :address
args[:query]['Address'] = optional[:address]
end
if optional.key? :client_token
args[:query]['ClientToken'] = optional[:client_token]
end
if optional.key? :is_public_address
args[:query]['IsPublicAddress'] = optional[:is_public_address]
end
if optional.key? :load_balancer_mode
args[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]
end
if optional.key? :load_balancer_name
args[:query]['LoadBalancerName'] = optional[:load_balancer_name]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
if optional.key? :owner_id
args[:query]['OwnerId'] = optional[:owner_id]
end
if optional.key? :resource_owner_account
args[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]
end
if optional.key? :resource_owner_id
args[:query]['ResourceOwnerId'] = optional[:resource_owner_id]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_parameters; end",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_params; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def get_balance (opts={})\n query_param_keys = []\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n \n }.merge(opts)\n\n #resource path\n path = \"/get-balance.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def service_type_name\n \"REST\"\n end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def service_endpoint; end",
"def service_endpoint; end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def region_params\n params.require(:region).permit(:name, :type)\n end",
"def rest_endpoint=(_arg0); end",
"def rest_endpoint; end",
"def http_options; end",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def private_get_address_book_get_with_http_info(currency, type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_get_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/private/get_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_get_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def endpoints; end",
"def build_request(method); end",
"def region_params\n params.require(:region).permit(:name, :website, :info)\n end",
"def http_params\n {}\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(params)\n\n # Add auth header\n headers = params[:headers] || {}\n headers['x-vcloud-authorization'] = @auth_key if !@auth_key.nil? || !@auth_key.equal?('')\n\n # set connection options\n options = {:url => params[:url],\n :body => params[:body] || '',\n :expects => params[:expects] || 200,\n :headers => headers || {},\n :method => params[:method] || 'GET'\n }\n\n # connect\n res = RestClient::Request.execute options\n\n raise res if (res.code!=params[:expects] && res.code!=200)\n\n res\n\n\n end",
"def update_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.update_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.update_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.update_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.update_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#update_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def get_endpoint()\n end",
"def private_add_to_address_book_get_with_http_info(currency, type, address, name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_add_to_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling InternalApi.private_add_to_address_book_get\"\n end\n # resource path\n local_var_path = '/private/add_to_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n query_params[:'address'] = address\n query_params[:'name'] = name\n query_params[:'tfa'] = opts[:'tfa'] if !opts[:'tfa'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_add_to_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def resource_params\n raise NotImplementedError\n end",
"def create_load_balancer_pool_with_http_info(lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool ...'\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#create_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def create_brand request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_brand_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Iap::V1::Brand.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def initialize(**options)\n @api_client = PayPoint::Blue::API.new(**options)\n super\n end",
"def initialize(client, resource_type, method, params)\n @client = client\n @resource_type = resource_type.to_sym\n @method = method.to_sym\n @params = params\n perform\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def initialize\n @format = 'json'\n @scheme = 'https'\n @host = 'api.taxamo.com'\n @base_path = ''\n @user_agent = \"ruby-swagger\"\n @inject_format = true\n @force_ending_format = false\n @camelize_params = false\n end",
"def initialize options = {}\n \n if options[:endpoint]\n options[:\"#{self.class.service_ruby_name}_endpoint\"] = \n options.delete(:endpoint)\n end\n \n options_without_config = options.dup\n @config = options_without_config.delete(:config)\n @config ||= AWS.config\n @config = @config.with(options_without_config)\n @signer = @config.signer\n @http_handler = @config.http_handler\n @stubs = {}\n \n end",
"def initialize(request_url, params, client, options = {})\n if params.is_a?(String)\n @string_params = params\n @hash_params = Hash.from_url_params(params)\n else\n unless options.kind_of?(Hash)\n options = {}\n end\n options[:skip_param_keys] ||= []\n #this is a bit of helpful sugar for rails framework users\n options[:skip_param_keys] |= ['action','controller']\n\n if params.respond_to?(:reject)\n params.reject! {|key, val| options[:skip_param_keys].include?(key) }\n else\n params = {}\n end\n @hash_params = params\n @string_params = InboundRequest.get_http_params(@hash_params)\n end\n #puts \"Params are: #{params.inspect}\"\n @request_url = request_url\n @client = client\n @supplied_signature = @hash_params[self.class::SIGNATURE_KEY]\n @allow_sigv1 = options[:allow_sigv1] || false\n end",
"def insert request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/routers\"\n body = request_pb.router_resource.to_json\n\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"def request_method; end",
"def payment_methods_post_with_http_info(create_payment_method_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentMethodsApi.payment_methods_post ...'\n end\n # verify the required parameter 'create_payment_method_request' is set\n if @api_client.config.client_side_validation && create_payment_method_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_payment_method_request' when calling PaymentMethodsApi.payment_methods_post\"\n end\n # resource path\n local_var_path = '/payment-methods'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Trace-Id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n header_params[:'End-User-Device-Id'] = opts[:'end_user_device_id'] if !opts[:'end_user_device_id'].nil?\n header_params[:'End-User-Ip'] = opts[:'end_user_ip'] if !opts[:'end_user_ip'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_payment_method_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PaymentMethod'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BearerAuth']\n\n new_options = opts.merge(\n :operation => :\"PaymentMethodsApi.payment_methods_post\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentMethodsApi#payment_methods_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def prepare_http_requests\n {\n label: :uber_prices,\n url: @uber_api_service.estimates_price_url([@trip.destination.lat, @trip.destination.lng], [@trip.origin.lat, @trip.origin.lng]),\n action: :get,\n options: {\n head: @uber_api_service.headers \n }\n }\n end",
"def request(endpoint, request, &block); end",
"def get_regions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: HistoricalApi.get_regions ...'\n end\n # unbox the parameters from the hash\n # resource path\n local_var_path = '/stats/regions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'HistoricalRegionsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"HistoricalApi.get_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: HistoricalApi#get_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http; end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def query_parameters; end",
"def service_request(service); end",
"def initialize(*)\n super\n @json_rpc_call_id = 0\n @json_rpc_endpoint = URI.parse(currency.rpc)\n end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def valid_params_request?; end",
"def get_cloud_regions_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.get_cloud_regions_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.get_cloud_regions_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.get_cloud_regions_by_moid\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#get_cloud_regions_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def block_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.block ...'\n end\n # resource path\n local_var_path = '/api/v1/block'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'seq'] = opts[:'seq'] if !opts[:'seq'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<BlockSchema>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#block\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def address_params\n end",
"def list_load_balancer_pools_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPoolListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#list_load_balancer_pools\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_balance_with_http_info(coin_type, address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AddressApi.get_balance ...'\n end\n # verify the required parameter 'coin_type' is set\n if @api_client.config.client_side_validation && coin_type.nil?\n fail ArgumentError, \"Missing the required parameter 'coin_type' when calling AddressApi.get_balance\"\n end\n # verify enum value\n allowable_values = [\"BITCOIN\", \"ETHEREUM\", \"TESTNET3\", \"BITCOIN_CASH\", \"BITCOIN_GOLD\", \"LITECOIN\", \"DASH\", \"DOGE\", \"BITCOIN_PRIVATE\", \"ZCASH\", \"ZCASH_TESTNET\", \"ZCLASSIC\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(coin_type)\n fail ArgumentError, \"invalid value for \\\"coin_type\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling AddressApi.get_balance\"\n end\n # resource path\n local_var_path = '/api/address/balance/{coin_type}/{address}'.sub('{' + 'coin_type' + '}', CGI.escape(coin_type.to_s)).sub('{' + 'address' + '}', CGI.escape(address.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'BalanceReply' \n\n # auth_names\n auth_names = opts[:auth_names] || ['ApiKeyAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AddressApi#get_balance\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def initialize(params)\n\n @client_id = params[:client_id]\n @balances_to_fetch = params[:balances_to_fetch]\n\n @api_credentials = {}\n\n end",
"def balance_post_with_http_info(addrs, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.balance_post ...'\n end\n # verify the required parameter 'addrs' is set\n if @api_client.config.client_side_validation && addrs.nil?\n fail ArgumentError, \"Missing the required parameter 'addrs' when calling DefaultApi.balance_post\"\n end\n # resource path\n local_var_path = '/api/v1/balance'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = addrs\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#balance_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_options=(_arg0); end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def request_method_symbol; end",
"def operation_for!(operation_class, options, &block)\n params = options[:params] || self.params # TODO: test params: parameter properly in all 4 methods.\n params = params!(params)\n process_params!(params) # deprecate or rename to #setup_params!\n\n res, op = Trailblazer::Endpoint.new(operation_class, params, request, options).(&block)\n setup_operation_instance_variables!(op, options)\n\n [res, op, options.merge(params: params)]\n end",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def region_name_params\n params.require( :region_name ).permit( :country_name_id, :code, :label )\n end",
"def request(*args); end",
"def http_method\n METHODS[self[:method]]\n end",
"def create_request\r\n request = @svc.createRequest(\"ReferenceDataRequest\")\r\n\r\n @identifiers.each {|identifier| request.append(\"securities\", identifier) }\r\n \r\n @options.each do |key, value|\r\n next if key == :fields or key == :overrides\r\n request.set(key.to_s, convert_value_to_bberg(value))\r\n end\r\n \r\n @options[:fields].each {|f| request.append(\"fields\", f) }\r\n \r\n overrides = request.getElement(\"overrides\")\r\n @options[:overrides].each do |field_id, value|\r\n new_override = overrides.appendElement()\r\n new_override.setElement(\"fieldId\", field_id.to_s)\r\n new_override.setElement(\"value\", convert_value_to_bberg(value))\r\n end\r\n @request = request\r\n end",
"def params\n {\n \"add-header\" => nil,\n \"burst-length\" => nil,\n \"client\" => nil,\n \"close-with-reset\" => nil,\n \"debug\" => nil,\n \"failure-status\" => nil,\n \"hog\" => nil,\n \"http-version\" => nil,\n \"max-connections\" => nil,\n \"max-piped-calls\" => nil,\n \"method\" => nil,\n \"no-host-hdr\" => nil,\n \"num-calls\" => nil,\n \"num-conns\" => nil,\n \"period\" => nil,\n \"port\" => nil,\n \"print-reply\" => nil,\n \"print-request\" => nil,\n \"rate\" => nil,\n \"recv-buffer\" => nil,\n \"retry-on-failure\" => nil,\n \"send-buffer\" => nil,\n \"server\" => nil,\n \"server-name\" => nil,\n \"session-cookies\" => nil,\n \"ssl\" => nil,\n \"ssl-ciphers\" => nil,\n \"ssl-no-reuse\" => nil,\n \"think-timeout\" => nil,\n \"timeout\" => nil,\n \"uri\" => nil,\n \"verbose\" => nil,\n \"version\" => nil,\n \"wlog\" => nil,\n \"wsess\" => nil,\n \"wsesslog\" => nil,\n \"wset\" => nil\n }\n end",
"def bi_service\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def resourceType\n 'Endpoint'\n end",
"def v1_provider_operation_params\n params.require(:provideroperation).permit(\n :orgnaization_id,\n :provider_id,\n :name,\n :operation_type,\n :units_number,\n :cost,\n :discount,\n :amount_paid,\n :remaining,\n :total,\n :status,\n :description\n )\n end"
] | [
"0.6802249",
"0.65976703",
"0.6059916",
"0.5987703",
"0.57154024",
"0.5691563",
"0.56653047",
"0.56263",
"0.5624155",
"0.55704135",
"0.55603266",
"0.5530433",
"0.5448158",
"0.5448158",
"0.5448158",
"0.5448158",
"0.5431011",
"0.54160184",
"0.5415401",
"0.54129857",
"0.53938115",
"0.53938115",
"0.5388948",
"0.53675425",
"0.53494006",
"0.53461784",
"0.5336224",
"0.53247535",
"0.532387",
"0.53080666",
"0.52948105",
"0.5293043",
"0.5284355",
"0.5283316",
"0.52832747",
"0.5280295",
"0.5272759",
"0.52632487",
"0.52519625",
"0.5240786",
"0.5228685",
"0.52262473",
"0.52235657",
"0.52199197",
"0.52186733",
"0.5202828",
"0.52024716",
"0.51928127",
"0.5186014",
"0.51846814",
"0.5182837",
"0.5173036",
"0.5173036",
"0.5170146",
"0.5170146",
"0.5164614",
"0.5161106",
"0.5158128",
"0.51313996",
"0.51241755",
"0.51231396",
"0.5119382",
"0.51149493",
"0.510748",
"0.51040053",
"0.5102804",
"0.5096137",
"0.5083374",
"0.50735337",
"0.50703794",
"0.506445",
"0.50620675",
"0.5055505",
"0.5036546",
"0.50295925",
"0.5021944",
"0.50174606",
"0.5012677",
"0.5007215",
"0.49998268",
"0.4999552",
"0.4996625",
"0.49958485",
"0.49905568",
"0.49886626",
"0.4985077",
"0.49848658",
"0.49830186",
"0.4981966",
"0.4979768",
"0.49788475",
"0.49779823",
"0.49742153",
"0.4972966",
"0.49727547",
"0.49719015",
"0.49685338",
"0.49636796",
"0.49578506",
"0.49578476"
] | 0.6680468 | 1 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: backend_server_port, type: Integer name: cookie, type: String name: cookie_timeout, type: Integer name: domain, type: String name: health_check, type: String name: health_check_timeout, type: Integer name: healthy_threshold, type: Integer name: host_id, type: String name: interval, type: Integer name: listener_port, type: Integer name: listener_status, type: String name: load_balancer_id, type: String name: owner_account, type: String name: scheduler, type: String name: sticky_session, type: String name: sticky_session_type, type: String name: u_r_i, type: String name: unhealthy_threshold, type: Integer name: x_forwarded_for, type: String | def create_load_balancer_h_t_t_p_listener(optional={})
args = self.class.new_params
args[:query]['Action'] = 'CreateLoadBalancerHTTPListener'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :backend_server_port
args[:query]['BackendServerPort'] = optional[:backend_server_port]
end
if optional.key? :cookie
args[:query]['Cookie'] = optional[:cookie]
end
if optional.key? :cookie_timeout
args[:query]['CookieTimeout'] = optional[:cookie_timeout]
end
if optional.key? :domain
args[:query]['Domain'] = optional[:domain]
end
if optional.key? :health_check
args[:query]['HealthCheck'] = optional[:health_check]
end
if optional.key? :health_check_timeout
args[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]
end
if optional.key? :healthy_threshold
args[:query]['HealthyThreshold'] = optional[:healthy_threshold]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :interval
args[:query]['Interval'] = optional[:interval]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :listener_status
args[:query]['ListenerStatus'] = optional[:listener_status]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
if optional.key? :scheduler
args[:query]['Scheduler'] = optional[:scheduler]
end
if optional.key? :sticky_session
args[:query]['StickySession'] = optional[:sticky_session]
end
if optional.key? :sticky_session_type
args[:query]['StickySessionType'] = optional[:sticky_session_type]
end
if optional.key? :u_r_i
args[:query]['URI'] = optional[:u_r_i]
end
if optional.key? :unhealthy_threshold
args[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]
end
if optional.key? :x_forwarded_for
args[:query]['XForwardedFor'] = optional[:x_forwarded_for]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_parameters; end",
"def params\n {\n \"add-header\" => nil,\n \"burst-length\" => nil,\n \"client\" => nil,\n \"close-with-reset\" => nil,\n \"debug\" => nil,\n \"failure-status\" => nil,\n \"hog\" => nil,\n \"http-version\" => nil,\n \"max-connections\" => nil,\n \"max-piped-calls\" => nil,\n \"method\" => nil,\n \"no-host-hdr\" => nil,\n \"num-calls\" => nil,\n \"num-conns\" => nil,\n \"period\" => nil,\n \"port\" => nil,\n \"print-reply\" => nil,\n \"print-request\" => nil,\n \"rate\" => nil,\n \"recv-buffer\" => nil,\n \"retry-on-failure\" => nil,\n \"send-buffer\" => nil,\n \"server\" => nil,\n \"server-name\" => nil,\n \"session-cookies\" => nil,\n \"ssl\" => nil,\n \"ssl-ciphers\" => nil,\n \"ssl-no-reuse\" => nil,\n \"think-timeout\" => nil,\n \"timeout\" => nil,\n \"uri\" => nil,\n \"verbose\" => nil,\n \"version\" => nil,\n \"wlog\" => nil,\n \"wsess\" => nil,\n \"wsesslog\" => nil,\n \"wset\" => nil\n }\n end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def http_options; end",
"def service_endpoint; end",
"def service_endpoint; end",
"def endpoints; end",
"def request_params; end",
"def query_parameters; end",
"def http; end",
"def unboundRequest(params)\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n\n resources = []\n\n h1 = Hash.new\n h2 = Hash.new\n\n # puts Time.zone.now\n\n if params[:start_date] != \"\"\n valid_from = params[:start_date] + \":00 \"\n valid_from = Time.zone.parse(valid_from)\n else\n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n time_from = roundTimeUp(time_now)\n valid_from = Time.zone.now.to_s.split(\" \")[0] + \" \" +time_from+ \":00 \"\n valid_from = Time.zone.parse(valid_from)\n end\n\n #For nodes\n if params[:number_of_nodes] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_nodes].to_i.times {resources << h1}\n\n end\n\n #For channels\n if params[:number_of_channels] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_channels].to_i.times {resources << h1}\n\n end\n\n options = {body: {\n resources: resources\n }.to_json, :headers => { 'Content-Type' => 'application/json' } , :verify => false}\n response = HTTParty.get(broker_url+\"/resources\", options)\n\n puts options\n\n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response\n flash[:danger] = response\n else \n puts response\n response[\"resource_response\"][\"resources\"].each do |element|\n element[\"valid_from\"] = Time.zone.parse(element[\"valid_from\"]).to_s\n element[\"valid_until\"] = Time.zone.parse(element[\"valid_until\"]).to_s\n end\n\n return response\n end\n end",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def api(params = {})\n Celluloid::Logger.info \"Registering api...\"\n self.use_api = true\n self.api_host = params[:host] || '127.0.0.1'\n self.api_port = params[:port] || '4321'\n end",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def rest_endpoint; end",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def rest_endpoint=(_arg0); end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_params\n {}\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http=(_arg0); end",
"def platform_endpoint; end",
"def turbot_api_parameters\n uri = URI.parse(host)\n\n {\n :host => uri.host,\n :port => uri.port,\n :scheme => uri.scheme,\n }\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def request_method; end",
"def get_endpoint()\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def endpoint_options\n {user: @username,\n pass: @password,\n host: @host,\n port: @port,\n operation_timeout: @timeout_in_seconds,\n no_ssl_peer_verification: true,\n disable_sspi: true}\n end",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def initialize(host, username, password, port=443, sslcheck=false, timeout=8)\n @resturl = sprintf('https://%s:%d/rest', host, port)\n @rpcurl = sprintf('https://%s:%d/rpc', host, port)\n @timeout = timeout\n @sslcheck = sslcheck\n @username = Base64.strict_encode64(username)\n @password = Base64.strict_encode64(password)\n\n # Map the new naming convention against the old one\n #FIXME# Filtering json hash content can be done this way\n # h1 = {:a => 1, :b => 2, :c => 3, :d => 4}\n # h1.slice(:a, :b) # return {:a=>1, :b=>2}, but h1 is not changed\n # h2 = h1.slice!(:a, :b) # h1 = {:a=>1, :b=>2}, h2 = {:c => 3, :d => 4}\n @servicemapper = {\n 'ip_site_add' => ['ip_site_add', 'This service allows to add an IP address Space.'],\n 'ip_site_update' => ['ip_site_add', 'This service allows to update an IP address Space.'],\n 'ip_site_count' => ['ip_site_count', 'This service returns the number of IP address Spaces matching optional condition(s).'],\n 'ip_site_list' => ['ip_site_list', 'This service returns a list of IP address Spaces matching optional condition(s).'],\n 'ip_site_info' => ['ip_site_info', 'This service returns information about a specific IP address Space.'],\n 'ip_site_delete' => ['ip_site_delete', 'This service allows to delete a specific IP address Space.'],\n 'ip_subnet_add' => ['ip_subnet_add', 'This service allows to add an IPv4 Network of type Subnet or Block.'],\n 'ip_subnet_update' => ['ip_subnet_add', 'This service allows to update an IPv4 Network of type Subnet or Block.'],\n 'ip_subnet_count' => ['ip_block_subnet_count', 'This service returns the number of IPv4 Networks matching optional condition(s).'],\n 'ip_subnet_list' => ['ip_block_subnet_list', 'This service returns a list of IPv4 Networks matching optional condition(s).'],\n 'ip_subnet_info' => ['ip_block_subnet_info', 'This service returns information about a specific IPv4 Network.'],\n 'ip_subnet_delete' => ['ip_subnet_delete', 'This service allows to delete a specific IPv4 Network.'],\n 'ip_subnet_find_free' => ['ip_find_free_subnet', 'This service allows to retrieve a list of available IPv4 Networks matching optional condition(s).'],\n 'ip_subnet6_add' => ['ip6_subnet6_add', 'This service allows to add an IPv6 Network of type Subnet or Block.'],\n 'ip_subnet6_update' => ['ip6_subnet6_add', 'This service allows to update an IPv6 Network of type Subnet or Block.'],\n 'ip_subnet6_count' => ['ip6_block6_subnet6_count', 'This service returns the number of IPv6 Networks matching optional condition(s).'],\n 'ip_subnet6_list' => ['ip6_block6_subnet6_list', 'This service returns a list of IPv6 Networks matching optional condition(s).'],\n 'ip_subnet6_info' => ['ip6_block6_subnet6_info', 'This service returns information about a specific IPv6 Network.'],\n 'ip_subnet6_delete' => ['ip6_subnet6_delete', 'This service allows to delete a specific IPv6 Network.'],\n 'ip_subnet6_find_free' => ['ip6_find_free_subnet6', 'This service allows to retrieve a list of available IPv6 Networks matching optional condition(s).'],\n 'ip_pool_add' => ['ip_pool_add', 'This service allows to add an IPv4 Address Pool.'],\n 'ip_pool_update' => ['ip_pool_add', 'This service allows to update an IPv4 Address Pool.'],\n 'ip_pool_count' => ['ip_pool_count', 'This service returns the number of IPv4 Address Pools matching optional condition(s).'],\n 'ip_pool_list' => ['ip_pool_list', 'This service returns a list of IPv4 Address Pools matching optional condition(s).'],\n 'ip_pool_info' => ['ip_pool_info', 'This service returns information about a specific IPv4 Address Pool.'],\n 'ip_pool_delete' => ['ip_pool_delete', 'This service allows to delete a specific IPv4 Address Pool.'],\n 'ip_pool6_add' => ['ip6_pool6_add', 'This service allows to add an IPv6 Address Pool.'],\n 'ip_pool6_update' => ['ip6_pool6_add', 'This service allows to update an IPv6 Address Pool.'],\n 'ip_pool6_count' => ['ip6_pool6_count', 'This service returns the number of IPv6 Address Pools matching optional condition(s).'],\n 'ip_pool6_list' => ['ip6_pool6_list', 'This service returns a list of IPv6 Address Pools matching optional condition(s).'],\n 'ip_pool6_info' => ['ip6_pool6_info', 'This service returns information about a specific IPv6 Address Pool.'],\n 'ip_pool6_delete' => ['ip6_pool6_delete', 'This service allows to delete a specific IPv6 Address Pool.'],\n 'ip_address_add' => ['ip_add', 'This service allows to add an IPv4 Address.'],\n 'ip_address_update' => ['ip_add', 'This service allows to update an IPv4 Address.'],\n 'ip_address_count' => ['ip_address_count', 'This service returns the number of IPv4 Addresses matching optional condition(s).'],\n 'ip_address_list' => ['ip_address_list', 'This service returns a list of IPv4 Addresses matching optional condition(s).'],\n 'ip_address_info' => ['ip_address_info', 'This service returns information about a specific IPv4 Address.'],\n 'ip_address_delete' => ['ip_delete', 'This service allows to delete a specific IPv4 Address.'],\n 'ip_address_find_free' => ['ip_find_free_address', 'This service allows to retrieve a list of available IPv4 Addresses matching optional condition(s).'],\n 'ip_address6_add' => ['ip6_address6_add', 'This service allows to add an IPv6 Address'],\n 'ip_address6_update' => ['ip6_address6_add', 'This service allows to update an IPv6 Address'],\n 'ip_address6_count' => ['ip6_address6_count', 'This service returns the number of IPv6 Addresses matching optional condition(s).'],\n 'ip_address6_list' => ['ip6_address6_list', 'This service returns a list of IPv6 Addresses matching optional condition(s).'],\n 'ip_address6_info' => ['ip6_address6_info', 'This service returns information about a specific IPv6 Address.'],\n 'ip_address6_delete' => ['ip6_address6_delete', 'This service allows to delete a specific IPv6 Address.'],\n 'ip_address6_find_free' => ['ip6_find_free_address6', 'This service allows to retrieve a list of available IPv6 Addresses matching optional condition(s).'],\n 'ip_alias_add' => ['ip_alias_add', 'This service allows to associate an Alias of type A or CNAME to an IPv4 Address.'],\n 'ip_alias_list' => ['ip_alias_list', 'This service returns the list of an IPv4 Address\\' associated Aliases.'],\n 'ip_alias_delete' => ['ip_alias_delete', 'This service allows to remove an Alias associated to an IPv4 Address.'],\n 'ip_alias6_add' => ['ip6_alias_add', 'This service allows to associate an Alias of type A or CNAME to an IPv4 Address.'],\n 'ip_alias6_list' => ['ip6_alias_list', 'This service returns the list of an IPv6 Address\\' associated Aliases.'],\n 'ip_alias6_delete' => ['ip6_alias_delete', 'This service allows to remove an Alias associated to an IPv6 Address.'],\n 'vlm_domain_add' => ['vlm_domain_add', 'This service allows to add a VLAN Domain.'],\n 'vlm_domain_update' => ['vlm_domain_add', 'This service allows to update a VLAN Domain.'],\n 'vlm_domain_count' => ['vlmdomain_count', 'This service returns the number of VLAN Domains matching optional condition(s).'],\n 'vlm_domain_list' => ['vlmdomain_list', 'This service returns a list of VLAN Domains matching optional condition(s).'],\n 'vlm_domain_info' => ['vlmdomain_info', 'This service returns information about a specific VLAN Domain.'],\n 'vlm_domain_delete' => ['vlm_domain_delete', 'This service allows to delete a specific VLAN Domain.'],\n 'vlm_range_add' => ['vlm_range_add', 'This service allows to add a VLAN Range.'],\n 'vlm_range_update' => ['vlm_range_add', 'This service allows to update a VLAN Range.'],\n 'vlm_range_count' => ['vlmrange_count', 'This service returns the number of VLAN Ranges matching optional condition(s).'],\n 'vlm_range_list' => ['vlmrange_list', 'This service returns a list of VLAN Domains matching optional condition(s).'],\n 'vlm_range_info' => ['vlmrange_info', 'This service returns information about a specific VLAN Range.'],\n 'vlm_range_delete' => ['vlm_range_delete', 'This service allows to delete a specific VLAN Range.'],\n 'vlm_vlan_add' => ['vlm_vlan_add', 'This service allows to add a VLAN.'],\n 'vlm_vlan_update' => ['vlm_vlan_add', 'This service allows to update a VLAN.'],\n 'vlm_vlan_count' => ['vlmvlan_count', 'This service returns the number of VLANs matching optional condition(s).'],\n 'vlm_vlan_list' => ['vlmvlan_list', 'This service returns a list of VLANs matching optional condition(s).'],\n 'vlm_vlan_info' => ['vlmvlan_info', 'This service returns information about a specific VLAN.'],\n 'vlm_vlan_delete' => ['vlm_vlan_delete', 'This service allows to delete a specific VLAN.']\n }\n end",
"def to_http_health_params\n {\n port: http_health_port,\n path: http_health_path\n }\n end",
"def request(*args); end",
"def query_parameters\n end",
"def http_options=(_arg0); end",
"def base_params\n {\n v: PROTOCOL_VERSION,\n # Client ID\n cid: @user_id,\n # Tracking ID\n tid: TRACKING_ID,\n # Application Name\n an: APPLICATION_NAME,\n # Application Version\n av: Bolt::VERSION,\n # Anonymize IPs\n aip: true,\n # User locale\n ul: Locale.current.to_rfc,\n # Custom Dimension 1 (Operating System)\n cd1: @os\n }\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def request_params\n rid = create_uuid\n request_type = params[:request_type]\n request_url = params[:url]\n request_parameters = params[:request_parameters]\n request_headers = params[:request_headers]\n request_payload = params[:request_payload]\n username = params[:username]\n password = params[:password]\n private_request = params[:private_request]\n\n request = Faraday.new\n\n # If authentication is filled out, apply it.\n request.basic_auth(username, password) if username.present?\n\n # Be nice and send a descriptive user agent. Also handy for debugging and\n # tracking down potential problems.\n request.headers['User-Agent'] = 'ReHTTP/v1.0'\n\n # Split the additional headers out into the name and value and then apply\n # then to the request.\n request_headers.split(\"\\r\\n\").each do |header|\n header_components = header.split(':')\n request.headers[header_components[0]] = header_components[1]\n end\n\n # Ensure the parameters are available before trying to create a new hash\n # from them.\n if request_parameters.present?\n request_params = Hash[request_parameters.split(\"\\r\\n\").map {|params| params.split('=') }]\n else\n request_params = {}\n end\n\n case request_type\n when 'GET'\n response = request.get(request_url, request_params)\n when 'POST'\n response = request.post(request_url, request_payload)\n when 'PUT'\n response = request.put(request_url, request_params)\n when 'DELETE'\n response = request.delete request_url\n when 'OPTIONS'\n response = request.options request_url\n when 'HEAD'\n response = request.head request_url\n when 'PATCH'\n response = request.patch request_url\n end\n\n {\n rid: rid,\n request_type: request_type,\n url: request_url,\n private_request: private_request,\n request_data: {\n headers: request.headers,\n data: {}\n }.to_json,\n response_data: {\n headers: response.headers,\n body: response.body,\n status: response.status\n }.to_json\n }\n end",
"def initialize params = {}\n defaults = {\n :port => 80,\n :user_agent => 'Net::HTTP::RestClient'\n }\n if params[:port]==443 && !params[:ssl]\n defaults.merge! :ssl => {\n :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE\n } \n end\n @params = defaults.merge(params)\n @cookies = {}\n @headers = {}\n @params[:headers] && @headers=@params[:headers]\n @params[:cookies] && @cookies=@params[:cookies]\n end",
"def service_type_name\n \"REST\"\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def valid_params_request?; end",
"def http_call(payload); end",
"def get_parameters; end",
"def get_parameters; end",
"def endpoint\n raise NotImplementedError\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def service_request(service); end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def server_params\n params.permit(:uuid, :addr, :port, :status)\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def request(*args)\n end",
"def parameter_types; end",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def restclient_option_keys\n [:method, :url, :payload, :headers, :timeout, :open_timeout,\n :verify_ssl, :ssl_client_cert, :ssl_client_key, :ssl_ca_file]\n end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def to_grpc_params\n {\n pool_size: rpc_pool_size,\n max_waiting_requests: rpc_max_waiting_requests,\n poll_period: rpc_poll_period,\n pool_keep_alive: rpc_pool_keep_alive,\n tls_credentials: tls_credentials,\n server_args: enhance_grpc_server_args(normalized_grpc_server_args)\n }\n end",
"def query_params; end",
"def request_type; \"RequestType\"; end",
"def parameter_type; end",
"def parameter_type; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end"
] | [
"0.607202",
"0.6055937",
"0.59630394",
"0.59630394",
"0.59630394",
"0.59630394",
"0.58797115",
"0.5841207",
"0.5841207",
"0.57641506",
"0.575487",
"0.5703929",
"0.5680632",
"0.5677272",
"0.5671812",
"0.5650069",
"0.5649988",
"0.5599758",
"0.55951846",
"0.55802613",
"0.5556202",
"0.55507046",
"0.5544452",
"0.5532583",
"0.55045354",
"0.5465438",
"0.5465438",
"0.54483706",
"0.54438287",
"0.5439824",
"0.5439306",
"0.54235643",
"0.54217744",
"0.54187316",
"0.54073304",
"0.5402051",
"0.5400813",
"0.53922206",
"0.5375993",
"0.5372765",
"0.5372495",
"0.53607726",
"0.53596246",
"0.53571624",
"0.53569585",
"0.53452164",
"0.5344351",
"0.5342821",
"0.53415155",
"0.5317724",
"0.53112274",
"0.53021014",
"0.5291418",
"0.5285192",
"0.5282446",
"0.5265367",
"0.5265367",
"0.52561915",
"0.52480453",
"0.52423674",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.5237822",
"0.52197284",
"0.5216249",
"0.520853",
"0.51990753",
"0.51876485",
"0.51876074",
"0.51876074",
"0.51876074",
"0.51876074",
"0.51876074",
"0.51724696",
"0.5171985",
"0.5171985",
"0.5171985",
"0.5171985",
"0.5171985",
"0.5171985",
"0.5171985",
"0.5171985",
"0.5170035",
"0.51641226",
"0.51591516",
"0.5157784",
"0.5157784",
"0.5155207",
"0.5155207",
"0.5155207",
"0.5155207",
"0.5155207"
] | 0.5866774 | 7 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: backend_server_port, type: Integer name: connect_port, type: Integer name: connect_timeout, type: Integer name: health_check, type: String name: host_id, type: String name: interval, type: Integer name: listener_port, type: Integer name: listener_status, type: String name: load_balancer_id, type: String name: owner_account, type: String name: persistence_timeout, type: Integer name: scheduler, type: String | def create_load_balancer_t_c_p_listener(optional={})
args = self.class.new_params
args[:query]['Action'] = 'CreateLoadBalancerTCPListener'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :backend_server_port
args[:query]['BackendServerPort'] = optional[:backend_server_port]
end
if optional.key? :connect_port
args[:query]['ConnectPort'] = optional[:connect_port]
end
if optional.key? :connect_timeout
args[:query]['ConnectTimeout'] = optional[:connect_timeout]
end
if optional.key? :health_check
args[:query]['HealthCheck'] = optional[:health_check]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :interval
args[:query]['Interval'] = optional[:interval]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :listener_status
args[:query]['ListenerStatus'] = optional[:listener_status]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
if optional.key? :persistence_timeout
args[:query]['PersistenceTimeout'] = optional[:persistence_timeout]
end
if optional.key? :scheduler
args[:query]['Scheduler'] = optional[:scheduler]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def params\n {\n \"add-header\" => nil,\n \"burst-length\" => nil,\n \"client\" => nil,\n \"close-with-reset\" => nil,\n \"debug\" => nil,\n \"failure-status\" => nil,\n \"hog\" => nil,\n \"http-version\" => nil,\n \"max-connections\" => nil,\n \"max-piped-calls\" => nil,\n \"method\" => nil,\n \"no-host-hdr\" => nil,\n \"num-calls\" => nil,\n \"num-conns\" => nil,\n \"period\" => nil,\n \"port\" => nil,\n \"print-reply\" => nil,\n \"print-request\" => nil,\n \"rate\" => nil,\n \"recv-buffer\" => nil,\n \"retry-on-failure\" => nil,\n \"send-buffer\" => nil,\n \"server\" => nil,\n \"server-name\" => nil,\n \"session-cookies\" => nil,\n \"ssl\" => nil,\n \"ssl-ciphers\" => nil,\n \"ssl-no-reuse\" => nil,\n \"think-timeout\" => nil,\n \"timeout\" => nil,\n \"uri\" => nil,\n \"verbose\" => nil,\n \"version\" => nil,\n \"wlog\" => nil,\n \"wsess\" => nil,\n \"wsesslog\" => nil,\n \"wset\" => nil\n }\n end",
"def unboundRequest(params)\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n\n resources = []\n\n h1 = Hash.new\n h2 = Hash.new\n\n # puts Time.zone.now\n\n if params[:start_date] != \"\"\n valid_from = params[:start_date] + \":00 \"\n valid_from = Time.zone.parse(valid_from)\n else\n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n time_from = roundTimeUp(time_now)\n valid_from = Time.zone.now.to_s.split(\" \")[0] + \" \" +time_from+ \":00 \"\n valid_from = Time.zone.parse(valid_from)\n end\n\n #For nodes\n if params[:number_of_nodes] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_nodes].to_i.times {resources << h1}\n\n end\n\n #For channels\n if params[:number_of_channels] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_channels].to_i.times {resources << h1}\n\n end\n\n options = {body: {\n resources: resources\n }.to_json, :headers => { 'Content-Type' => 'application/json' } , :verify => false}\n response = HTTParty.get(broker_url+\"/resources\", options)\n\n puts options\n\n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response\n flash[:danger] = response\n else \n puts response\n response[\"resource_response\"][\"resources\"].each do |element|\n element[\"valid_from\"] = Time.zone.parse(element[\"valid_from\"]).to_s\n element[\"valid_until\"] = Time.zone.parse(element[\"valid_until\"]).to_s\n end\n\n return response\n end\n end",
"def request_parameters; end",
"def service_endpoint; end",
"def service_endpoint; end",
"def api(params = {})\n Celluloid::Logger.info \"Registering api...\"\n self.use_api = true\n self.api_host = params[:host] || '127.0.0.1'\n self.api_port = params[:port] || '4321'\n end",
"def endpoints; end",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def http_options; end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def rest_endpoint=(_arg0); end",
"def http; end",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def rest_endpoint; end",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint\n raise NotImplementedError\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def service_type_name\n \"REST\"\n end",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def query_parameters; end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def request_params; end",
"def connection_type; end",
"def get_endpoint()\n end",
"def parameter_type; end",
"def parameter_type; end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def params() @param_types end",
"def platform_endpoint; end",
"def parameter_types; end",
"def http=(_arg0); end",
"def to_grpc_params\n {\n pool_size: rpc_pool_size,\n max_waiting_requests: rpc_max_waiting_requests,\n poll_period: rpc_poll_period,\n pool_keep_alive: rpc_pool_keep_alive,\n tls_credentials: tls_credentials,\n server_args: enhance_grpc_server_args(normalized_grpc_server_args)\n }\n end",
"def request(*args); end",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def protocol; end",
"def protocol; end",
"def protocol; end",
"def protocol; end",
"def turbot_api_parameters\n uri = URI.parse(host)\n\n {\n :host => uri.host,\n :port => uri.port,\n :scheme => uri.scheme,\n }\n end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def request_method; end",
"def params\n raise NotImplementedError\n end",
"def http_options=(_arg0); end",
"def request_type; \"RequestType\"; end",
"def http_params\n {}\n end",
"def interface_sender_params\n params.require(:interface_sender).permit(:method_name, :class_name, :status, :operate_time, :url, :url_method, :url_content, :type)\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def endpoint_options\n {user: @username,\n pass: @password,\n host: @host,\n port: @port,\n operation_timeout: @timeout_in_seconds,\n no_ssl_peer_verification: true,\n disable_sspi: true}\n end",
"def initialize(*)\n super\n @json_rpc_call_id = 0\n @json_rpc_endpoint = URI.parse(currency.rpc)\n end",
"def describe_backend_servers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeBackendServers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def send_request para\n raise NotImplementedError.new(\"method not overriden\")\n end",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def transport; end",
"def transport; end",
"def transport; end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def type\n raise Gps::Request::TypeMissingException.new(\"The Gps Request does not have the type implemented. #{@params.inspect}\")\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def _param_agent name, type = nil, one_of: nil, all_of: nil, any_of: nil, not: nil, **schema_hash\n combined_schema = one_of || all_of || any_of || (_not = binding.local_variable_get(:not))\n type = schema_hash[:type] ||= type\n pp \"[ZRO] Syntax Error: param `#{name}` has no schema type!\" and return if type.nil? && combined_schema.nil?\n\n schema_hash = CombinedSchema.new(one_of: one_of, all_of: all_of, any_of: any_of, _not: _not) if combined_schema\n param @param_type.to_s.delete('!'), name, type, (@param_type['!'] ? :req : :opt), schema_hash\n end",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def get_parameters; end",
"def get_parameters; end",
"def query_parameters\n end",
"def update(type, request, body, connection)\n\t\t\tcase type\n\t\t\twhen :response\n\t\t\t\tmethod = request.kind_of?(Net::HTTPSuccess) ? :info : :warn\n\t\t\t\t@logger.send method, \"get response: #{request.inspect} with body #{body}\"\n\t\t\twhen :request\n\t\t\t\tport = \"\"\n\t\t\t\tport = \":#{connection.port}\" if (connection.port.to_i != (connection.use_ssl? ? 443 : 80))\n\t\t\t\turl = \"#{connection.use_ssl? ? \"https\" : \"http\"}://#{connection.address}#{port}\"\n\t\t\t\t@logger.info \"get request for url #{url}#{request.path} with method: #{request.method} with body #{request.body || body}\"\n\t\t\tend\n\t\tend",
"def to_http_health_params\n {\n port: http_health_port,\n path: http_health_path\n }\n end",
"def platform_endpoint=(_arg0); end",
"def request(*args)\n end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def base_params\n {\n v: PROTOCOL_VERSION,\n # Client ID\n cid: @user_id,\n # Tracking ID\n tid: TRACKING_ID,\n # Application Name\n an: APPLICATION_NAME,\n # Application Version\n av: Bolt::VERSION,\n # Anonymize IPs\n aip: true,\n # User locale\n ul: Locale.current.to_rfc,\n # Custom Dimension 1 (Operating System)\n cd1: @os\n }\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end"
] | [
"0.5811262",
"0.57497275",
"0.57497275",
"0.57497275",
"0.57497275",
"0.5679072",
"0.5601781",
"0.55696577",
"0.55462664",
"0.5541359",
"0.5536942",
"0.5536942",
"0.55319947",
"0.55145895",
"0.5465463",
"0.54597014",
"0.5457034",
"0.53781176",
"0.5372368",
"0.5341574",
"0.5325763",
"0.5322379",
"0.53132725",
"0.53132725",
"0.5312956",
"0.53125113",
"0.53085583",
"0.5294954",
"0.5291421",
"0.528823",
"0.52790976",
"0.52568346",
"0.5249486",
"0.5241722",
"0.52378076",
"0.5236671",
"0.5228237",
"0.5228237",
"0.52177477",
"0.5215572",
"0.52123904",
"0.52123904",
"0.52123904",
"0.52123904",
"0.52123904",
"0.5197254",
"0.51931435",
"0.51902515",
"0.5189783",
"0.5151226",
"0.5138589",
"0.51309556",
"0.51300937",
"0.51294845",
"0.51294845",
"0.51294845",
"0.51294845",
"0.5113929",
"0.5112648",
"0.5112648",
"0.51105535",
"0.50928813",
"0.50800824",
"0.5068246",
"0.5066127",
"0.50581163",
"0.50538796",
"0.50535846",
"0.5053477",
"0.5044375",
"0.5035123",
"0.5022126",
"0.5016881",
"0.5002607",
"0.4999203",
"0.4999203",
"0.4999203",
"0.49987417",
"0.49980304",
"0.4992488",
"0.49915382",
"0.49867183",
"0.49863353",
"0.49849072",
"0.49849072",
"0.4983611",
"0.4979041",
"0.49786368",
"0.4974496",
"0.49735862",
"0.4970536",
"0.4970536",
"0.4970536",
"0.4970536",
"0.4970536",
"0.4970536",
"0.4970536",
"0.4970536",
"0.49701682",
"0.4959882"
] | 0.5726488 | 5 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: load_balancer_id, type: String name: owner_account, type: String name: owner_id, type: Long name: resource_owner_account, type: String name: resource_owner_id, type: Long | def delete_load_balancer(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DeleteLoadBalancer'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
if optional.key? :owner_id
args[:query]['OwnerId'] = optional[:owner_id]
end
if optional.key? :resource_owner_account
args[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]
end
if optional.key? :resource_owner_id
args[:query]['ResourceOwnerId'] = optional[:resource_owner_id]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_parameters; end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def request_params; end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def create_load_balancer_pool_with_http_info(lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool ...'\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#create_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_balance (opts={})\n query_param_keys = []\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n \n }.merge(opts)\n\n #resource path\n path = \"/get-balance.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"def resource_params\n raise NotImplementedError\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @loadbalancer = Loadbalancer.new(params[:loadbalancer])\n @loadbalancer.account_id = @oeaccount.id\n respond_to do |format|\n if @loadbalancer.save\n format.html { redirect_to loadbalancers_url, notice: 'Loadbalancer was successfully created.' }\n format.json { render json: @loadbalancer, status: :created, location: @loadbalancer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @loadbalancer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def describe_load_balancer_attribute(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def update_load_balancer_pool_with_http_info(pool_id, lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool ...'\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools/{pool-id}'.sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#update_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def load_balancer_data(balancer = nil)\n params = Smash.new(\"Action\" => \"DescribeLoadBalancers\")\n if balancer\n params[\"LoadBalancerNames.member.1\"] = balancer.id || balancer.name\n end\n result = all_result_pages(nil, :body,\n \"DescribeLoadBalancersResponse\", \"DescribeLoadBalancersResult\",\n \"LoadBalancerDescriptions\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(params),\n )\n end\n if balancer\n health_result = all_result_pages(nil, :body,\n \"DescribeInstanceHealthResponse\", \"DescribeInstanceHealthResult\",\n \"InstanceStates\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(\n \"LoadBalancerName\" => balancer.id || balancer.name,\n \"Action\" => \"DescribeInstanceHealth\",\n ),\n )\n end\n end\n result.map do |blr|\n (balancer || Balancer.new(self)).load_data(\n Smash.new(\n :id => blr[\"LoadBalancerName\"],\n :name => blr[\"LoadBalancerName\"],\n :state => :active,\n :status => \"ACTIVE\",\n :created => blr[\"CreatedTime\"],\n :updated => blr[\"CreatedTime\"],\n :public_addresses => [\n Balancer::Address.new(\n :address => blr[\"DNSName\"],\n :version => 4,\n ),\n ],\n :servers => [blr.get(\"Instances\", \"member\")].flatten(1).compact.map { |i|\n Balancer::Server.new(self.api_for(:compute), :id => i[\"InstanceId\"])\n },\n ).merge(\n health_result.nil? ? {} : Smash.new(\n :server_states => health_result.nil? ? nil : health_result.map { |i|\n Balancer::ServerState.new(\n self.api_for(:compute),\n :id => i[\"InstanceId\"],\n :status => i[\"State\"],\n :reason => i[\"ReasonCode\"],\n :state => i[\"State\"] == \"InService\" ? :up : :down,\n )\n },\n )\n )\n ).valid_state\n end\n end",
"def rest_endpoint=(_arg0); end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def delete_load_balancer(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def adjust_params \n #if request is like this:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations\n if params[:action] == 'index'\n \n # If it is \n # GET /relations\n # Then we cannot sevice this request, must specify the entity.\n# if !params[:database_id] and !params[:entity_id]\n# render :text => 'GET /relations is not available', :status => 400\n# return false;\n# end\n\n # But in the remaining two cases:\n # * /entities/relations\n # * /databases/entities/relations\n # Allow the class\n return true;\n end\n \n # if it is:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations/\n # Becasue show needs to have an ID, therefore\n # any of the above URL will do and no context is needed.\n #FIXME: What other possibility the show action might face?\n if params[:action] == 'show'\n return true;\n end\n \n #If its like this:\n # POST /relations\n # POST /entities/relations\n # POST /databases/entities/relations\n # NOTE: For now, the relation resource should be totally complete\n # even if the call is being as a nested resource.\n #\n if params[:action] == 'create'\n \n #if it is like this:\n # POST /relations\n # Then the relations resource should be complete in\n # every respect.\n if !params[:database_id] and !params[:entity_id]\n #return true if valid_relation_resource?\n # Otherwise, the resource is not vaild and we need to tell the user\n #render :json => report_errors(nil, 'The provided realtion resource is incomplete')[0], \n # :status => 400 and return false;\n end\n \n # But if its something like this:\n # POST /entities/:entity_id/relations\n # POST /databases/entities/:entity_id/relations\n #\n if params[:database_id] or params[:entity_id]\n # Then if the relation resource is valid, \n # the entity_id parameter is altogather ignored.\n #return true if valid_relation_resource? \n end\n return true\n end\n \n # if its either of these:\n # PUT /relations\n # PUT /entities/relations\n # PUT /databases/entities/relations\n #\n if params[:action] == 'update'\n # Set the params[:relation_id] because\n # the underlying Admin::EntitiesController#add_link function\n # expects it\n params[:relation_id] = params[:id] and return true;\n end\n \n # If it is either of these:\n # DELETE /relations\n # DELETE /entities/relations\n # DELETE /databases/entities/relations\n #\n if params[:action] == 'destroy'\n \n # For now, you can only make a nested call.\n #PENDING: This would change when the rest call would include the user\n # authenticiy information which would help to determine whether the \n # relation being deleted belongs to the user or not.\n if !params[:entity_id]\n render :json => report_errors(nil, 'DELETE /relations call is not available for now. Call DELETE /entities/relations instead')[0],\n :status => 400 and return false\n end\n \n params[:source_id] = params[:entity_id]\n return true;\n \n end\n \n # In all cases, the request is not handled by this controller!\n render :json => report_errors(nil, \"The requested action is \\\"#{params[:action]}\\\" \" + \n \" on controller \\\"#{params[:controller]}\\\" while I am\" + \n \" \\\"#{self.class.name}\\\" and cannot handle your request.\")[0],:status => 400 and return false;\n \n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def list_load_balancer_pools_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPoolListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#list_load_balancer_pools\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def http_params\n {}\n end",
"def load_balancer # rubocop:disable AbcSize\n raise 'Can not determine hostname to load client for' if @new_resource.f5.nil?\n @@load_balancers ||= []\n add_lb(@new_resource.f5) if @@load_balancers.empty?\n add_lb(@new_resource.f5) if @@load_balancers.find { |lb| lb.name == @new_resource.f5 }.nil?\n @@load_balancers.find { |lb| lb.name == @new_resource.f5 }\n end",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def rest_endpoint; end",
"def new_brb_in_request(meth, *args)\r\n\r\n if is_brb_request_blocking?(meth)\r\n\r\n m = meth.to_s\r\n m = m[0, m.size - 6].to_sym\r\n\r\n idrequest = args.pop\r\n thread = args.pop\r\n begin\r\n r = ((args.size > 0) ? @object.send(m, *args) : @object.send(m))\r\n brb_send([ReturnCode, r, thread, idrequest])\r\n rescue Exception => e\r\n brb_send([ReturnCode, e, thread, idrequest])\r\n BrB.logger.error e.to_s\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n #raise e\r\n end\r\n else\r\n\r\n begin\r\n (args.size > 0) ? @object.send(meth, *args) : @object.send(meth)\r\n rescue Exception => e\r\n BrB.logger.error \"#{e.to_s} => By calling #{meth} on #{@object.class} with args : #{args.inspect}\"\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n raise e\r\n end\r\n\r\n end\r\n\r\n end",
"def block_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.block ...'\n end\n # resource path\n local_var_path = '/api/v1/block'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'seq'] = opts[:'seq'] if !opts[:'seq'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<BlockSchema>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#block\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request_method; end",
"def service_type_name\n \"REST\"\n end",
"def prepare_http_requests\n {\n label: :uber_prices,\n url: @uber_api_service.estimates_price_url([@trip.destination.lat, @trip.destination.lng], [@trip.origin.lat, @trip.origin.lng]),\n action: :get,\n options: {\n head: @uber_api_service.headers \n }\n }\n end",
"def build_request(method); end",
"def region_params\n params.require(:region).permit(:name, :type)\n end",
"def endpoint_params\n endpoint_data = params.require(:data).require(:attributes).permit(:verb, :path,\n { response: [:code, :body, { headers: {} }] })\n { path: endpoint_data[:path], verb: endpoint_data[:verb], response_code: endpoint_data[:response][:code],\n body: endpoint_data[:response][:body], headers: endpoint_data[:response][:headers] }\n end",
"def method_missing(method_name, *args)\n payload = Kauplus::Client.authenticate_payload(args.first)\n if method_name.match(/(get|post|multipart_post|put|delete|head)_(.*)/)\n Kauplus::Client.send($1, \"#{@resource}/#{$2}\", payload)\n else\n Kauplus::Client.get(\"#{@resource}/#{method_name}\", payload)\n end\n end",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_options; end",
"def describe_load_balancers(ids = [], options = {})\n ids = [*ids]\n params = {}\n params['Marker'] = options[:marker] if options[:marker]\n params['PageSize'] = options[:page_size] if options[:page_size]\n params.merge!(Fog::AWS.serialize_keys('LoadBalancerArns', ids)) if ids.any?\n params.merge!(Fog::AWS.serialize_keys('Names', options[:names])) if options[:names]\n request({\n 'Action' => 'DescribeLoadBalancers',\n :parser => Fog::Parsers::AWS::ELBV2::DescribeLoadBalancers.new\n }.merge!(params))\n end",
"def valid_params_request?; end",
"def request(endpoint, request, &block); end",
"def endpoints; end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_method\n raise \"Implement in child class\"\n end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs)\n end",
"def arn\n if @config['classic']\n \"arn:\"+(MU::Cloud::AWS.isGovCloud?(@region) ? \"aws-us-gov\" : \"aws\")+\":elasticloadbalancing:\"+@region+\":\"+MU::Cloud::AWS.credToAcct(@credentials)+\":loadbalancer/\"+@cloud_id\n else\n cloud_desc.load_balancer_arn\n end\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def service_endpoint; end",
"def service_endpoint; end",
"def request(*args); end",
"def payment_methods_post_with_http_info(create_payment_method_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentMethodsApi.payment_methods_post ...'\n end\n # verify the required parameter 'create_payment_method_request' is set\n if @api_client.config.client_side_validation && create_payment_method_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_payment_method_request' when calling PaymentMethodsApi.payment_methods_post\"\n end\n # resource path\n local_var_path = '/payment-methods'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Trace-Id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n header_params[:'End-User-Device-Id'] = opts[:'end_user_device_id'] if !opts[:'end_user_device_id'].nil?\n header_params[:'End-User-Ip'] = opts[:'end_user_ip'] if !opts[:'end_user_ip'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_payment_method_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PaymentMethod'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BearerAuth']\n\n new_options = opts.merge(\n :operation => :\"PaymentMethodsApi.payment_methods_post\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentMethodsApi#payment_methods_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def insert request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/routers\"\n body = request_pb.router_resource.to_json\n\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def handle_request( * ) # :nodoc:\n\t\tself.log.debug \"[:restresources] handling request for REST resource.\"\n\t\tsuper\n\tend",
"def operation_params\n params[:operation].permit!\n end",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def region_params\n params.require(:region).permit(:name, :website, :info)\n end",
"def operational_values\n\t\treturn super.merge(\n\t\t\turi: self.uri,\n\t\t\thttp_method: self.http_method,\n\t\t\texpected_status: self.expected_status,\n\t\t\tbody: self.body,\n\t\t\tbody_mimetype: self.body_mimetype\n\t\t)\n\tend",
"def http=(_arg0); end",
"def http; end",
"def update_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.update_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.update_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.update_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.update_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#update_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def operations\n # Base URI works as-is.\n end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_method_symbol; end",
"def new\n @loadbalancer = Loadbalancer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @loadbalancer }\n end\n end",
"def balance_post_with_http_info(addrs, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.balance_post ...'\n end\n # verify the required parameter 'addrs' is set\n if @api_client.config.client_side_validation && addrs.nil?\n fail ArgumentError, \"Missing the required parameter 'addrs' when calling DefaultApi.balance_post\"\n end\n # resource path\n local_var_path = '/api/v1/balance'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = addrs\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#balance_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def status_params\n end",
"def private_get_address_book_get_with_http_info(currency, type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_get_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/private/get_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_get_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def read_load_balancer_pool_with_http_info(pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.read_load_balancer_pool ...'\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesLoadbalancerApi.read_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools/{pool-id}'.sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#read_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def query_parameters; end",
"def initialize(client, resource_type, method, params)\n @client = client\n @resource_type = resource_type.to_sym\n @method = method.to_sym\n @params = params\n perform\n end"
] | [
"0.68089867",
"0.669338",
"0.66098464",
"0.62013036",
"0.6132031",
"0.59439814",
"0.5936646",
"0.5747338",
"0.5615555",
"0.55655336",
"0.54775256",
"0.54581034",
"0.5422995",
"0.5408604",
"0.54028803",
"0.5401761",
"0.53853136",
"0.5361272",
"0.5351572",
"0.53451025",
"0.5293256",
"0.52458364",
"0.5238256",
"0.5236676",
"0.5225874",
"0.5216422",
"0.5202424",
"0.51977074",
"0.5197547",
"0.51654184",
"0.5152852",
"0.5147492",
"0.5147492",
"0.51456845",
"0.5138188",
"0.5136513",
"0.5136513",
"0.51286095",
"0.51286095",
"0.51286095",
"0.51286095",
"0.51220304",
"0.51118666",
"0.5098679",
"0.50940734",
"0.5087958",
"0.5077384",
"0.50464445",
"0.50444055",
"0.5041285",
"0.5040526",
"0.5039594",
"0.5021216",
"0.501703",
"0.50111336",
"0.5008702",
"0.5005134",
"0.5000529",
"0.49972284",
"0.49960816",
"0.49935296",
"0.4983294",
"0.49608505",
"0.49554288",
"0.49541214",
"0.4949526",
"0.4947734",
"0.4945545",
"0.49445802",
"0.49415976",
"0.49356538",
"0.49250776",
"0.49236816",
"0.49208936",
"0.49208936",
"0.4913966",
"0.49071705",
"0.4906105",
"0.49056667",
"0.49018526",
"0.49008647",
"0.48930985",
"0.4878962",
"0.48730853",
"0.48714036",
"0.48645076",
"0.48635584",
"0.48535803",
"0.48528728",
"0.48527336",
"0.4847541",
"0.48469898",
"0.48439902",
"0.48433587",
"0.48420808",
"0.48409438",
"0.4839304",
"0.48349977",
"0.48322883",
"0.48290074"
] | 0.5686367 | 8 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: listener_port, type: List name: load_balancer_id, type: String name: owner_account, type: String | def delete_load_balancer_listener(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DeleteLoadBalancerListener'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_banancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBanancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def rest_endpoint=(_arg0); end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def request_parameters; end",
"def endpoints; end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def http=(_arg0); end",
"def start_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StartLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def service_endpoint; end",
"def service_endpoint; end",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def request_params; end",
"def http; end",
"def request(*args); end",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request(endpoint, request, &block); end",
"def request_method; end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def rest_endpoint; end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def service_request(service); end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def http_call(payload); end",
"def build_request(method); end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def http_options; end",
"def send_request(method, params, &block); end",
"def validated_name_args(method_name, body)\n @args = json_parse(body)\n args = case method_name\n when /^sha$/ then []\n when /^alive$/ then []\n when /^ready$/ then []\n when /^image_names$/ then []\n when /^names$/ then []\n when /^manifests$/ then []\n when /^manifest$/ then [name]\n else\n raise ClientError, 'json:malformed'\n end\n if query?(method_name)\n method_name += '?'\n end\n [method_name, args]\n end",
"def endpoint=(_arg0); end",
"def request(*args, &block); end",
"def valid_params_request?; end",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_options=(_arg0); end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def set_request; end",
"def http_method\n raise \"Implement in child class\"\n end",
"def request(*args)\n end",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def get_endpoint()\n end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def stop_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StopLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint\n raise NotImplementedError\n end",
"def service_type_name\n \"REST\"\n end",
"def describe_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def method_missing(method, *args)\n if (service = method.to_s.match(/^(ip|vlm|dns)_(site|subnet6?|pool6?|address6?|alias6?|domain|range|vlan|server|view|zone|rr)_(add|update|info|list|delete|count)$/))\n r_module, r_object, r_action = service.captures\n\n if (@servicemapper.has_key?(service.to_s))\n r_mapped_service = @servicemapper[service.to_s][0]\n end\n\n # case r_action with add, update, list, delete, count to set r_method\n case r_action\n when 'add'\n r_method = 'post'\n when 'update'\n r_method = 'put'\n when 'delete'\n r_method = 'delete'\n else\n r_method = 'get'\n end\n\n self.call(r_method, r_mapped_service, args)\n else\n super\n end\n end",
"def params() @param_types end",
"def http_method\n METHODS[self[:method]]\n end",
"def http_params\n {}\n end",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def params\n {\n \"add-header\" => nil,\n \"burst-length\" => nil,\n \"client\" => nil,\n \"close-with-reset\" => nil,\n \"debug\" => nil,\n \"failure-status\" => nil,\n \"hog\" => nil,\n \"http-version\" => nil,\n \"max-connections\" => nil,\n \"max-piped-calls\" => nil,\n \"method\" => nil,\n \"no-host-hdr\" => nil,\n \"num-calls\" => nil,\n \"num-conns\" => nil,\n \"period\" => nil,\n \"port\" => nil,\n \"print-reply\" => nil,\n \"print-request\" => nil,\n \"rate\" => nil,\n \"recv-buffer\" => nil,\n \"retry-on-failure\" => nil,\n \"send-buffer\" => nil,\n \"server\" => nil,\n \"server-name\" => nil,\n \"session-cookies\" => nil,\n \"ssl\" => nil,\n \"ssl-ciphers\" => nil,\n \"ssl-no-reuse\" => nil,\n \"think-timeout\" => nil,\n \"timeout\" => nil,\n \"uri\" => nil,\n \"verbose\" => nil,\n \"version\" => nil,\n \"wlog\" => nil,\n \"wsess\" => nil,\n \"wsesslog\" => nil,\n \"wset\" => nil\n }\n end",
"def query_parameters; end",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end"
] | [
"0.644576",
"0.6340762",
"0.61790377",
"0.61658084",
"0.61303085",
"0.5991566",
"0.58227193",
"0.58219695",
"0.5802971",
"0.5795455",
"0.5746822",
"0.57363224",
"0.5694722",
"0.5694722",
"0.5694722",
"0.5694722",
"0.5691916",
"0.5691422",
"0.56491816",
"0.5628651",
"0.5601868",
"0.56015396",
"0.55924463",
"0.5570322",
"0.5485693",
"0.54815423",
"0.54667073",
"0.54667073",
"0.54657733",
"0.54631376",
"0.54631376",
"0.54586554",
"0.5446561",
"0.5444421",
"0.5443708",
"0.5425025",
"0.541988",
"0.53999496",
"0.5375427",
"0.5354987",
"0.53373826",
"0.53330064",
"0.5331472",
"0.53304285",
"0.53063625",
"0.52939945",
"0.5285818",
"0.5274894",
"0.52676755",
"0.5263626",
"0.5257661",
"0.5256941",
"0.5256547",
"0.5256427",
"0.5216498",
"0.5211546",
"0.52036834",
"0.5201709",
"0.5193481",
"0.51822275",
"0.5173301",
"0.51721454",
"0.5163582",
"0.51611817",
"0.51557446",
"0.5141136",
"0.51349956",
"0.5133802",
"0.5109148",
"0.50993323",
"0.50956625",
"0.50929385",
"0.5078924",
"0.50760293",
"0.50657636",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50655264",
"0.50600165",
"0.5057691",
"0.50532335",
"0.50452703",
"0.5043621",
"0.5019636",
"0.5017538",
"0.5015191",
"0.50090104",
"0.50090104",
"0.49999252",
"0.499931",
"0.49953842",
"0.49928826"
] | 0.51842046 | 59 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: listener_port, type: Integer name: load_balancer_id, type: String name: owner_account, type: String | def describe_backend_servers(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DescribeBackendServers'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_banancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBanancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def start_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StartLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def rest_endpoint=(_arg0); end",
"def request_parameters; end",
"def http=(_arg0); end",
"def service_endpoint; end",
"def service_endpoint; end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http; end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request_params; end",
"def endpoints; end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(*args); end",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def request_method; end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def request(endpoint, request, &block); end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def http_options; end",
"def service_request(service); end",
"def delete_load_balancer_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def rest_endpoint; end",
"def stop_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StopLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def http_call(payload); end",
"def endpoint=(_arg0); end",
"def http_options=(_arg0); end",
"def build_request(method); end",
"def describe_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_request; end",
"def http_method\n raise \"Implement in child class\"\n end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def send_request(method, params, &block); end",
"def valid_params_request?; end",
"def get_endpoint()\n end",
"def request(*args, &block); end",
"def set_load_balancer_u_d_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerUDPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def endpoint\n raise NotImplementedError\n end",
"def service_type_name\n \"REST\"\n end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def describe_load_balancer_h_t_t_p_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request(*args)\n end",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def describe_load_balancer_h_t_t_p_s_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def bi_service\n end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def delete_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def set_load_balancer_h_t_t_p_s_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :server_certificate_id\n\t\t\targs[:query]['ServerCertificateId'] = optional[:server_certificate_id]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_params\n {}\n end"
] | [
"0.64302105",
"0.6325864",
"0.6221867",
"0.61697066",
"0.6067263",
"0.6040307",
"0.58924437",
"0.5878112",
"0.5832977",
"0.5790073",
"0.5779026",
"0.57621855",
"0.57341903",
"0.5727921",
"0.5648852",
"0.5648852",
"0.5648852",
"0.5648852",
"0.5611834",
"0.55784607",
"0.55754757",
"0.55635875",
"0.5555666",
"0.5551557",
"0.54990196",
"0.54987556",
"0.5450936",
"0.5450936",
"0.5449104",
"0.54384166",
"0.5432051",
"0.5432051",
"0.5431716",
"0.5428521",
"0.5400171",
"0.53982157",
"0.53666806",
"0.53325486",
"0.5330599",
"0.53243846",
"0.5322611",
"0.5304691",
"0.5279554",
"0.52755797",
"0.5262025",
"0.5261746",
"0.5259892",
"0.52575314",
"0.5254535",
"0.52363485",
"0.5224051",
"0.5213954",
"0.5202529",
"0.52018875",
"0.5197093",
"0.51925695",
"0.5187889",
"0.5185072",
"0.51774734",
"0.5170256",
"0.51697475",
"0.5169589",
"0.51648873",
"0.51497823",
"0.5145289",
"0.5142565",
"0.51351196",
"0.5133246",
"0.51192904",
"0.51094276",
"0.510715",
"0.5085907",
"0.5081515",
"0.5077893",
"0.50771564",
"0.5075903",
"0.50539017",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046267",
"0.5045269",
"0.5042044",
"0.50232023",
"0.5023008",
"0.5013063",
"0.5008962",
"0.5005239",
"0.5005239",
"0.5004906",
"0.50048214",
"0.50039923",
"0.4990195"
] | 0.0 | -1 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: load_balancer_id, type: String name: owner_account, type: String | def describe_load_balancer_attribute(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DescribeLoadBalancerAttribute'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def http=(_arg0); end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def rest_endpoint=(_arg0); end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def request_parameters; end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def request_params; end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http; end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_options=(_arg0); end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(*args); end",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_method; end",
"def http_options; end",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def delete_load_balancer(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_method\n raise \"Implement in child class\"\n end",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def build_request(method); end",
"def request(endpoint, request, &block); end",
"def describe_load_balancer_attribute(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def method_missing(method_name, *args)\n payload = Kauplus::Client.authenticate_payload(args.first)\n if method_name.match(/(get|post|multipart_post|put|delete|head)_(.*)/)\n Kauplus::Client.send($1, \"#{@resource}/#{$2}\", payload)\n else\n Kauplus::Client.get(\"#{@resource}/#{method_name}\", payload)\n end\n end",
"def update_load_balancer_pool_with_http_info(pool_id, lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool ...'\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools/{pool-id}'.sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#update_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def service_endpoint; end",
"def service_endpoint; end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def http_params\n {}\n end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def create\n @loadbalancer = Loadbalancer.new(params[:loadbalancer])\n @loadbalancer.account_id = @oeaccount.id\n respond_to do |format|\n if @loadbalancer.save\n format.html { redirect_to loadbalancers_url, notice: 'Loadbalancer was successfully created.' }\n format.json { render json: @loadbalancer, status: :created, location: @loadbalancer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @loadbalancer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def endpoints; end",
"def valid_params_request?; end",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_pool_with_http_info(lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool ...'\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#create_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def rest_endpoint; end",
"def send_request(method, params, &block); end",
"def adjust_params \n #if request is like this:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations\n if params[:action] == 'index'\n \n # If it is \n # GET /relations\n # Then we cannot sevice this request, must specify the entity.\n# if !params[:database_id] and !params[:entity_id]\n# render :text => 'GET /relations is not available', :status => 400\n# return false;\n# end\n\n # But in the remaining two cases:\n # * /entities/relations\n # * /databases/entities/relations\n # Allow the class\n return true;\n end\n \n # if it is:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations/\n # Becasue show needs to have an ID, therefore\n # any of the above URL will do and no context is needed.\n #FIXME: What other possibility the show action might face?\n if params[:action] == 'show'\n return true;\n end\n \n #If its like this:\n # POST /relations\n # POST /entities/relations\n # POST /databases/entities/relations\n # NOTE: For now, the relation resource should be totally complete\n # even if the call is being as a nested resource.\n #\n if params[:action] == 'create'\n \n #if it is like this:\n # POST /relations\n # Then the relations resource should be complete in\n # every respect.\n if !params[:database_id] and !params[:entity_id]\n #return true if valid_relation_resource?\n # Otherwise, the resource is not vaild and we need to tell the user\n #render :json => report_errors(nil, 'The provided realtion resource is incomplete')[0], \n # :status => 400 and return false;\n end\n \n # But if its something like this:\n # POST /entities/:entity_id/relations\n # POST /databases/entities/:entity_id/relations\n #\n if params[:database_id] or params[:entity_id]\n # Then if the relation resource is valid, \n # the entity_id parameter is altogather ignored.\n #return true if valid_relation_resource? \n end\n return true\n end\n \n # if its either of these:\n # PUT /relations\n # PUT /entities/relations\n # PUT /databases/entities/relations\n #\n if params[:action] == 'update'\n # Set the params[:relation_id] because\n # the underlying Admin::EntitiesController#add_link function\n # expects it\n params[:relation_id] = params[:id] and return true;\n end\n \n # If it is either of these:\n # DELETE /relations\n # DELETE /entities/relations\n # DELETE /databases/entities/relations\n #\n if params[:action] == 'destroy'\n \n # For now, you can only make a nested call.\n #PENDING: This would change when the rest call would include the user\n # authenticiy information which would help to determine whether the \n # relation being deleted belongs to the user or not.\n if !params[:entity_id]\n render :json => report_errors(nil, 'DELETE /relations call is not available for now. Call DELETE /entities/relations instead')[0],\n :status => 400 and return false\n end\n \n params[:source_id] = params[:entity_id]\n return true;\n \n end\n \n # In all cases, the request is not handled by this controller!\n render :json => report_errors(nil, \"The requested action is \\\"#{params[:action]}\\\" \" + \n \" on controller \\\"#{params[:controller]}\\\" while I am\" + \n \" \\\"#{self.class.name}\\\" and cannot handle your request.\")[0],:status => 400 and return false;\n \n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def get_balance (opts={})\n query_param_keys = []\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n \n }.merge(opts)\n\n #resource path\n path = \"/get-balance.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"def request(*args, &block); end",
"def url_field(object_name, method, options = T.unsafe(nil)); end",
"def request(params)\n\n # Add auth header\n headers = params[:headers] || {}\n headers['x-vcloud-authorization'] = @auth_key if !@auth_key.nil? || !@auth_key.equal?('')\n\n # set connection options\n options = {:url => params[:url],\n :body => params[:body] || '',\n :expects => params[:expects] || 200,\n :headers => headers || {},\n :method => params[:method] || 'GET'\n }\n\n # connect\n res = RestClient::Request.execute options\n\n raise res if (res.code!=params[:expects] && res.code!=200)\n\n res\n\n\n end",
"def balance_post_with_http_info(addrs, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.balance_post ...'\n end\n # verify the required parameter 'addrs' is set\n if @api_client.config.client_side_validation && addrs.nil?\n fail ArgumentError, \"Missing the required parameter 'addrs' when calling DefaultApi.balance_post\"\n end\n # resource path\n local_var_path = '/api/v1/balance'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = addrs\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#balance_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def block_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.block ...'\n end\n # resource path\n local_var_path = '/api/v1/block'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'seq'] = opts[:'seq'] if !opts[:'seq'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<BlockSchema>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#block\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request_method_symbol; end",
"def new_brb_in_request(meth, *args)\r\n\r\n if is_brb_request_blocking?(meth)\r\n\r\n m = meth.to_s\r\n m = m[0, m.size - 6].to_sym\r\n\r\n idrequest = args.pop\r\n thread = args.pop\r\n begin\r\n r = ((args.size > 0) ? @object.send(m, *args) : @object.send(m))\r\n brb_send([ReturnCode, r, thread, idrequest])\r\n rescue Exception => e\r\n brb_send([ReturnCode, e, thread, idrequest])\r\n BrB.logger.error e.to_s\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n #raise e\r\n end\r\n else\r\n\r\n begin\r\n (args.size > 0) ? @object.send(meth, *args) : @object.send(meth)\r\n rescue Exception => e\r\n BrB.logger.error \"#{e.to_s} => By calling #{meth} on #{@object.class} with args : #{args.inspect}\"\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n raise e\r\n end\r\n\r\n end\r\n\r\n end",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_call(payload); end",
"def payment_methods_post_with_http_info(create_payment_method_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentMethodsApi.payment_methods_post ...'\n end\n # verify the required parameter 'create_payment_method_request' is set\n if @api_client.config.client_side_validation && create_payment_method_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_payment_method_request' when calling PaymentMethodsApi.payment_methods_post\"\n end\n # resource path\n local_var_path = '/payment-methods'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Trace-Id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n header_params[:'End-User-Device-Id'] = opts[:'end_user_device_id'] if !opts[:'end_user_device_id'].nil?\n header_params[:'End-User-Ip'] = opts[:'end_user_ip'] if !opts[:'end_user_ip'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_payment_method_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PaymentMethod'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BearerAuth']\n\n new_options = opts.merge(\n :operation => :\"PaymentMethodsApi.payment_methods_post\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentMethodsApi#payment_methods_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def endpoint_params\n endpoint_data = params.require(:data).require(:attributes).permit(:verb, :path,\n { response: [:code, :body, { headers: {} }] })\n { path: endpoint_data[:path], verb: endpoint_data[:verb], response_code: endpoint_data[:response][:code],\n body: endpoint_data[:response][:body], headers: endpoint_data[:response][:headers] }\n end",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def set_request; end",
"def operations\n # Base URI works as-is.\n end",
"def perform(arguments = {})\n case type.to_sym\n when :post, :get\n api.public_send(type, path, @arguments.merge(arguments))\n else\n raise ArgumentError, \"Unregistered request type #{request_type}\"\n end\n end",
"def http_request_params\n params.require(:http_request).permit(:ip, :address)\n end",
"def load_balancer_data(balancer = nil)\n params = Smash.new(\"Action\" => \"DescribeLoadBalancers\")\n if balancer\n params[\"LoadBalancerNames.member.1\"] = balancer.id || balancer.name\n end\n result = all_result_pages(nil, :body,\n \"DescribeLoadBalancersResponse\", \"DescribeLoadBalancersResult\",\n \"LoadBalancerDescriptions\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(params),\n )\n end\n if balancer\n health_result = all_result_pages(nil, :body,\n \"DescribeInstanceHealthResponse\", \"DescribeInstanceHealthResult\",\n \"InstanceStates\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(\n \"LoadBalancerName\" => balancer.id || balancer.name,\n \"Action\" => \"DescribeInstanceHealth\",\n ),\n )\n end\n end\n result.map do |blr|\n (balancer || Balancer.new(self)).load_data(\n Smash.new(\n :id => blr[\"LoadBalancerName\"],\n :name => blr[\"LoadBalancerName\"],\n :state => :active,\n :status => \"ACTIVE\",\n :created => blr[\"CreatedTime\"],\n :updated => blr[\"CreatedTime\"],\n :public_addresses => [\n Balancer::Address.new(\n :address => blr[\"DNSName\"],\n :version => 4,\n ),\n ],\n :servers => [blr.get(\"Instances\", \"member\")].flatten(1).compact.map { |i|\n Balancer::Server.new(self.api_for(:compute), :id => i[\"InstanceId\"])\n },\n ).merge(\n health_result.nil? ? {} : Smash.new(\n :server_states => health_result.nil? ? nil : health_result.map { |i|\n Balancer::ServerState.new(\n self.api_for(:compute),\n :id => i[\"InstanceId\"],\n :status => i[\"State\"],\n :reason => i[\"ReasonCode\"],\n :state => i[\"State\"] == \"InService\" ? :up : :down,\n )\n },\n )\n )\n ).valid_state\n end\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def update_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.update_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.update_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.update_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.update_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#update_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def request(action, params = T.unsafe(nil), header = T.unsafe(nil), query = T.unsafe(nil)); end",
"def request_params(params)\n headers = params[:headers] || {}\n\n if params[:scheme]\n scheme = params[:scheme]\n port = params[:port] || DEFAULT_SCHEME_PORT[scheme]\n else\n scheme = @scheme\n port = @port\n end\n if DEFAULT_SCHEME_PORT[scheme] == port\n port = nil\n end\n\n if params[:region]\n region = params[:region]\n host = params[:host] || region_to_host(region)\n else\n region = @region || DEFAULT_REGION\n host = params[:host] || @host || region_to_host(region)\n end\n\n path = params[:path] || object_to_path(params[:object_name])\n path = '/' + path if path[0..0] != '/'\n\n if params[:bucket_name]\n bucket_name = params[:bucket_name]\n\n if params[:bucket_cname]\n host = bucket_name\n else\n path_style = params.fetch(:path_style, @path_style)\n if !path_style\n if COMPLIANT_BUCKET_NAMES !~ bucket_name\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n elsif scheme == 'https' && !path_style && bucket_name =~ /\\./\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n end\n end\n\n # uses the bucket name as host if `virtual_host: true`, you can also\n # manually specify the cname if required.\n if params[:virtual_host]\n host = params.fetch(:cname, bucket_name)\n elsif path_style\n path = bucket_to_path bucket_name, path\n elsif host.start_with?(\"#{bucket_name}.\")\n # no-op\n else\n host = [bucket_name, host].join('.')\n end\n end\n end\n\n ret = params.merge({\n :scheme => scheme,\n :host => host,\n :port => port,\n :path => path,\n :headers => headers\n })\n\n #\n ret.delete(:path_style)\n ret.delete(:bucket_name)\n ret.delete(:object_name)\n ret.delete(:region)\n\n ret\n end",
"def perform(request, options); end",
"def private_get_address_book_get_with_http_info(currency, type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_get_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/private/get_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_get_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request(*args)\n end",
"def service_type_name\n \"REST\"\n end",
"def http_verb(params)\n [:post, :put, :delete].detect { |method_name|\n params.key?(method_name)\n } || :get\n end",
"def get_endpoint()\n end",
"def http_method(value = nil, &block)\n __define__(:http_method, value, block)\n end",
"def method_missing(method, *args)\n if (service = method.to_s.match(/^(ip|vlm|dns)_(site|subnet6?|pool6?|address6?|alias6?|domain|range|vlan|server|view|zone|rr)_(add|update|info|list|delete|count)$/))\n r_module, r_object, r_action = service.captures\n\n if (@servicemapper.has_key?(service.to_s))\n r_mapped_service = @servicemapper[service.to_s][0]\n end\n\n # case r_action with add, update, list, delete, count to set r_method\n case r_action\n when 'add'\n r_method = 'post'\n when 'update'\n r_method = 'put'\n when 'delete'\n r_method = 'delete'\n else\n r_method = 'get'\n end\n\n self.call(r_method, r_mapped_service, args)\n else\n super\n end\n end"
] | [
"0.66677046",
"0.6535007",
"0.6466888",
"0.6211608",
"0.6028023",
"0.5981134",
"0.58650047",
"0.5834508",
"0.57195145",
"0.56340444",
"0.5594318",
"0.553328",
"0.5461805",
"0.5429633",
"0.54226696",
"0.5408994",
"0.5398023",
"0.53774786",
"0.5366003",
"0.5366003",
"0.5363954",
"0.53550607",
"0.5350382",
"0.5332269",
"0.5332269",
"0.5332269",
"0.5332269",
"0.52855694",
"0.52680695",
"0.52390504",
"0.52362525",
"0.5226937",
"0.5223232",
"0.5212053",
"0.5210983",
"0.52106184",
"0.5209578",
"0.52070916",
"0.5204671",
"0.5204671",
"0.5200359",
"0.51987046",
"0.5181466",
"0.5173446",
"0.5168582",
"0.5167721",
"0.5161597",
"0.5152681",
"0.51179504",
"0.51175624",
"0.51144433",
"0.51144433",
"0.5111208",
"0.5103473",
"0.5099803",
"0.50963753",
"0.5088782",
"0.5087891",
"0.5080981",
"0.50773346",
"0.5075896",
"0.5074945",
"0.5068613",
"0.50587255",
"0.5054881",
"0.50417423",
"0.50346845",
"0.50263035",
"0.50261235",
"0.502331",
"0.50226617",
"0.5017477",
"0.50142896",
"0.5010966",
"0.5009005",
"0.5002586",
"0.5001077",
"0.49949917",
"0.4994752",
"0.49863768",
"0.4984225",
"0.49829185",
"0.49689713",
"0.49648172",
"0.4962049",
"0.49603775",
"0.49589202",
"0.4952481",
"0.4947971",
"0.49479333",
"0.4940604",
"0.49333027",
"0.49308422",
"0.49286345",
"0.4917538",
"0.4915522",
"0.49130207",
"0.49110627",
"0.49088278",
"0.4908498"
] | 0.5432214 | 13 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: listener_port, type: Integer name: load_balancer_id, type: String name: owner_account, type: String | def describe_load_balancer_h_t_t_p_listener_attribute(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_banancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBanancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def start_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StartLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def rest_endpoint=(_arg0); end",
"def request_parameters; end",
"def http=(_arg0); end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def service_endpoint; end",
"def service_endpoint; end",
"def http; end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request_params; end",
"def endpoints; end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(*args); end",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def request_method; end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def request(endpoint, request, &block); end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def http_options; end",
"def service_request(service); end",
"def delete_load_balancer_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def rest_endpoint; end",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def stop_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StopLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def http_call(payload); end",
"def endpoint=(_arg0); end",
"def http_options=(_arg0); end",
"def build_request(method); end",
"def set_request; end",
"def describe_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_method\n raise \"Implement in child class\"\n end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def send_request(method, params, &block); end",
"def valid_params_request?; end",
"def get_endpoint()\n end",
"def request(*args, &block); end",
"def set_load_balancer_u_d_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerUDPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def endpoint\n raise NotImplementedError\n end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def service_type_name\n \"REST\"\n end",
"def describe_load_balancer_h_t_t_p_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request(*args)\n end",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def bi_service\n end",
"def describe_load_balancer_h_t_t_p_s_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def delete_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def set_load_balancer_h_t_t_p_s_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :server_certificate_id\n\t\t\targs[:query]['ServerCertificateId'] = optional[:server_certificate_id]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def set_load_balancer_h_t_t_p_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_params\n {}\n end"
] | [
"0.64313316",
"0.6326936",
"0.62214124",
"0.61689353",
"0.60679847",
"0.6041232",
"0.5892805",
"0.5878499",
"0.58319575",
"0.57913655",
"0.57796055",
"0.57615423",
"0.5733857",
"0.5728543",
"0.5647224",
"0.5647224",
"0.5647224",
"0.5647224",
"0.5613168",
"0.55781585",
"0.5575197",
"0.5561759",
"0.5554726",
"0.5551587",
"0.5500578",
"0.5499385",
"0.5450052",
"0.54500294",
"0.54500294",
"0.5437337",
"0.54320735",
"0.54307944",
"0.54307944",
"0.54280216",
"0.5401953",
"0.53971386",
"0.5368053",
"0.5333069",
"0.5330188",
"0.53257483",
"0.5321887",
"0.5304926",
"0.5280144",
"0.5274078",
"0.52638716",
"0.526336",
"0.52627593",
"0.5258702",
"0.52551395",
"0.5236352",
"0.522399",
"0.5212799",
"0.5203055",
"0.52013767",
"0.5196217",
"0.5191923",
"0.51877606",
"0.5186595",
"0.5177588",
"0.5170195",
"0.51699317",
"0.51695216",
"0.5165987",
"0.51456785",
"0.514201",
"0.513709",
"0.51316327",
"0.5118701",
"0.51091987",
"0.5106157",
"0.50884587",
"0.5079542",
"0.5077504",
"0.5077451",
"0.5076783",
"0.5053321",
"0.5046845",
"0.5045943",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5045873",
"0.5042577",
"0.502312",
"0.5022425",
"0.5013279",
"0.5008743",
"0.5006523",
"0.5005251",
"0.50048417",
"0.50048417",
"0.5004496",
"0.49925968"
] | 0.51493216 | 63 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: load_balancer_id, type: String name: owner_account, type: String name: server_id, type: String | def describe_load_balancers(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DescribeLoadBalancers'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
if optional.key? :server_id
args[:query]['ServerId'] = optional[:server_id]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def rest_endpoint=(_arg0); end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def request_parameters; end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def http=(_arg0); end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def request_params; end",
"def http_options; end",
"def http; end",
"def request(*args); end",
"def request_method; end",
"def service_endpoint; end",
"def service_endpoint; end",
"def http_options=(_arg0); end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def endpoints; end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def build_request(method); end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def rest_endpoint; end",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_method_symbol; end",
"def method_missing(method_name, *args)\n payload = Kauplus::Client.authenticate_payload(args.first)\n if method_name.match(/(get|post|multipart_post|put|delete|head)_(.*)/)\n Kauplus::Client.send($1, \"#{@resource}/#{$2}\", payload)\n else\n Kauplus::Client.get(\"#{@resource}/#{method_name}\", payload)\n end\n end",
"def adjust_params \n #if request is like this:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations\n if params[:action] == 'index'\n \n # If it is \n # GET /relations\n # Then we cannot sevice this request, must specify the entity.\n# if !params[:database_id] and !params[:entity_id]\n# render :text => 'GET /relations is not available', :status => 400\n# return false;\n# end\n\n # But in the remaining two cases:\n # * /entities/relations\n # * /databases/entities/relations\n # Allow the class\n return true;\n end\n \n # if it is:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations/\n # Becasue show needs to have an ID, therefore\n # any of the above URL will do and no context is needed.\n #FIXME: What other possibility the show action might face?\n if params[:action] == 'show'\n return true;\n end\n \n #If its like this:\n # POST /relations\n # POST /entities/relations\n # POST /databases/entities/relations\n # NOTE: For now, the relation resource should be totally complete\n # even if the call is being as a nested resource.\n #\n if params[:action] == 'create'\n \n #if it is like this:\n # POST /relations\n # Then the relations resource should be complete in\n # every respect.\n if !params[:database_id] and !params[:entity_id]\n #return true if valid_relation_resource?\n # Otherwise, the resource is not vaild and we need to tell the user\n #render :json => report_errors(nil, 'The provided realtion resource is incomplete')[0], \n # :status => 400 and return false;\n end\n \n # But if its something like this:\n # POST /entities/:entity_id/relations\n # POST /databases/entities/:entity_id/relations\n #\n if params[:database_id] or params[:entity_id]\n # Then if the relation resource is valid, \n # the entity_id parameter is altogather ignored.\n #return true if valid_relation_resource? \n end\n return true\n end\n \n # if its either of these:\n # PUT /relations\n # PUT /entities/relations\n # PUT /databases/entities/relations\n #\n if params[:action] == 'update'\n # Set the params[:relation_id] because\n # the underlying Admin::EntitiesController#add_link function\n # expects it\n params[:relation_id] = params[:id] and return true;\n end\n \n # If it is either of these:\n # DELETE /relations\n # DELETE /entities/relations\n # DELETE /databases/entities/relations\n #\n if params[:action] == 'destroy'\n \n # For now, you can only make a nested call.\n #PENDING: This would change when the rest call would include the user\n # authenticiy information which would help to determine whether the \n # relation being deleted belongs to the user or not.\n if !params[:entity_id]\n render :json => report_errors(nil, 'DELETE /relations call is not available for now. Call DELETE /entities/relations instead')[0],\n :status => 400 and return false\n end\n \n params[:source_id] = params[:entity_id]\n return true;\n \n end\n \n # In all cases, the request is not handled by this controller!\n render :json => report_errors(nil, \"The requested action is \\\"#{params[:action]}\\\" \" + \n \" on controller \\\"#{params[:controller]}\\\" while I am\" + \n \" \\\"#{self.class.name}\\\" and cannot handle your request.\")[0],:status => 400 and return false;\n \n end",
"def request(endpoint, request, &block); end",
"def http_method\n raise \"Implement in child class\"\n end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def set_request; end",
"def send_request(method, params, &block); end",
"def method_missing(method, *args)\n if (service = method.to_s.match(/^(ip|vlm|dns)_(site|subnet6?|pool6?|address6?|alias6?|domain|range|vlan|server|view|zone|rr)_(add|update|info|list|delete|count)$/))\n r_module, r_object, r_action = service.captures\n\n if (@servicemapper.has_key?(service.to_s))\n r_mapped_service = @servicemapper[service.to_s][0]\n end\n\n # case r_action with add, update, list, delete, count to set r_method\n case r_action\n when 'add'\n r_method = 'post'\n when 'update'\n r_method = 'put'\n when 'delete'\n r_method = 'delete'\n else\n r_method = 'get'\n end\n\n self.call(r_method, r_mapped_service, args)\n else\n super\n end\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def server_params\n params.require(:server).permit(:name, :addr, :endpoint, :api_key, :api_secret)\n end",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(*args)\n end",
"def service_request(service); end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def valid_params_request?; end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def request(*args, &block); end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def operations\n # Base URI works as-is.\n end",
"def http_params\n {}\n end",
"def get_endpoint()\n end",
"def endpoint=(_arg0); end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def url_field(object_name, method, options = T.unsafe(nil)); end",
"def perform(request, options); end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def service_type_name\n \"REST\"\n end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def query_parameters; end",
"def method_missing(op, *args)\n if client.operations.include?(op)\n request op, *args\n else\n fail NoMethodError, op\n end\n end",
"def valid_request(h = {})\n h.merge!({:use_route => :sensit_api, :format => \"json\", :api_version => \"1\"})\n end",
"def create_server_pool_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PoolApi.create_server_pool ...'\n end\n # unbox the parameters from the hash\n service_id = opts[:'service_id']\n version_id = opts[:'version_id']\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling PoolApi.create_server_pool\"\n end\n # verify the required parameter 'version_id' is set\n if @api_client.config.client_side_validation && version_id.nil?\n fail ArgumentError, \"Missing the required parameter 'version_id' when calling PoolApi.create_server_pool\"\n end\n allowable_values = [0, 1]\n if @api_client.config.client_side_validation && opts[:'use_tls'] && !allowable_values.include?(opts[:'use_tls'])\n fail ArgumentError, \"invalid value for \\\"use_tls\\\", must be one of #{allowable_values}\"\n end\n allowable_values = [\"random\", \"hash\", \"client\"]\n if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'quorum'].nil? && opts[:'quorum'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"quorum\"]\" when calling PoolApi.create_server_pool, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'quorum'].nil? && opts[:'quorum'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"quorum\"]\" when calling PoolApi.create_server_pool, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/service/{service_id}/version/{version_id}/pool'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n form_params['tls_ca_cert'] = opts[:'tls_ca_cert'] if !opts[:'tls_ca_cert'].nil?\n form_params['tls_client_cert'] = opts[:'tls_client_cert'] if !opts[:'tls_client_cert'].nil?\n form_params['tls_client_key'] = opts[:'tls_client_key'] if !opts[:'tls_client_key'].nil?\n form_params['tls_cert_hostname'] = opts[:'tls_cert_hostname'] if !opts[:'tls_cert_hostname'].nil?\n form_params['use_tls'] = opts[:'use_tls'] if !opts[:'use_tls'].nil?\n form_params['created_at'] = opts[:'created_at'] if !opts[:'created_at'].nil?\n form_params['deleted_at'] = opts[:'deleted_at'] if !opts[:'deleted_at'].nil?\n form_params['updated_at'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?\n form_params['service_id'] = opts[:'service_id'] if !opts[:'service_id'].nil?\n form_params['version'] = opts[:'version'] if !opts[:'version'].nil?\n form_params['name'] = opts[:'name'] if !opts[:'name'].nil?\n form_params['shield'] = opts[:'shield'] if !opts[:'shield'].nil?\n form_params['request_condition'] = opts[:'request_condition'] if !opts[:'request_condition'].nil?\n form_params['tls_ciphers'] = opts[:'tls_ciphers'] if !opts[:'tls_ciphers'].nil?\n form_params['tls_sni_hostname'] = opts[:'tls_sni_hostname'] if !opts[:'tls_sni_hostname'].nil?\n form_params['min_tls_version'] = opts[:'min_tls_version'] if !opts[:'min_tls_version'].nil?\n form_params['max_tls_version'] = opts[:'max_tls_version'] if !opts[:'max_tls_version'].nil?\n form_params['healthcheck'] = opts[:'healthcheck'] if !opts[:'healthcheck'].nil?\n form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n form_params['type'] = opts[:'type'] if !opts[:'type'].nil?\n form_params['override_host'] = opts[:'override_host'] if !opts[:'override_host'].nil?\n form_params['between_bytes_timeout'] = opts[:'between_bytes_timeout'] if !opts[:'between_bytes_timeout'].nil?\n form_params['connect_timeout'] = opts[:'connect_timeout'] if !opts[:'connect_timeout'].nil?\n form_params['first_byte_timeout'] = opts[:'first_byte_timeout'] if !opts[:'first_byte_timeout'].nil?\n form_params['max_conn_default'] = opts[:'max_conn_default'] if !opts[:'max_conn_default'].nil?\n form_params['quorum'] = opts[:'quorum'] if !opts[:'quorum'].nil?\n form_params['tls_check_cert'] = opts[:'tls_check_cert'] if !opts[:'tls_check_cert'].nil?\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'PoolResponsePost'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"PoolApi.create_server_pool\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PoolApi#create_server_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def endpoint_params\n endpoint_data = params.require(:data).require(:attributes).permit(:verb, :path,\n { response: [:code, :body, { headers: {} }] })\n { path: endpoint_data[:path], verb: endpoint_data[:verb], response_code: endpoint_data[:response][:code],\n body: endpoint_data[:response][:body], headers: endpoint_data[:response][:headers] }\n end",
"def request(action, params = T.unsafe(nil), header = T.unsafe(nil), query = T.unsafe(nil)); end",
"def update_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.update_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.update_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.update_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.update_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#update_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def perform(arguments = {})\n case type.to_sym\n when :post, :get\n api.public_send(type, path, @arguments.merge(arguments))\n else\n raise ArgumentError, \"Unregistered request type #{request_type}\"\n end\n end",
"def params\n {\n \"add-header\" => nil,\n \"burst-length\" => nil,\n \"client\" => nil,\n \"close-with-reset\" => nil,\n \"debug\" => nil,\n \"failure-status\" => nil,\n \"hog\" => nil,\n \"http-version\" => nil,\n \"max-connections\" => nil,\n \"max-piped-calls\" => nil,\n \"method\" => nil,\n \"no-host-hdr\" => nil,\n \"num-calls\" => nil,\n \"num-conns\" => nil,\n \"period\" => nil,\n \"port\" => nil,\n \"print-reply\" => nil,\n \"print-request\" => nil,\n \"rate\" => nil,\n \"recv-buffer\" => nil,\n \"retry-on-failure\" => nil,\n \"send-buffer\" => nil,\n \"server\" => nil,\n \"server-name\" => nil,\n \"session-cookies\" => nil,\n \"ssl\" => nil,\n \"ssl-ciphers\" => nil,\n \"ssl-no-reuse\" => nil,\n \"think-timeout\" => nil,\n \"timeout\" => nil,\n \"uri\" => nil,\n \"verbose\" => nil,\n \"version\" => nil,\n \"wlog\" => nil,\n \"wsess\" => nil,\n \"wsesslog\" => nil,\n \"wset\" => nil\n }\n end",
"def method_missing(meth, *args)\n hyves_method = meth.to_s.gsub('_', '.')\n options = {:ha_method => hyves_method}\n options.merge!(args.first) if args.first.is_a?(Hash)\n hyves_log('Hyves', \"Sent request: #{options.inspect}\")\n response = request(options)\n hyves_log('Hyves', \"Got response: #{response.inspect}\")\n return response\n end",
"def http_verb(params)\n [:post, :put, :delete].detect { |method_name|\n params.key?(method_name)\n } || :get\n end",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend"
] | [
"0.6386994",
"0.6247801",
"0.62020737",
"0.59993243",
"0.57949907",
"0.5770757",
"0.5755485",
"0.5727139",
"0.56117886",
"0.5610129",
"0.55574346",
"0.5545361",
"0.5545361",
"0.5545361",
"0.5545361",
"0.5539851",
"0.5534327",
"0.5519035",
"0.54950017",
"0.5444844",
"0.5444844",
"0.5424467",
"0.5408735",
"0.54035324",
"0.53996843",
"0.53941256",
"0.53842795",
"0.53842795",
"0.5380574",
"0.53680825",
"0.5342089",
"0.5342089",
"0.53391224",
"0.53287727",
"0.5313824",
"0.53062165",
"0.53016526",
"0.52851146",
"0.52818334",
"0.5228537",
"0.5216136",
"0.52026314",
"0.5196988",
"0.518378",
"0.51668406",
"0.5166286",
"0.51661664",
"0.5154109",
"0.5153611",
"0.5144658",
"0.5144143",
"0.514306",
"0.51424235",
"0.5127182",
"0.5123037",
"0.51137215",
"0.511365",
"0.5108946",
"0.51085985",
"0.5107291",
"0.51065665",
"0.5101015",
"0.5092458",
"0.50888926",
"0.5081088",
"0.5068118",
"0.5062104",
"0.50538",
"0.5053145",
"0.5045919",
"0.5043942",
"0.5042331",
"0.5042331",
"0.50421757",
"0.5041148",
"0.50322914",
"0.50263166",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.5015535",
"0.500972",
"0.5008584",
"0.5003967",
"0.50003034",
"0.49906376",
"0.49884218",
"0.49882084",
"0.49878448",
"0.49859193",
"0.49844444",
"0.4983141",
"0.49827564"
] | 0.58280563 | 4 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: listener_port, type: Integer name: load_balancer_id, type: String name: owner_account, type: String | def describe_load_balancer_t_c_p_listener_attribute(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_banancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBanancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def start_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StartLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def rest_endpoint=(_arg0); end",
"def request_parameters; end",
"def http=(_arg0); end",
"def service_endpoint; end",
"def service_endpoint; end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http; end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request_params; end",
"def endpoints; end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(*args); end",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def request_method; end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def request(endpoint, request, &block); end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def http_options; end",
"def service_request(service); end",
"def delete_load_balancer_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def rest_endpoint; end",
"def stop_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StopLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def http_call(payload); end",
"def endpoint=(_arg0); end",
"def http_options=(_arg0); end",
"def build_request(method); end",
"def set_request; end",
"def http_method\n raise \"Implement in child class\"\n end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def send_request(method, params, &block); end",
"def valid_params_request?; end",
"def get_endpoint()\n end",
"def request(*args, &block); end",
"def set_load_balancer_u_d_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerUDPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def endpoint\n raise NotImplementedError\n end",
"def service_type_name\n \"REST\"\n end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def describe_load_balancer_h_t_t_p_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request(*args)\n end",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def describe_load_balancer_h_t_t_p_s_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def bi_service\n end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def delete_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def set_load_balancer_h_t_t_p_s_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :server_certificate_id\n\t\t\targs[:query]['ServerCertificateId'] = optional[:server_certificate_id]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_params\n {}\n end"
] | [
"0.64302105",
"0.6325864",
"0.6221867",
"0.61697066",
"0.6067263",
"0.6040307",
"0.58924437",
"0.5878112",
"0.5832977",
"0.5790073",
"0.5779026",
"0.57621855",
"0.57341903",
"0.5727921",
"0.5648852",
"0.5648852",
"0.5648852",
"0.5648852",
"0.5611834",
"0.55784607",
"0.55754757",
"0.55635875",
"0.5555666",
"0.5551557",
"0.54990196",
"0.54987556",
"0.5450936",
"0.5450936",
"0.5449104",
"0.54384166",
"0.5432051",
"0.5432051",
"0.5431716",
"0.5428521",
"0.5400171",
"0.53982157",
"0.53666806",
"0.53325486",
"0.5330599",
"0.53243846",
"0.5322611",
"0.5304691",
"0.5279554",
"0.52755797",
"0.5262025",
"0.5261746",
"0.5259892",
"0.52575314",
"0.5254535",
"0.52363485",
"0.5224051",
"0.5213954",
"0.5202529",
"0.52018875",
"0.5197093",
"0.51925695",
"0.5187889",
"0.5185072",
"0.51774734",
"0.51697475",
"0.5169589",
"0.51648873",
"0.51497823",
"0.5145289",
"0.5142565",
"0.51351196",
"0.5133246",
"0.51192904",
"0.51094276",
"0.510715",
"0.5085907",
"0.5081515",
"0.5077893",
"0.50771564",
"0.5075903",
"0.50539017",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046561",
"0.5046267",
"0.5045269",
"0.5042044",
"0.50232023",
"0.5023008",
"0.5013063",
"0.5008962",
"0.5005239",
"0.5005239",
"0.5004906",
"0.50048214",
"0.50039923",
"0.4990195"
] | 0.5170256 | 59 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: owner_account, type: String | def describe_regions(optional={})
args = self.class.new_params
args[:query]['Action'] = 'DescribeRegions'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def request_parameters; end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def http=(_arg0); end",
"def rest_endpoint=(_arg0); end",
"def method_missing(method_name, *args)\n payload = Kauplus::Client.authenticate_payload(args.first)\n if method_name.match(/(get|post|multipart_post|put|delete|head)_(.*)/)\n Kauplus::Client.send($1, \"#{@resource}/#{$2}\", payload)\n else\n Kauplus::Client.get(\"#{@resource}/#{method_name}\", payload)\n end\n end",
"def request_params; end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def http; end",
"def request(*args); end",
"def build_request(method); end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def method_missing(method, **args, &block)\n path = method.to_s.split(\"_\", 2).join(\"/\")\n args.merge!(access_token: access_token)\n case path\n when /create$/\n raw_post path, args\n else\n raw_get path, args\n end\n end",
"def http_params\n {}\n end",
"def request_method; end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def http_options=(_arg0); end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def query_parameters; end",
"def http_options; end",
"def authenticate_resource_request options = {}\n verifications = {\n client_credential: lambda do |_x|\n ::Signet::OAuth1::Credential.new(\"Client credential key\",\n \"Client credential secret\")\n end\n }\n\n unless options[:two_legged] == true\n verifications.update(\n token_credential: lambda do |_x|\n ::Signet::OAuth1::Credential.new(\"Token credential key\",\n \"Token credential secret\")\n end\n )\n end\n # Make sure all required state is set\n verifications.each do |(key, _value)|\n raise ArgumentError, \"#{key} was not set.\" unless send key\n end\n\n request_components = if options[:request]\n verify_request_components(\n request: options[:request],\n adapter: options[:adapter]\n )\n else\n verify_request_components(\n method: options[:method],\n uri: options[:uri],\n headers: options[:headers],\n body: options[:body]\n )\n end\n method = request_components[:method]\n uri = request_components[:uri]\n headers = request_components[:headers]\n body = request_components[:body]\n\n\n if !body.is_a?(String) && body.respond_to?(:each)\n # Just in case we get a chunked body\n merged_body = StringIO.new\n body.each do |chunk|\n merged_body.write chunk\n end\n body = merged_body.string\n end\n raise TypeError, \"Expected String, got #{body.class}.\" unless body.is_a? String\n\n media_type = nil\n headers.each do |(header, value)|\n media_type = value.gsub(/^([^;]+)(;.*?)?$/, '\\1') if header.casecmp(\"Content-Type\").zero?\n end\n\n auth_hash = verify_auth_header_components headers\n\n auth_token = auth_hash[\"oauth_token\"]\n\n\n unless options[:two_legged]\n return nil if auth_token.nil?\n return nil unless (token_credential = find_token_credential auth_token)\n token_credential_secret = token_credential.secret if token_credential\n end\n\n return nil unless (client_credential =\n find_client_credential auth_hash[\"oauth_consumer_key\"])\n\n return nil unless validate_nonce_timestamp(auth_hash[\"oauth_nonce\"],\n auth_hash[\"oauth_timestamp\"])\n\n if method == (\"POST\" || \"PUT\") &&\n media_type == \"application/x-www-form-urlencoded\"\n request_components[:body] = body\n post_parameters = Addressable::URI.form_unencode body\n post_parameters.each { |param| param[1] = \"\" if param[1].nil? }\n # If the auth header doesn't have the same params as the body, it\n # can't have been signed correctly(5849#3.4.1.3)\n unless post_parameters.sort == auth_hash.reject { |k, _v| k.index \"oauth_\" }.to_a.sort\n raise MalformedAuthorizationError, \"Request is of type application/x-www-form-urlencoded \" \\\n \"but Authentication header did not include form values\"\n end\n end\n\n client_credential_secret = client_credential.secret if client_credential\n\n computed_signature = ::Signet::OAuth1.sign_parameters(\n method,\n uri,\n # Realm isn't used, and will throw the signature off.\n auth_hash.reject { |k, _v| k == \"realm\" }.to_a,\n client_credential_secret,\n token_credential_secret\n )\n\n return nil unless safe_equals? computed_signature, auth_hash[\"oauth_signature\"]\n { client_credential: client_credential,\n token_credential: token_credential,\n realm: auth_hash[\"realm\"] }\n end",
"def rest_endpoint; end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def rest_token_endpoint=(_arg0); end",
"def request(params)\n\n # Add auth header\n headers = params[:headers] || {}\n headers['x-vcloud-authorization'] = @auth_key if !@auth_key.nil? || !@auth_key.equal?('')\n\n # set connection options\n options = {:url => params[:url],\n :body => params[:body] || '',\n :expects => params[:expects] || 200,\n :headers => headers || {},\n :method => params[:method] || 'GET'\n }\n\n # connect\n res = RestClient::Request.execute options\n\n raise res if (res.code!=params[:expects] && res.code!=200)\n\n res\n\n\n end",
"def request_method_symbol; end",
"def request(action, params = T.unsafe(nil), header = T.unsafe(nil), query = T.unsafe(nil)); end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def request_uri; end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def url_field(object_name, method, options = T.unsafe(nil)); end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def set_request; end",
"def http_method\n METHODS[self[:method]]\n end",
"def valid_params_request?; end",
"def send_request(method, params, &block); end",
"def make_request url, parameters={}, method=:get, settings={}\n raise 'not implemented'\n end",
"def api_only=(_arg0); end",
"def signature\n {method: @method.upcase, path: @path, body: @body}\n end",
"def preflight; end",
"def operations\n # Base URI works as-is.\n end",
"def perform(arguments = {})\n case type.to_sym\n when :post, :get\n api.public_send(type, path, @arguments.merge(arguments))\n else\n raise ArgumentError, \"Unregistered request type #{request_type}\"\n end\n end",
"def authentication_type=(_arg0); end",
"def api_method\n ''\n end",
"def uri\n @uri_parameters = {:s => @company}\n super() \n end",
"def perform(request, options); end",
"def request(*args)\n end",
"def payment_methods_post_with_http_info(create_payment_method_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentMethodsApi.payment_methods_post ...'\n end\n # verify the required parameter 'create_payment_method_request' is set\n if @api_client.config.client_side_validation && create_payment_method_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_payment_method_request' when calling PaymentMethodsApi.payment_methods_post\"\n end\n # resource path\n local_var_path = '/payment-methods'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Trace-Id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n header_params[:'End-User-Device-Id'] = opts[:'end_user_device_id'] if !opts[:'end_user_device_id'].nil?\n header_params[:'End-User-Ip'] = opts[:'end_user_ip'] if !opts[:'end_user_ip'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_payment_method_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PaymentMethod'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BearerAuth']\n\n new_options = opts.merge(\n :operation => :\"PaymentMethodsApi.payment_methods_post\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentMethodsApi#payment_methods_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def auth_param; end",
"def http_method\n @http_method ||= @options[:http_method] || :post\n end",
"def endpoints; end",
"def service_endpoint; end",
"def service_endpoint; end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def post_request(object)\n end",
"def make_request(resource_name, method_name, params = {}, response_key = nil)\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def method_missing(method, *args)\n api_method = map[method.to_s]\n args = args.last.is_a?(Hash) ? args.last : {} # basically #extract_options!\n methods_or_resources = api_method['methods'] || api_method['resources']\n if methods_or_resources\n API.new(access_token, api, methods_or_resources)\n else\n url, options = build_url(api_method, args)\n\n raise ArgumentError, \":body parameter was not passed\" if !options[:body] && %w(POST PUT PATCH).include?(api_method['httpMethod'])\n\n send(api_method['mediaUpload'] && args[:media] ? :upload : :request, api_method['httpMethod'].downcase, url, options)\n end\n end",
"def params_to_api_args(type)\n args = params.to_unsafe_h.symbolize_keys.except(:controller)\n args[:method] = request.method\n args[:action] = type\n args.delete(:format)\n args\n end",
"def request_params(params)\n headers = params[:headers] || {}\n\n if params[:scheme]\n scheme = params[:scheme]\n port = params[:port] || DEFAULT_SCHEME_PORT[scheme]\n else\n scheme = @scheme\n port = @port\n end\n if DEFAULT_SCHEME_PORT[scheme] == port\n port = nil\n end\n\n if params[:region]\n region = params[:region]\n host = params[:host] || region_to_host(region)\n else\n region = @region || DEFAULT_REGION\n host = params[:host] || @host || region_to_host(region)\n end\n\n path = params[:path] || object_to_path(params[:object_name])\n path = '/' + path if path[0..0] != '/'\n\n if params[:bucket_name]\n bucket_name = params[:bucket_name]\n\n if params[:bucket_cname]\n host = bucket_name\n else\n path_style = params.fetch(:path_style, @path_style)\n if !path_style\n if COMPLIANT_BUCKET_NAMES !~ bucket_name\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n elsif scheme == 'https' && !path_style && bucket_name =~ /\\./\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n end\n end\n\n # uses the bucket name as host if `virtual_host: true`, you can also\n # manually specify the cname if required.\n if params[:virtual_host]\n host = params.fetch(:cname, bucket_name)\n elsif path_style\n path = bucket_to_path bucket_name, path\n elsif host.start_with?(\"#{bucket_name}.\")\n # no-op\n else\n host = [bucket_name, host].join('.')\n end\n end\n end\n\n ret = params.merge({\n :scheme => scheme,\n :host => host,\n :port => port,\n :path => path,\n :headers => headers\n })\n\n #\n ret.delete(:path_style)\n ret.delete(:bucket_name)\n ret.delete(:object_name)\n ret.delete(:region)\n\n ret\n end",
"def build_request(*args); end",
"def request=(_arg0); end",
"def request=(_arg0); end",
"def request=(_arg0); end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def post(action, params = T.unsafe(nil), header = T.unsafe(nil), query = T.unsafe(nil)); end",
"def cloud_params\n params.require(:cloud).permit(:api, :url, :ip_addresses, :port, :token, :shared_secret, :bucket, :platform_id)\n end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def operational_values\n\t\treturn super.merge(\n\t\t\turi: self.uri,\n\t\t\thttp_method: self.http_method,\n\t\t\texpected_status: self.expected_status,\n\t\t\tbody: self.body,\n\t\t\tbody_mimetype: self.body_mimetype\n\t\t)\n\tend",
"def http_post_without_component_access_token scope, url, post_params={}, url_params={}\n\t\t\turl = \"#{BASE}#{scope}/#{url}\"\n\t\t\tparam = url_params.to_param\n\t\t\turl += \"?#{param}\" if !param.blank?\n\t\t\tp \"post ----- #{url}\"\n\t\t\tp post_params\n\t\t\tJSON.parse RestClient.post URI.encode(url), post_params.to_json\n\t\tend",
"def zz_request(*_)\n # Do nothing\n end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def endpoint_params\n endpoint_data = params.require(:data).require(:attributes).permit(:verb, :path,\n { response: [:code, :body, { headers: {} }] })\n { path: endpoint_data[:path], verb: endpoint_data[:verb], response_code: endpoint_data[:response][:code],\n body: endpoint_data[:response][:body], headers: endpoint_data[:response][:headers] }\n end",
"def raw_api(method,params=nil)\n debug(6,:var=>method,:msg=>\"method\")\n debug(6,:var=>params,:msg=>\"Parameters\")\n\n checkauth\n checkversion(1,1)\n params={} if params==nil\n obj=do_request(json_obj(method,params))\n return obj['result']\n end",
"def validated_name_args(method_name, body)\n @args = json_parse(body)\n args = case method_name\n when /^sha$/ then []\n when /^alive$/ then []\n when /^ready$/ then []\n when /^image_names$/ then []\n when /^names$/ then []\n when /^manifests$/ then []\n when /^manifest$/ then [name]\n else\n raise ClientError, 'json:malformed'\n end\n if query?(method_name)\n method_name += '?'\n end\n [method_name, args]\n end",
"def query_parameters\n end"
] | [
"0.5964625",
"0.587524",
"0.587524",
"0.5734517",
"0.57123655",
"0.56801575",
"0.566042",
"0.56546396",
"0.5607281",
"0.5597859",
"0.5597859",
"0.5585274",
"0.557061",
"0.557061",
"0.557061",
"0.557061",
"0.556374",
"0.5546403",
"0.5521726",
"0.55144954",
"0.5507968",
"0.5486698",
"0.5477431",
"0.54763716",
"0.5474048",
"0.5461013",
"0.54360646",
"0.5423259",
"0.5422637",
"0.5420626",
"0.5413878",
"0.5413654",
"0.5409531",
"0.5405287",
"0.53750163",
"0.5370325",
"0.536552",
"0.5362375",
"0.5356698",
"0.53459966",
"0.5338504",
"0.5328175",
"0.5318486",
"0.5312094",
"0.5304121",
"0.5299031",
"0.5292027",
"0.52869445",
"0.5265111",
"0.5264179",
"0.52615106",
"0.52611697",
"0.5258042",
"0.5255536",
"0.5249085",
"0.5243355",
"0.52414346",
"0.52384996",
"0.52371687",
"0.5234867",
"0.5219231",
"0.52153873",
"0.52055746",
"0.5201648",
"0.5201648",
"0.51944166",
"0.51877874",
"0.5187187",
"0.5184568",
"0.5179136",
"0.5169359",
"0.5167745",
"0.5166149",
"0.51638865",
"0.51638865",
"0.51638865",
"0.51616704",
"0.51616704",
"0.5160572",
"0.5155496",
"0.5155028",
"0.51521873",
"0.5149278",
"0.51463354",
"0.51457345",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51449317",
"0.51441896",
"0.51419264",
"0.51416063",
"0.51333404"
] | 0.5258396 | 52 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: backend_servers, type: String name: host_id, type: String name: load_balancer_id, type: String name: owner_account, type: String | def remove_backend_servers(optional={})
args = self.class.new_params
args[:query]['Action'] = 'RemoveBackendServers'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :backend_servers
args[:query]['BackendServers'] = optional[:backend_servers]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_parameters; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def rest_endpoint=(_arg0); end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request_params; end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def http=(_arg0); end",
"def service_endpoint; end",
"def service_endpoint; end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def set_backend_servers(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetBackendServers'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_servers\n\t\t\targs[:query]['BackendServers'] = optional[:backend_servers]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_backend_servers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeBackendServers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def update!(**args)\n @backend_type = args[:backend_type] if args.key?(:backend_type)\n @backend_uri = args[:backend_uri] if args.key?(:backend_uri)\n @backends = args[:backends] if args.key?(:backends)\n @health_check_uri = args[:health_check_uri] if args.key?(:health_check_uri)\n @load_balancer_type = args[:load_balancer_type] if args.key?(:load_balancer_type)\n end",
"def http_options; end",
"def http; end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def endpoints; end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def request(*args); end",
"def http_options=(_arg0); end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def build_request(method); end",
"def request_method; end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def rest_endpoint; end",
"def add_backend_servers(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'AddBackendServers'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_servers\n\t\t\targs[:query]['BackendServers'] = optional[:backend_servers]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def adjust_params \n #if request is like this:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations\n if params[:action] == 'index'\n \n # If it is \n # GET /relations\n # Then we cannot sevice this request, must specify the entity.\n# if !params[:database_id] and !params[:entity_id]\n# render :text => 'GET /relations is not available', :status => 400\n# return false;\n# end\n\n # But in the remaining two cases:\n # * /entities/relations\n # * /databases/entities/relations\n # Allow the class\n return true;\n end\n \n # if it is:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations/\n # Becasue show needs to have an ID, therefore\n # any of the above URL will do and no context is needed.\n #FIXME: What other possibility the show action might face?\n if params[:action] == 'show'\n return true;\n end\n \n #If its like this:\n # POST /relations\n # POST /entities/relations\n # POST /databases/entities/relations\n # NOTE: For now, the relation resource should be totally complete\n # even if the call is being as a nested resource.\n #\n if params[:action] == 'create'\n \n #if it is like this:\n # POST /relations\n # Then the relations resource should be complete in\n # every respect.\n if !params[:database_id] and !params[:entity_id]\n #return true if valid_relation_resource?\n # Otherwise, the resource is not vaild and we need to tell the user\n #render :json => report_errors(nil, 'The provided realtion resource is incomplete')[0], \n # :status => 400 and return false;\n end\n \n # But if its something like this:\n # POST /entities/:entity_id/relations\n # POST /databases/entities/:entity_id/relations\n #\n if params[:database_id] or params[:entity_id]\n # Then if the relation resource is valid, \n # the entity_id parameter is altogather ignored.\n #return true if valid_relation_resource? \n end\n return true\n end\n \n # if its either of these:\n # PUT /relations\n # PUT /entities/relations\n # PUT /databases/entities/relations\n #\n if params[:action] == 'update'\n # Set the params[:relation_id] because\n # the underlying Admin::EntitiesController#add_link function\n # expects it\n params[:relation_id] = params[:id] and return true;\n end\n \n # If it is either of these:\n # DELETE /relations\n # DELETE /entities/relations\n # DELETE /databases/entities/relations\n #\n if params[:action] == 'destroy'\n \n # For now, you can only make a nested call.\n #PENDING: This would change when the rest call would include the user\n # authenticiy information which would help to determine whether the \n # relation being deleted belongs to the user or not.\n if !params[:entity_id]\n render :json => report_errors(nil, 'DELETE /relations call is not available for now. Call DELETE /entities/relations instead')[0],\n :status => 400 and return false\n end\n \n params[:source_id] = params[:entity_id]\n return true;\n \n end\n \n # In all cases, the request is not handled by this controller!\n render :json => report_errors(nil, \"The requested action is \\\"#{params[:action]}\\\" \" + \n \" on controller \\\"#{params[:controller]}\\\" while I am\" + \n \" \\\"#{self.class.name}\\\" and cannot handle your request.\")[0],:status => 400 and return false;\n \n end",
"def add_backend_servers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'AddBackendServers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_servers\n\t\t\targs[:query]['BackendServers'] = optional[:backend_servers]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n endpoint_data = params.require(:data).require(:attributes).permit(:verb, :path,\n { response: [:code, :body, { headers: {} }] })\n { path: endpoint_data[:path], verb: endpoint_data[:verb], response_code: endpoint_data[:response][:code],\n body: endpoint_data[:response][:body], headers: endpoint_data[:response][:headers] }\n end",
"def http_params\n {}\n end",
"def valid_params_request?; end",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def perform(arguments = {})\n case type.to_sym\n when :post, :get\n api.public_send(type, path, @arguments.merge(arguments))\n else\n raise ArgumentError, \"Unregistered request type #{request_type}\"\n end\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def get_endpoint()\n end",
"def request_method_symbol; end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def method_missing(method_name, *args)\n payload = Kauplus::Client.authenticate_payload(args.first)\n if method_name.match(/(get|post|multipart_post|put|delete|head)_(.*)/)\n Kauplus::Client.send($1, \"#{@resource}/#{$2}\", payload)\n else\n Kauplus::Client.get(\"#{@resource}/#{method_name}\", payload)\n end\n end",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def query_parameters; end",
"def set_api(*args); end",
"def set_api(*args); end",
"def service_type_name\n \"REST\"\n end",
"def payment_methods_post_with_http_info(create_payment_method_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentMethodsApi.payment_methods_post ...'\n end\n # verify the required parameter 'create_payment_method_request' is set\n if @api_client.config.client_side_validation && create_payment_method_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_payment_method_request' when calling PaymentMethodsApi.payment_methods_post\"\n end\n # resource path\n local_var_path = '/payment-methods'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Trace-Id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n header_params[:'End-User-Device-Id'] = opts[:'end_user_device_id'] if !opts[:'end_user_device_id'].nil?\n header_params[:'End-User-Ip'] = opts[:'end_user_ip'] if !opts[:'end_user_ip'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_payment_method_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PaymentMethod'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BearerAuth']\n\n new_options = opts.merge(\n :operation => :\"PaymentMethodsApi.payment_methods_post\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentMethodsApi#payment_methods_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_method\n raise \"Implement in child class\"\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def bi_service\n end",
"def platform_endpoint; end",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.update_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.update_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.update_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.update_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#update_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def operations\n # Base URI works as-is.\n end",
"def api_only=(_arg0); end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def params_to_api_args(type)\n args = params.to_unsafe_h.symbolize_keys.except(:controller)\n args[:method] = request.method\n args[:action] = type\n args.delete(:format)\n args\n end",
"def set_request; end",
"def request(endpoint, request, &block); end",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def cloud_params\n params.require(:cloud).permit(:api, :url, :ip_addresses, :port, :token, :shared_secret, :bucket, :platform_id)\n end",
"def initialize(*)\n super\n @json_rpc_call_id = 0\n @json_rpc_endpoint = URI.parse(currency.rpc)\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def url_field(object_name, method, options = T.unsafe(nil)); end",
"def endpoint\n raise NotImplementedError\n end",
"def send_request(method, params, &block); end",
"def request(*args)\n end",
"def endpoint=(_arg0); end",
"def service_request(service); end",
"def perform(request, options); end",
"def build_request(*args); end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end"
] | [
"0.6474627",
"0.6289442",
"0.6230481",
"0.6017509",
"0.58854175",
"0.5771842",
"0.57512516",
"0.5707569",
"0.5659567",
"0.5629907",
"0.5601322",
"0.55060434",
"0.5479961",
"0.5479961",
"0.5479961",
"0.5479961",
"0.54543763",
"0.54415727",
"0.5439501",
"0.53967047",
"0.5386634",
"0.5385464",
"0.5371564",
"0.5339211",
"0.5339211",
"0.53329605",
"0.5315769",
"0.53142434",
"0.5313003",
"0.5308045",
"0.5299951",
"0.52976894",
"0.52976894",
"0.52944887",
"0.5276897",
"0.5269086",
"0.5258393",
"0.52401066",
"0.5233981",
"0.52323014",
"0.52323014",
"0.52266586",
"0.52038413",
"0.51907504",
"0.5178392",
"0.5178301",
"0.5167485",
"0.51601994",
"0.5156724",
"0.5149908",
"0.5133731",
"0.5116439",
"0.5112947",
"0.51073855",
"0.5106363",
"0.5105106",
"0.5098593",
"0.5084711",
"0.50804406",
"0.5070431",
"0.5061592",
"0.505638",
"0.5054252",
"0.50514054",
"0.50497556",
"0.50497556",
"0.5047865",
"0.50472486",
"0.5046499",
"0.50371414",
"0.50235873",
"0.50162905",
"0.5016032",
"0.5011987",
"0.5008824",
"0.5006397",
"0.5006012",
"0.50017005",
"0.49957097",
"0.4995695",
"0.49945378",
"0.49890205",
"0.4986048",
"0.4970844",
"0.496992",
"0.49670762",
"0.49653396",
"0.49623868",
"0.4950005",
"0.4949532",
"0.49459487",
"0.49450794",
"0.49405777",
"0.49403742",
"0.49373186",
"0.4931702",
"0.4931148",
"0.4931148",
"0.4931148",
"0.4931148",
"0.4931148"
] | 0.0 | -1 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: cookie, type: String name: cookie_timeout, type: Integer name: domain, type: String name: health_check, type: String name: health_check_timeout, type: Integer name: healthy_threshold, type: Integer name: host_id, type: String name: interval, type: Integer name: listener_port, type: Integer name: load_balancer_id, type: String name: owner_account, type: String name: scheduler, type: String name: sticky_session, type: String name: sticky_session_type, type: String name: u_r_i, type: String name: unhealthy_threshold, type: Integer name: x_forwarded_for, type: String | def set_load_balancer_h_t_t_p_listener_attribute(optional={})
args = self.class.new_params
args[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :cookie
args[:query]['Cookie'] = optional[:cookie]
end
if optional.key? :cookie_timeout
args[:query]['CookieTimeout'] = optional[:cookie_timeout]
end
if optional.key? :domain
args[:query]['Domain'] = optional[:domain]
end
if optional.key? :health_check
args[:query]['HealthCheck'] = optional[:health_check]
end
if optional.key? :health_check_timeout
args[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]
end
if optional.key? :healthy_threshold
args[:query]['HealthyThreshold'] = optional[:healthy_threshold]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :interval
args[:query]['Interval'] = optional[:interval]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
if optional.key? :scheduler
args[:query]['Scheduler'] = optional[:scheduler]
end
if optional.key? :sticky_session
args[:query]['StickySession'] = optional[:sticky_session]
end
if optional.key? :sticky_session_type
args[:query]['StickySessionType'] = optional[:sticky_session_type]
end
if optional.key? :u_r_i
args[:query]['URI'] = optional[:u_r_i]
end
if optional.key? :unhealthy_threshold
args[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]
end
if optional.key? :x_forwarded_for
args[:query]['XForwardedFor'] = optional[:x_forwarded_for]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_parameters; end",
"def params\n {\n \"add-header\" => nil,\n \"burst-length\" => nil,\n \"client\" => nil,\n \"close-with-reset\" => nil,\n \"debug\" => nil,\n \"failure-status\" => nil,\n \"hog\" => nil,\n \"http-version\" => nil,\n \"max-connections\" => nil,\n \"max-piped-calls\" => nil,\n \"method\" => nil,\n \"no-host-hdr\" => nil,\n \"num-calls\" => nil,\n \"num-conns\" => nil,\n \"period\" => nil,\n \"port\" => nil,\n \"print-reply\" => nil,\n \"print-request\" => nil,\n \"rate\" => nil,\n \"recv-buffer\" => nil,\n \"retry-on-failure\" => nil,\n \"send-buffer\" => nil,\n \"server\" => nil,\n \"server-name\" => nil,\n \"session-cookies\" => nil,\n \"ssl\" => nil,\n \"ssl-ciphers\" => nil,\n \"ssl-no-reuse\" => nil,\n \"think-timeout\" => nil,\n \"timeout\" => nil,\n \"uri\" => nil,\n \"verbose\" => nil,\n \"version\" => nil,\n \"wlog\" => nil,\n \"wsess\" => nil,\n \"wsesslog\" => nil,\n \"wset\" => nil\n }\n end",
"def http_options; end",
"def request_params; end",
"def unboundRequest(params)\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n\n resources = []\n\n h1 = Hash.new\n h2 = Hash.new\n\n # puts Time.zone.now\n\n if params[:start_date] != \"\"\n valid_from = params[:start_date] + \":00 \"\n valid_from = Time.zone.parse(valid_from)\n else\n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n time_from = roundTimeUp(time_now)\n valid_from = Time.zone.now.to_s.split(\" \")[0] + \" \" +time_from+ \":00 \"\n valid_from = Time.zone.parse(valid_from)\n end\n\n #For nodes\n if params[:number_of_nodes] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_nodes].to_i.times {resources << h1}\n\n end\n\n #For channels\n if params[:number_of_channels] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_channels].to_i.times {resources << h1}\n\n end\n\n options = {body: {\n resources: resources\n }.to_json, :headers => { 'Content-Type' => 'application/json' } , :verify => false}\n response = HTTParty.get(broker_url+\"/resources\", options)\n\n puts options\n\n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response\n flash[:danger] = response\n else \n puts response\n response[\"resource_response\"][\"resources\"].each do |element|\n element[\"valid_from\"] = Time.zone.parse(element[\"valid_from\"]).to_s\n element[\"valid_until\"] = Time.zone.parse(element[\"valid_until\"]).to_s\n end\n\n return response\n end\n end",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def query_parameters; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def http_params\n {}\n end",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def http; end",
"def initialize params = {}\n defaults = {\n :port => 80,\n :user_agent => 'Net::HTTP::RestClient'\n }\n if params[:port]==443 && !params[:ssl]\n defaults.merge! :ssl => {\n :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE\n } \n end\n @params = defaults.merge(params)\n @cookies = {}\n @headers = {}\n @params[:headers] && @headers=@params[:headers]\n @params[:cookies] && @cookies=@params[:cookies]\n end",
"def request_method; end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def service_endpoint; end",
"def service_endpoint; end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def endpoints; end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def query_parameters\n end",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http=(_arg0); end",
"def request_params\n rid = create_uuid\n request_type = params[:request_type]\n request_url = params[:url]\n request_parameters = params[:request_parameters]\n request_headers = params[:request_headers]\n request_payload = params[:request_payload]\n username = params[:username]\n password = params[:password]\n private_request = params[:private_request]\n\n request = Faraday.new\n\n # If authentication is filled out, apply it.\n request.basic_auth(username, password) if username.present?\n\n # Be nice and send a descriptive user agent. Also handy for debugging and\n # tracking down potential problems.\n request.headers['User-Agent'] = 'ReHTTP/v1.0'\n\n # Split the additional headers out into the name and value and then apply\n # then to the request.\n request_headers.split(\"\\r\\n\").each do |header|\n header_components = header.split(':')\n request.headers[header_components[0]] = header_components[1]\n end\n\n # Ensure the parameters are available before trying to create a new hash\n # from them.\n if request_parameters.present?\n request_params = Hash[request_parameters.split(\"\\r\\n\").map {|params| params.split('=') }]\n else\n request_params = {}\n end\n\n case request_type\n when 'GET'\n response = request.get(request_url, request_params)\n when 'POST'\n response = request.post(request_url, request_payload)\n when 'PUT'\n response = request.put(request_url, request_params)\n when 'DELETE'\n response = request.delete request_url\n when 'OPTIONS'\n response = request.options request_url\n when 'HEAD'\n response = request.head request_url\n when 'PATCH'\n response = request.patch request_url\n end\n\n {\n rid: rid,\n request_type: request_type,\n url: request_url,\n private_request: private_request,\n request_data: {\n headers: request.headers,\n data: {}\n }.to_json,\n response_data: {\n headers: response.headers,\n body: response.body,\n status: response.status\n }.to_json\n }\n end",
"def request(*args); end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def valid_params_request?; end",
"def rest_endpoint; end",
"def to_http_health_params\n {\n port: http_health_port,\n path: http_health_path\n }\n end",
"def http_options=(_arg0); end",
"def register(params)\n# @timestamp = params[\"timestamp\"]\n# @source = param[\"source\"]\n# @beacon_id = param[\"beacon_id\"]\nend",
"def valid_request(h = {})\n h.merge!({:use_route => :sensit_api, :format => \"json\", :api_version => \"1\"})\n end",
"def request_type; \"RequestType\"; end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def request_hash(name, options)\n h = {\n id: name,\n apiVersion: kube_api_version,\n }.merge!(options)\n Chef::Log.debug h\n h\n end",
"def initialize(host, username, password, port=443, sslcheck=false, timeout=8)\n @resturl = sprintf('https://%s:%d/rest', host, port)\n @rpcurl = sprintf('https://%s:%d/rpc', host, port)\n @timeout = timeout\n @sslcheck = sslcheck\n @username = Base64.strict_encode64(username)\n @password = Base64.strict_encode64(password)\n\n # Map the new naming convention against the old one\n #FIXME# Filtering json hash content can be done this way\n # h1 = {:a => 1, :b => 2, :c => 3, :d => 4}\n # h1.slice(:a, :b) # return {:a=>1, :b=>2}, but h1 is not changed\n # h2 = h1.slice!(:a, :b) # h1 = {:a=>1, :b=>2}, h2 = {:c => 3, :d => 4}\n @servicemapper = {\n 'ip_site_add' => ['ip_site_add', 'This service allows to add an IP address Space.'],\n 'ip_site_update' => ['ip_site_add', 'This service allows to update an IP address Space.'],\n 'ip_site_count' => ['ip_site_count', 'This service returns the number of IP address Spaces matching optional condition(s).'],\n 'ip_site_list' => ['ip_site_list', 'This service returns a list of IP address Spaces matching optional condition(s).'],\n 'ip_site_info' => ['ip_site_info', 'This service returns information about a specific IP address Space.'],\n 'ip_site_delete' => ['ip_site_delete', 'This service allows to delete a specific IP address Space.'],\n 'ip_subnet_add' => ['ip_subnet_add', 'This service allows to add an IPv4 Network of type Subnet or Block.'],\n 'ip_subnet_update' => ['ip_subnet_add', 'This service allows to update an IPv4 Network of type Subnet or Block.'],\n 'ip_subnet_count' => ['ip_block_subnet_count', 'This service returns the number of IPv4 Networks matching optional condition(s).'],\n 'ip_subnet_list' => ['ip_block_subnet_list', 'This service returns a list of IPv4 Networks matching optional condition(s).'],\n 'ip_subnet_info' => ['ip_block_subnet_info', 'This service returns information about a specific IPv4 Network.'],\n 'ip_subnet_delete' => ['ip_subnet_delete', 'This service allows to delete a specific IPv4 Network.'],\n 'ip_subnet_find_free' => ['ip_find_free_subnet', 'This service allows to retrieve a list of available IPv4 Networks matching optional condition(s).'],\n 'ip_subnet6_add' => ['ip6_subnet6_add', 'This service allows to add an IPv6 Network of type Subnet or Block.'],\n 'ip_subnet6_update' => ['ip6_subnet6_add', 'This service allows to update an IPv6 Network of type Subnet or Block.'],\n 'ip_subnet6_count' => ['ip6_block6_subnet6_count', 'This service returns the number of IPv6 Networks matching optional condition(s).'],\n 'ip_subnet6_list' => ['ip6_block6_subnet6_list', 'This service returns a list of IPv6 Networks matching optional condition(s).'],\n 'ip_subnet6_info' => ['ip6_block6_subnet6_info', 'This service returns information about a specific IPv6 Network.'],\n 'ip_subnet6_delete' => ['ip6_subnet6_delete', 'This service allows to delete a specific IPv6 Network.'],\n 'ip_subnet6_find_free' => ['ip6_find_free_subnet6', 'This service allows to retrieve a list of available IPv6 Networks matching optional condition(s).'],\n 'ip_pool_add' => ['ip_pool_add', 'This service allows to add an IPv4 Address Pool.'],\n 'ip_pool_update' => ['ip_pool_add', 'This service allows to update an IPv4 Address Pool.'],\n 'ip_pool_count' => ['ip_pool_count', 'This service returns the number of IPv4 Address Pools matching optional condition(s).'],\n 'ip_pool_list' => ['ip_pool_list', 'This service returns a list of IPv4 Address Pools matching optional condition(s).'],\n 'ip_pool_info' => ['ip_pool_info', 'This service returns information about a specific IPv4 Address Pool.'],\n 'ip_pool_delete' => ['ip_pool_delete', 'This service allows to delete a specific IPv4 Address Pool.'],\n 'ip_pool6_add' => ['ip6_pool6_add', 'This service allows to add an IPv6 Address Pool.'],\n 'ip_pool6_update' => ['ip6_pool6_add', 'This service allows to update an IPv6 Address Pool.'],\n 'ip_pool6_count' => ['ip6_pool6_count', 'This service returns the number of IPv6 Address Pools matching optional condition(s).'],\n 'ip_pool6_list' => ['ip6_pool6_list', 'This service returns a list of IPv6 Address Pools matching optional condition(s).'],\n 'ip_pool6_info' => ['ip6_pool6_info', 'This service returns information about a specific IPv6 Address Pool.'],\n 'ip_pool6_delete' => ['ip6_pool6_delete', 'This service allows to delete a specific IPv6 Address Pool.'],\n 'ip_address_add' => ['ip_add', 'This service allows to add an IPv4 Address.'],\n 'ip_address_update' => ['ip_add', 'This service allows to update an IPv4 Address.'],\n 'ip_address_count' => ['ip_address_count', 'This service returns the number of IPv4 Addresses matching optional condition(s).'],\n 'ip_address_list' => ['ip_address_list', 'This service returns a list of IPv4 Addresses matching optional condition(s).'],\n 'ip_address_info' => ['ip_address_info', 'This service returns information about a specific IPv4 Address.'],\n 'ip_address_delete' => ['ip_delete', 'This service allows to delete a specific IPv4 Address.'],\n 'ip_address_find_free' => ['ip_find_free_address', 'This service allows to retrieve a list of available IPv4 Addresses matching optional condition(s).'],\n 'ip_address6_add' => ['ip6_address6_add', 'This service allows to add an IPv6 Address'],\n 'ip_address6_update' => ['ip6_address6_add', 'This service allows to update an IPv6 Address'],\n 'ip_address6_count' => ['ip6_address6_count', 'This service returns the number of IPv6 Addresses matching optional condition(s).'],\n 'ip_address6_list' => ['ip6_address6_list', 'This service returns a list of IPv6 Addresses matching optional condition(s).'],\n 'ip_address6_info' => ['ip6_address6_info', 'This service returns information about a specific IPv6 Address.'],\n 'ip_address6_delete' => ['ip6_address6_delete', 'This service allows to delete a specific IPv6 Address.'],\n 'ip_address6_find_free' => ['ip6_find_free_address6', 'This service allows to retrieve a list of available IPv6 Addresses matching optional condition(s).'],\n 'ip_alias_add' => ['ip_alias_add', 'This service allows to associate an Alias of type A or CNAME to an IPv4 Address.'],\n 'ip_alias_list' => ['ip_alias_list', 'This service returns the list of an IPv4 Address\\' associated Aliases.'],\n 'ip_alias_delete' => ['ip_alias_delete', 'This service allows to remove an Alias associated to an IPv4 Address.'],\n 'ip_alias6_add' => ['ip6_alias_add', 'This service allows to associate an Alias of type A or CNAME to an IPv4 Address.'],\n 'ip_alias6_list' => ['ip6_alias_list', 'This service returns the list of an IPv6 Address\\' associated Aliases.'],\n 'ip_alias6_delete' => ['ip6_alias_delete', 'This service allows to remove an Alias associated to an IPv6 Address.'],\n 'vlm_domain_add' => ['vlm_domain_add', 'This service allows to add a VLAN Domain.'],\n 'vlm_domain_update' => ['vlm_domain_add', 'This service allows to update a VLAN Domain.'],\n 'vlm_domain_count' => ['vlmdomain_count', 'This service returns the number of VLAN Domains matching optional condition(s).'],\n 'vlm_domain_list' => ['vlmdomain_list', 'This service returns a list of VLAN Domains matching optional condition(s).'],\n 'vlm_domain_info' => ['vlmdomain_info', 'This service returns information about a specific VLAN Domain.'],\n 'vlm_domain_delete' => ['vlm_domain_delete', 'This service allows to delete a specific VLAN Domain.'],\n 'vlm_range_add' => ['vlm_range_add', 'This service allows to add a VLAN Range.'],\n 'vlm_range_update' => ['vlm_range_add', 'This service allows to update a VLAN Range.'],\n 'vlm_range_count' => ['vlmrange_count', 'This service returns the number of VLAN Ranges matching optional condition(s).'],\n 'vlm_range_list' => ['vlmrange_list', 'This service returns a list of VLAN Domains matching optional condition(s).'],\n 'vlm_range_info' => ['vlmrange_info', 'This service returns information about a specific VLAN Range.'],\n 'vlm_range_delete' => ['vlm_range_delete', 'This service allows to delete a specific VLAN Range.'],\n 'vlm_vlan_add' => ['vlm_vlan_add', 'This service allows to add a VLAN.'],\n 'vlm_vlan_update' => ['vlm_vlan_add', 'This service allows to update a VLAN.'],\n 'vlm_vlan_count' => ['vlmvlan_count', 'This service returns the number of VLANs matching optional condition(s).'],\n 'vlm_vlan_list' => ['vlmvlan_list', 'This service returns a list of VLANs matching optional condition(s).'],\n 'vlm_vlan_info' => ['vlmvlan_info', 'This service returns information about a specific VLAN.'],\n 'vlm_vlan_delete' => ['vlm_vlan_delete', 'This service allows to delete a specific VLAN.']\n }\n end",
"def http_call(payload); end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def rest_endpoint=(_arg0); end",
"def base_params\n {\n v: PROTOCOL_VERSION,\n # Client ID\n cid: @user_id,\n # Tracking ID\n tid: TRACKING_ID,\n # Application Name\n an: APPLICATION_NAME,\n # Application Version\n av: Bolt::VERSION,\n # Anonymize IPs\n aip: true,\n # User locale\n ul: Locale.current.to_rfc,\n # Custom Dimension 1 (Operating System)\n cd1: @os\n }\n end",
"def request(*args)\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def restclient_option_keys\n [:method, :url, :payload, :headers, :timeout, :open_timeout,\n :verify_ssl, :ssl_client_cert, :ssl_client_key, :ssl_ca_file]\n end",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_method_symbol; end",
"def api(params = {})\n Celluloid::Logger.info \"Registering api...\"\n self.use_api = true\n self.api_host = params[:host] || '127.0.0.1'\n self.api_port = params[:port] || '4321'\n end",
"def build_request(method); end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def type\n raise Gps::Request::TypeMissingException.new(\"The Gps Request does not have the type implemented. #{@params.inspect}\")\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def operational_values\n\t\treturn super.merge(\n\t\t\turi: self.uri,\n\t\t\thttp_method: self.http_method,\n\t\t\texpected_status: self.expected_status,\n\t\t\tbody: self.body,\n\t\t\tbody_mimetype: self.body_mimetype\n\t\t)\n\tend",
"def set_request; end",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def service_request(service); end",
"def endpoint_options\n {user: @username,\n pass: @password,\n host: @host,\n port: @port,\n operation_timeout: @timeout_in_seconds,\n no_ssl_peer_verification: true,\n disable_sspi: true}\n end",
"def query_params; end",
"def request_data; end",
"def get_parameters; end",
"def get_parameters; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def type_params; end",
"def initialize(options)\n unless (@logger = options[:logger])\n raise ::ArgumentError, \"options[:logger] is required: #{@logger.inspect}\"\n end\n unless (@mode = options[:mode].to_s) && MODES.include?(@mode)\n raise ::ArgumentError, \"options[:mode] must be one of #{MODES.inspect}: #{@mode.inspect}\"\n end\n unless (@kind = options[:kind].to_s) && KINDS.include?(@kind)\n raise ::ArgumentError, \"options[:kind] must be one of #{KINDS.inspect}: #{@kind.inspect}\"\n end\n unless (@uri = options[:uri]) && @uri.respond_to?(:path)\n raise ::ArgumentError, \"options[:uri] must be a valid parsed URI: #{@uri.inspect}\"\n end\n unless (@verb = options[:verb]) && VERBS.include?(@verb)\n raise ::ArgumentError, \"options[:verb] must be one of #{VERBS.inspect}: #{@verb.inspect}\"\n end\n unless (@headers = options[:headers]).kind_of?(::Hash)\n raise ::ArgumentError, \"options[:headers] must be a hash: #{@headers.inspect}\"\n end\n unless (@route_data = options[:route_data]).kind_of?(::Hash)\n raise ::ArgumentError, \"options[:route_data] must be a hash: #{@route_data.inspect}\"\n end\n @http_status = options[:http_status]\n if @kind == 'response'\n @http_status = Integer(@http_status)\n elsif !@http_status.nil?\n raise ::ArgumentError, \"options[:http_status] is unexpected for #{@kind}.\"\n end\n unless (@variables = options[:variables]).kind_of?(::Hash)\n raise ::ArgumentError, \"options[:variables] must be a hash: #{@variables.inspect}\"\n end\n if (@effective_route_config = options[:effective_route_config]) && !@effective_route_config.kind_of?(::Hash)\n raise ::ArgumentError, \"options[:effective_route_config] is not a hash: #{@effective_route_config.inspect}\"\n end\n @body = options[:body] # not required\n\n # merge one or more wildcard configurations matching the current uri and\n # parameters.\n @headers = normalize_headers(@headers)\n @typenames_to_values = compute_typenames_to_values\n\n # effective route config may already have been computed for request\n # (on record) or not (on playback).\n @effective_route_config ||= compute_effective_route_config\n\n # apply the configuration by substituting for variables in the request and\n # by obfuscating wherever a variable name is nil.\n erck = @effective_route_config[@kind]\n case @mode\n when 'validate'\n # used to validate the fixtures before playback; no variable\n # substitution should be performed.\n else\n if effective_variables = erck && erck[VARIABLES_KEY]\n recursive_replace_variables(\n [@kind, VARIABLES_KEY],\n @typenames_to_values,\n effective_variables,\n erck[TRANSFORM_KEY])\n end\n end\n if logger.debug?\n logger.debug(\"#{@kind} effective_route_config = #{@effective_route_config[@kind].inspect}\")\n logger.debug(\"#{@kind} typenames_to_values = #{@typenames_to_values.inspect}\")\n end\n\n # recreate headers and body from data using variable substitutions and\n # obfuscations.\n @headers = @typenames_to_values[:header]\n @body = normalize_body(@headers, @typenames_to_values[:body] || @body)\n end",
"def method_missing(meth, *args)\n hyves_method = meth.to_s.gsub('_', '.')\n options = {:ha_method => hyves_method}\n options.merge!(args.first) if args.first.is_a?(Hash)\n hyves_log('Hyves', \"Sent request: #{options.inspect}\")\n response = request(options)\n hyves_log('Hyves', \"Got response: #{response.inspect}\")\n return response\n end",
"def initialize(name, url, params = {})\r\n @name, @url, @params = name, url, params\r\n end",
"def service_type_name\n \"REST\"\n end",
"def get_endpoint()\n end",
"def params() @param_types end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end"
] | [
"0.60035664",
"0.59973466",
"0.5782403",
"0.5749603",
"0.5656002",
"0.56268954",
"0.56108236",
"0.5606029",
"0.5599377",
"0.5599377",
"0.5599377",
"0.5599377",
"0.55653846",
"0.55365217",
"0.5524096",
"0.5524096",
"0.5522632",
"0.5475042",
"0.5474657",
"0.5473388",
"0.54641795",
"0.5436554",
"0.54091495",
"0.54091495",
"0.5404278",
"0.5383222",
"0.53577226",
"0.5313277",
"0.53024006",
"0.53016806",
"0.5292886",
"0.5288173",
"0.52715445",
"0.52620566",
"0.52618515",
"0.5260146",
"0.5246154",
"0.52449465",
"0.5227672",
"0.52197677",
"0.52162707",
"0.5200687",
"0.5200126",
"0.5193501",
"0.5187658",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5185115",
"0.5184434",
"0.5179947",
"0.51746964",
"0.51675093",
"0.5164671",
"0.5164484",
"0.51626563",
"0.51592255",
"0.5154339",
"0.5151448",
"0.5143048",
"0.5139605",
"0.51279753",
"0.5127572",
"0.5123752",
"0.5122828",
"0.5110164",
"0.5108037",
"0.510755",
"0.51024616",
"0.5100509",
"0.5100509",
"0.5099155",
"0.5099155",
"0.5099155",
"0.5099155",
"0.5099155",
"0.5097042",
"0.5095749",
"0.50841737",
"0.5075774",
"0.506394",
"0.5054011",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385",
"0.50534385"
] | 0.52903783 | 31 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: listener_port, type: Integer name: listener_status, type: String name: load_balancer_id, type: String name: owner_account, type: String | def set_load_balancer_listener_status(optional={})
args = self.class.new_params
args[:query]['Action'] = 'SetLoadBalancerListenerStatus'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :listener_status
args[:query]['ListenerStatus'] = optional[:listener_status]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_banancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBanancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def start_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StartLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def describe_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def describe_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def delete_load_balancer_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def rest_endpoint=(_arg0); end",
"def request_parameters; end",
"def stop_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StopLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http=(_arg0); end",
"def service_endpoint; end",
"def service_endpoint; end",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_h_t_t_p_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http; end",
"def set_load_balancer_u_d_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerUDPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_h_t_t_p_s_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_listener_access_control_status(access_control_status, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['AccessControlStatus'] = access_control_status\n\t\targs[:query]['Action'] = 'SetListenerAccessControlStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def endpoints; end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def service_request(service); end",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_params; end",
"def delete_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_t_c_p_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer_listeners(lb_name, listeners)\n params = {}\n\n listener_protocol = []\n listener_lb_port = []\n listener_instance_port = []\n listener_instance_protocol = []\n listener_ssl_certificate_id = []\n listeners.each do |listener|\n listener_protocol.push(listener['Protocol'])\n listener_lb_port.push(listener['LoadBalancerPort'])\n listener_instance_port.push(listener['InstancePort'])\n listener_instance_protocol.push(listener['InstanceProtocol'])\n listener_ssl_certificate_id.push(listener['SSLCertificateId'])\n end\n\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.Protocol', listener_protocol))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.LoadBalancerPort', listener_lb_port))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.InstancePort', listener_instance_port))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.InstanceProtocol', listener_instance_protocol))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.SSLCertificateId', listener_ssl_certificate_id))\n\n request({\n 'Action' => 'CreateLoadBalancerListeners',\n 'LoadBalancerName' => lb_name,\n :parser => Fog::Parsers::AWS::ELB::Empty.new\n }.merge!(params))\n end",
"def request_method; end",
"def set_load_balancer_h_t_t_p_s_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :server_certificate_id\n\t\t\targs[:query]['ServerCertificateId'] = optional[:server_certificate_id]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def client(\n name,\n method: nil,\n url: nil,\n status_callback_event: nil,\n status_callback_method: nil,\n status_callback: nil,\n **keyword_args\n )\n append(Client.new(\n name,\n method: method,\n url: url,\n status_callback_event: status_callback_event,\n status_callback_method: status_callback_method,\n status_callback: status_callback,\n **keyword_args\n ))\n end",
"def request(*args); end",
"def listener_endpoint\n data[:listener_endpoint]\n end",
"def http_options; end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def protocol; end",
"def protocol; end",
"def protocol; end",
"def protocol; end",
"def http_call(payload); end",
"def request(endpoint, request, &block); end",
"def method_missing(name)\n @listener_info[name.to_s]\n super\n end",
"def handle_request(socket, request_type, request_args)\n raise 'not implemented'\n end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def service_type_name\n \"REST\"\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def rest_endpoint; end",
"def set_request; end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def endpoint=(_arg0); end",
"def http_options=(_arg0); end",
"def callback_type; end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def protocol=(_arg0); end",
"def valid_params_request?; end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def remote_method_uri(method, format='ruby')\n params = {'run_id' => @agent_id, 'marshal_format' => format}\n uri = \"/agent_listener/#{PROTOCOL_VERSION}/#{@license_key}/#{method}\"\n uri << '?' + params.map do |k,v|\n next unless v\n \"#{k}=#{v}\"\n end.compact.join('&')\n uri\n end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def interface_sender_params\n params.require(:interface_sender).permit(:method_name, :class_name, :status, :operate_time, :url, :url_method, :url_content, :type)\n end",
"def _param_agent name, type = nil, one_of: nil, all_of: nil, any_of: nil, not: nil, **schema_hash\n combined_schema = one_of || all_of || any_of || (_not = binding.local_variable_get(:not))\n type = schema_hash[:type] ||= type\n pp \"[ZRO] Syntax Error: param `#{name}` has no schema type!\" and return if type.nil? && combined_schema.nil?\n\n schema_hash = CombinedSchema.new(one_of: one_of, all_of: all_of, any_of: any_of, _not: _not) if combined_schema\n param @param_type.to_s.delete('!'), name, type, (@param_type['!'] ? :req : :opt), schema_hash\n end",
"def get_endpoint()\n end",
"def request_type; \"RequestType\"; end",
"def validated_name_args(method_name, body)\n @args = json_parse(body)\n args = case method_name\n when /^sha$/ then []\n when /^alive$/ then []\n when /^ready$/ then []\n when /^image_names$/ then []\n when /^names$/ then []\n when /^manifests$/ then []\n when /^manifest$/ then [name]\n else\n raise ClientError, 'json:malformed'\n end\n if query?(method_name)\n method_name += '?'\n end\n [method_name, args]\n end",
"def endpoint\n raise NotImplementedError\n end",
"def build_request(method); end",
"def send_request(method, params, &block); end",
"def http_method\n raise \"Implement in child class\"\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end"
] | [
"0.63837177",
"0.6372391",
"0.6279545",
"0.6059074",
"0.6011611",
"0.5975739",
"0.59615475",
"0.58857226",
"0.57540584",
"0.5750123",
"0.5721178",
"0.57137656",
"0.56760687",
"0.56727606",
"0.5600799",
"0.5530732",
"0.5530732",
"0.5530732",
"0.5530732",
"0.55079454",
"0.550392",
"0.54894596",
"0.54841584",
"0.54752946",
"0.5444863",
"0.54443896",
"0.54089415",
"0.54046583",
"0.53961134",
"0.5391202",
"0.53808385",
"0.53808385",
"0.5373387",
"0.53688264",
"0.5341238",
"0.53290766",
"0.5307722",
"0.5304123",
"0.5296782",
"0.5296782",
"0.5289462",
"0.5288336",
"0.5270827",
"0.52597797",
"0.52449167",
"0.5244514",
"0.523084",
"0.52196527",
"0.5212927",
"0.52110326",
"0.5192641",
"0.5190227",
"0.51813084",
"0.5174612",
"0.5167854",
"0.5133788",
"0.51318854",
"0.5110306",
"0.5110306",
"0.5110306",
"0.5110306",
"0.51079875",
"0.50981206",
"0.50958574",
"0.5095514",
"0.50927114",
"0.508705",
"0.5081356",
"0.5081118",
"0.5065759",
"0.5059331",
"0.5059291",
"0.50574386",
"0.5054997",
"0.5051214",
"0.5047788",
"0.5033468",
"0.50326455",
"0.5024591",
"0.5014815",
"0.5001018",
"0.49979076",
"0.4995556",
"0.4994024",
"0.49905106",
"0.49891907",
"0.498885",
"0.49883136",
"0.49854106",
"0.49834824",
"0.49586013",
"0.49585018",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978"
] | 0.6250731 | 3 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: load_balancer_id, type: String name: load_balancer_name, type: String name: owner_account, type: String | def set_load_balancer_name(optional={})
args = self.class.new_params
args[:query]['Action'] = 'SetLoadBalancerName'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :load_balancer_name
args[:query]['LoadBalancerName'] = optional[:load_balancer_name]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def request_parameters; end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def delete_load_balancer(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request_params; end",
"def rest_endpoint=(_arg0); end",
"def describe_load_balancer_attribute(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http=(_arg0); end",
"def create\n @loadbalancer = Loadbalancer.new(params[:loadbalancer])\n @loadbalancer.account_id = @oeaccount.id\n respond_to do |format|\n if @loadbalancer.save\n format.html { redirect_to loadbalancers_url, notice: 'Loadbalancer was successfully created.' }\n format.json { render json: @loadbalancer, status: :created, location: @loadbalancer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @loadbalancer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_load_balancer_pool_with_http_info(lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool ...'\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#create_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def update_load_balancer_pool_with_http_info(pool_id, lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool ...'\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools/{pool-id}'.sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#update_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def load_balancer_data(balancer = nil)\n params = Smash.new(\"Action\" => \"DescribeLoadBalancers\")\n if balancer\n params[\"LoadBalancerNames.member.1\"] = balancer.id || balancer.name\n end\n result = all_result_pages(nil, :body,\n \"DescribeLoadBalancersResponse\", \"DescribeLoadBalancersResult\",\n \"LoadBalancerDescriptions\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(params),\n )\n end\n if balancer\n health_result = all_result_pages(nil, :body,\n \"DescribeInstanceHealthResponse\", \"DescribeInstanceHealthResult\",\n \"InstanceStates\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(\n \"LoadBalancerName\" => balancer.id || balancer.name,\n \"Action\" => \"DescribeInstanceHealth\",\n ),\n )\n end\n end\n result.map do |blr|\n (balancer || Balancer.new(self)).load_data(\n Smash.new(\n :id => blr[\"LoadBalancerName\"],\n :name => blr[\"LoadBalancerName\"],\n :state => :active,\n :status => \"ACTIVE\",\n :created => blr[\"CreatedTime\"],\n :updated => blr[\"CreatedTime\"],\n :public_addresses => [\n Balancer::Address.new(\n :address => blr[\"DNSName\"],\n :version => 4,\n ),\n ],\n :servers => [blr.get(\"Instances\", \"member\")].flatten(1).compact.map { |i|\n Balancer::Server.new(self.api_for(:compute), :id => i[\"InstanceId\"])\n },\n ).merge(\n health_result.nil? ? {} : Smash.new(\n :server_states => health_result.nil? ? nil : health_result.map { |i|\n Balancer::ServerState.new(\n self.api_for(:compute),\n :id => i[\"InstanceId\"],\n :status => i[\"State\"],\n :reason => i[\"ReasonCode\"],\n :state => i[\"State\"] == \"InService\" ? :up : :down,\n )\n },\n )\n )\n ).valid_state\n end\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_options; end",
"def http_options=(_arg0); end",
"def http; end",
"def build_request(method); end",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def get_balance (opts={})\n query_param_keys = []\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n \n }.merge(opts)\n\n #resource path\n path = \"/get-balance.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"def request_method; end",
"def method_missing(name, *args)\n if args.first.is_a?(String)\n request_uri = args.first\n params = args.last\n else\n request_uri = self.uri\n params = args.first\n end\n\n uri = URI.parse(request_uri)\n\n request = SimpleAWS::Request.new :post, \"#{uri.scheme}://#{uri.host}\", uri.path\n request.params[\"Action\"] = SimpleAWS::Util.camelcase(name.to_s)\n\n if params.is_a?(Hash)\n insert_params_from request, params\n end\n\n send_request request\n end",
"def create_method\n :http_put\n end",
"def create_method\n :http_put\n end",
"def http_method\n raise \"Implement in child class\"\n end",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:url, :accessible)\n end",
"def http_params\n {}\n end",
"def balance_post_with_http_info(addrs, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.balance_post ...'\n end\n # verify the required parameter 'addrs' is set\n if @api_client.config.client_side_validation && addrs.nil?\n fail ArgumentError, \"Missing the required parameter 'addrs' when calling DefaultApi.balance_post\"\n end\n # resource path\n local_var_path = '/api/v1/balance'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = addrs\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#balance_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request(*args); end",
"def request(endpoint, request, &block); end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def service_endpoint; end",
"def service_endpoint; end",
"def endpoints; end",
"def load_balancer # rubocop:disable AbcSize\n raise 'Can not determine hostname to load client for' if @new_resource.f5.nil?\n @@load_balancers ||= []\n add_lb(@new_resource.f5) if @@load_balancers.empty?\n add_lb(@new_resource.f5) if @@load_balancers.find { |lb| lb.name == @new_resource.f5 }.nil?\n @@load_balancers.find { |lb| lb.name == @new_resource.f5 }\n end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def valid_params_request?; end",
"def new_brb_in_request(meth, *args)\r\n\r\n if is_brb_request_blocking?(meth)\r\n\r\n m = meth.to_s\r\n m = m[0, m.size - 6].to_sym\r\n\r\n idrequest = args.pop\r\n thread = args.pop\r\n begin\r\n r = ((args.size > 0) ? @object.send(m, *args) : @object.send(m))\r\n brb_send([ReturnCode, r, thread, idrequest])\r\n rescue Exception => e\r\n brb_send([ReturnCode, e, thread, idrequest])\r\n BrB.logger.error e.to_s\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n #raise e\r\n end\r\n else\r\n\r\n begin\r\n (args.size > 0) ? @object.send(meth, *args) : @object.send(meth)\r\n rescue Exception => e\r\n BrB.logger.error \"#{e.to_s} => By calling #{meth} on #{@object.class} with args : #{args.inspect}\"\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n raise e\r\n end\r\n\r\n end\r\n\r\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def block_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.block ...'\n end\n # resource path\n local_var_path = '/api/v1/block'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'seq'] = opts[:'seq'] if !opts[:'seq'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<BlockSchema>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#block\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def lb_get\n str = config_get('itd_service', 'load_balance', @get_args)\n return nil if str.nil?\n if str.include?('method') && str.include?('range')\n regexp = Regexp.new('load-balance *(?<bundle_select>method \\S+)?'\\\n ' *(?<bundle_hash>\\S+)?'\\\n ' *(?<proto>\\S+)?'\\\n ' *(?<start_port>range \\d+)?'\\\n ' *(?<end_port>\\d+)?'\\\n ' *(?<buckets>buckets \\d+)?'\\\n ' *(?<mask>mask-position \\d+)?')\n elsif str.include?('method')\n regexp = Regexp.new('load-balance *(?<bundle_select>method \\S+)?'\\\n ' *(?<bundle_hash>\\S+)?'\\\n ' *(?<buckets>buckets \\d+)?'\\\n ' *(?<mask>mask-position \\d+)?') unless str.include?('range')\n else\n regexp = Regexp.new('load-balance *(?<buckets>buckets \\d+)?'\\\n ' *(?<mask>mask-position \\d+)?')\n end\n regexp.match(str)\n end",
"def rest_endpoint; end",
"def private_get_address_book_get_with_http_info(currency, type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_get_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/private/get_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_get_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def adjust_params \n #if request is like this:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations\n if params[:action] == 'index'\n \n # If it is \n # GET /relations\n # Then we cannot sevice this request, must specify the entity.\n# if !params[:database_id] and !params[:entity_id]\n# render :text => 'GET /relations is not available', :status => 400\n# return false;\n# end\n\n # But in the remaining two cases:\n # * /entities/relations\n # * /databases/entities/relations\n # Allow the class\n return true;\n end\n \n # if it is:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations/\n # Becasue show needs to have an ID, therefore\n # any of the above URL will do and no context is needed.\n #FIXME: What other possibility the show action might face?\n if params[:action] == 'show'\n return true;\n end\n \n #If its like this:\n # POST /relations\n # POST /entities/relations\n # POST /databases/entities/relations\n # NOTE: For now, the relation resource should be totally complete\n # even if the call is being as a nested resource.\n #\n if params[:action] == 'create'\n \n #if it is like this:\n # POST /relations\n # Then the relations resource should be complete in\n # every respect.\n if !params[:database_id] and !params[:entity_id]\n #return true if valid_relation_resource?\n # Otherwise, the resource is not vaild and we need to tell the user\n #render :json => report_errors(nil, 'The provided realtion resource is incomplete')[0], \n # :status => 400 and return false;\n end\n \n # But if its something like this:\n # POST /entities/:entity_id/relations\n # POST /databases/entities/:entity_id/relations\n #\n if params[:database_id] or params[:entity_id]\n # Then if the relation resource is valid, \n # the entity_id parameter is altogather ignored.\n #return true if valid_relation_resource? \n end\n return true\n end\n \n # if its either of these:\n # PUT /relations\n # PUT /entities/relations\n # PUT /databases/entities/relations\n #\n if params[:action] == 'update'\n # Set the params[:relation_id] because\n # the underlying Admin::EntitiesController#add_link function\n # expects it\n params[:relation_id] = params[:id] and return true;\n end\n \n # If it is either of these:\n # DELETE /relations\n # DELETE /entities/relations\n # DELETE /databases/entities/relations\n #\n if params[:action] == 'destroy'\n \n # For now, you can only make a nested call.\n #PENDING: This would change when the rest call would include the user\n # authenticiy information which would help to determine whether the \n # relation being deleted belongs to the user or not.\n if !params[:entity_id]\n render :json => report_errors(nil, 'DELETE /relations call is not available for now. Call DELETE /entities/relations instead')[0],\n :status => 400 and return false\n end\n \n params[:source_id] = params[:entity_id]\n return true;\n \n end\n \n # In all cases, the request is not handled by this controller!\n render :json => report_errors(nil, \"The requested action is \\\"#{params[:action]}\\\" \" + \n \" on controller \\\"#{params[:controller]}\\\" while I am\" + \n \" \\\"#{self.class.name}\\\" and cannot handle your request.\")[0],:status => 400 and return false;\n \n end",
"def http_request_params\n params.require(:http_request).permit(:ip, :address)\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs)\n end",
"def method_missing(method_name, *args)\n payload = Kauplus::Client.authenticate_payload(args.first)\n if method_name.match(/(get|post|multipart_post|put|delete|head)_(.*)/)\n Kauplus::Client.send($1, \"#{@resource}/#{$2}\", payload)\n else\n Kauplus::Client.get(\"#{@resource}/#{method_name}\", payload)\n end\n end",
"def send_request(method, params, &block); end",
"def endpoint_params\n endpoint_data = params.require(:data).require(:attributes).permit(:verb, :path,\n { response: [:code, :body, { headers: {} }] })\n { path: endpoint_data[:path], verb: endpoint_data[:verb], response_code: endpoint_data[:response][:code],\n body: endpoint_data[:response][:body], headers: endpoint_data[:response][:headers] }\n end",
"def describe_load_balancers(ids = [], options = {})\n ids = [*ids]\n params = {}\n params['Marker'] = options[:marker] if options[:marker]\n params['PageSize'] = options[:page_size] if options[:page_size]\n params.merge!(Fog::AWS.serialize_keys('LoadBalancerArns', ids)) if ids.any?\n params.merge!(Fog::AWS.serialize_keys('Names', options[:names])) if options[:names]\n request({\n 'Action' => 'DescribeLoadBalancers',\n :parser => Fog::Parsers::AWS::ELBV2::DescribeLoadBalancers.new\n }.merge!(params))\n end",
"def region_params\n params.require(:region).permit(:name, :type)\n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def payment_methods_post_with_http_info(create_payment_method_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentMethodsApi.payment_methods_post ...'\n end\n # verify the required parameter 'create_payment_method_request' is set\n if @api_client.config.client_side_validation && create_payment_method_request.nil?\n fail ArgumentError, \"Missing the required parameter 'create_payment_method_request' when calling PaymentMethodsApi.payment_methods_post\"\n end\n # resource path\n local_var_path = '/payment-methods'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Trace-Id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?\n header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n header_params[:'End-User-Device-Id'] = opts[:'end_user_device_id'] if !opts[:'end_user_device_id'].nil?\n header_params[:'End-User-Ip'] = opts[:'end_user_ip'] if !opts[:'end_user_ip'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(create_payment_method_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PaymentMethod'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['BearerAuth']\n\n new_options = opts.merge(\n :operation => :\"PaymentMethodsApi.payment_methods_post\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentMethodsApi#payment_methods_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request(params)\n\n # Add auth header\n headers = params[:headers] || {}\n headers['x-vcloud-authorization'] = @auth_key if !@auth_key.nil? || !@auth_key.equal?('')\n\n # set connection options\n options = {:url => params[:url],\n :body => params[:body] || '',\n :expects => params[:expects] || 200,\n :headers => headers || {},\n :method => params[:method] || 'GET'\n }\n\n # connect\n res = RestClient::Request.execute options\n\n raise res if (res.code!=params[:expects] && res.code!=200)\n\n res\n\n\n end",
"def list_load_balancer_pools_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPoolListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#list_load_balancer_pools\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def url_field(object_name, method, options = T.unsafe(nil)); end",
"def request_params(params)\n headers = params[:headers] || {}\n\n if params[:scheme]\n scheme = params[:scheme]\n port = params[:port] || DEFAULT_SCHEME_PORT[scheme]\n else\n scheme = @scheme\n port = @port\n end\n if DEFAULT_SCHEME_PORT[scheme] == port\n port = nil\n end\n\n if params[:region]\n region = params[:region]\n host = params[:host] || region_to_host(region)\n else\n region = @region || DEFAULT_REGION\n host = params[:host] || @host || region_to_host(region)\n end\n\n path = params[:path] || object_to_path(params[:object_name])\n path = '/' + path if path[0..0] != '/'\n\n if params[:bucket_name]\n bucket_name = params[:bucket_name]\n\n if params[:bucket_cname]\n host = bucket_name\n else\n path_style = params.fetch(:path_style, @path_style)\n if !path_style\n if COMPLIANT_BUCKET_NAMES !~ bucket_name\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n elsif scheme == 'https' && !path_style && bucket_name =~ /\\./\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n end\n end\n\n # uses the bucket name as host if `virtual_host: true`, you can also\n # manually specify the cname if required.\n if params[:virtual_host]\n host = params.fetch(:cname, bucket_name)\n elsif path_style\n path = bucket_to_path bucket_name, path\n elsif host.start_with?(\"#{bucket_name}.\")\n # no-op\n else\n host = [bucket_name, host].join('.')\n end\n end\n end\n\n ret = params.merge({\n :scheme => scheme,\n :host => host,\n :port => port,\n :path => path,\n :headers => headers\n })\n\n #\n ret.delete(:path_style)\n ret.delete(:bucket_name)\n ret.delete(:object_name)\n ret.delete(:region)\n\n ret\n end",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def private_add_to_address_book_get_with_http_info(currency, type, address, name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_add_to_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling InternalApi.private_add_to_address_book_get\"\n end\n # resource path\n local_var_path = '/private/add_to_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n query_params[:'address'] = address\n query_params[:'name'] = name\n query_params[:'tfa'] = opts[:'tfa'] if !opts[:'tfa'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_add_to_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def request_method_symbol; end",
"def operations\n # Base URI works as-is.\n end",
"def request(*args, &block); end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def service_type_name\n \"REST\"\n end",
"def dispatcher\n endpoint_dispatch(params[:address])\n end",
"def update_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.update_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.update_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.update_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.update_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#update_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def bi_service\n end"
] | [
"0.6866154",
"0.6751546",
"0.66152465",
"0.6187423",
"0.6098222",
"0.6038154",
"0.5912855",
"0.5767288",
"0.56685144",
"0.56385946",
"0.56008303",
"0.5484754",
"0.54226196",
"0.5392469",
"0.53671664",
"0.5349883",
"0.5344752",
"0.5335411",
"0.5320632",
"0.5310211",
"0.5303687",
"0.5287981",
"0.5286541",
"0.5283146",
"0.5281928",
"0.52818954",
"0.52632225",
"0.52582085",
"0.52568936",
"0.5254872",
"0.5242317",
"0.5235137",
"0.5235137",
"0.5204746",
"0.52008206",
"0.52008206",
"0.52008206",
"0.52008206",
"0.51988435",
"0.5181548",
"0.51384836",
"0.5130613",
"0.5126222",
"0.51089483",
"0.5107018",
"0.510631",
"0.5088281",
"0.50849",
"0.5074833",
"0.50732964",
"0.5071285",
"0.5071285",
"0.5061589",
"0.50516427",
"0.50513387",
"0.5043786",
"0.50406784",
"0.5035623",
"0.5022131",
"0.50208926",
"0.5017628",
"0.5017628",
"0.49995986",
"0.49987334",
"0.4998543",
"0.49974388",
"0.49934536",
"0.497702",
"0.4958645",
"0.49582517",
"0.49579233",
"0.49564683",
"0.49527657",
"0.495087",
"0.49469703",
"0.4943146",
"0.4941203",
"0.49355215",
"0.49343857",
"0.49289367",
"0.49220085",
"0.4920377",
"0.49180454",
"0.49177325",
"0.4914816",
"0.49113306",
"0.49099335",
"0.49080494",
"0.4901515",
"0.48974702",
"0.48959777",
"0.48953778",
"0.48871148",
"0.48861688",
"0.48799485",
"0.4871607",
"0.48595947",
"0.485853",
"0.4845308",
"0.48441505"
] | 0.6372453 | 3 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: load_balancer_id, type: String name: load_balancer_status, type: String name: owner_account, type: String | def set_load_balancer_status(optional={})
args = self.class.new_params
args[:query]['Action'] = 'SetLoadBalancerStatus'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :load_balancer_status
args[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def services_web_application_name_servers_web_server_name_load_balancing_put_with_http_info(authorization, web_application_name, web_server_name, load_balancing, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # verify the required parameter 'load_balancing' is set\n if @api_client.config.client_side_validation && load_balancing.nil?\n fail ArgumentError, \"Missing the required parameter 'load_balancing' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_put\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(load_balancing)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def load_balancer_data(balancer = nil)\n params = Smash.new(\"Action\" => \"DescribeLoadBalancers\")\n if balancer\n params[\"LoadBalancerNames.member.1\"] = balancer.id || balancer.name\n end\n result = all_result_pages(nil, :body,\n \"DescribeLoadBalancersResponse\", \"DescribeLoadBalancersResult\",\n \"LoadBalancerDescriptions\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(params),\n )\n end\n if balancer\n health_result = all_result_pages(nil, :body,\n \"DescribeInstanceHealthResponse\", \"DescribeInstanceHealthResult\",\n \"InstanceStates\", \"member\") do |options|\n request(\n :method => :post,\n :path => \"/\",\n :form => options.merge(\n \"LoadBalancerName\" => balancer.id || balancer.name,\n \"Action\" => \"DescribeInstanceHealth\",\n ),\n )\n end\n end\n result.map do |blr|\n (balancer || Balancer.new(self)).load_data(\n Smash.new(\n :id => blr[\"LoadBalancerName\"],\n :name => blr[\"LoadBalancerName\"],\n :state => :active,\n :status => \"ACTIVE\",\n :created => blr[\"CreatedTime\"],\n :updated => blr[\"CreatedTime\"],\n :public_addresses => [\n Balancer::Address.new(\n :address => blr[\"DNSName\"],\n :version => 4,\n ),\n ],\n :servers => [blr.get(\"Instances\", \"member\")].flatten(1).compact.map { |i|\n Balancer::Server.new(self.api_for(:compute), :id => i[\"InstanceId\"])\n },\n ).merge(\n health_result.nil? ? {} : Smash.new(\n :server_states => health_result.nil? ? nil : health_result.map { |i|\n Balancer::ServerState.new(\n self.api_for(:compute),\n :id => i[\"InstanceId\"],\n :status => i[\"State\"],\n :reason => i[\"ReasonCode\"],\n :state => i[\"State\"] == \"InService\" ? :up : :down,\n )\n },\n )\n )\n ).valid_state\n end\n end",
"def create_load_balancer_pool_with_http_info(lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool ...'\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.create_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#create_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def describe_load_balancer_attribute(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def update_load_balancer_pool_with_http_info(pool_id, lb_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool ...'\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # verify the required parameter 'lb_pool' is set\n if @api_client.config.client_side_validation && lb_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_pool' when calling ManagementPlaneApiServicesLoadbalancerApi.update_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools/{pool-id}'.sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_pool)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#update_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def services_web_application_name_servers_web_server_name_load_balancing_get_with_http_info(authorization, web_application_name, web_server_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get ...\"\n end\n # verify the required parameter 'authorization' is set\n if @api_client.config.client_side_validation && authorization.nil?\n fail ArgumentError, \"Missing the required parameter 'authorization' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_application_name' is set\n if @api_client.config.client_side_validation && web_application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_application_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # verify the required parameter 'web_server_name' is set\n if @api_client.config.client_side_validation && web_server_name.nil?\n fail ArgumentError, \"Missing the required parameter 'web_server_name' when calling LoadBalancingApi.services_web_application_name_servers_web_server_name_load_balancing_get\"\n end\n # resource path\n local_var_path = \"/services/{Web Application Name}/servers/{Web Server Name}/load-balancing\".sub('{' + 'Web Application Name' + '}', web_application_name.to_s).sub('{' + 'Web Server Name' + '}', web_server_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'Authorization'] = authorization\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LoadBalancingApi#services_web_application_name_servers_web_server_name_load_balancing_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create name, type, attributes = {}\n\n attribute_list = []\n\n attributes.each do |attr_name,values|\n [values].flatten.each do |value|\n attribute_list << { \n :attribute_name => attr_name, \n :attribute_value => value.to_s \n }\n end\n end\n\n client.create_load_balancer_policy(\n :load_balancer_name => load_balancer.name,\n :policy_name => name.to_s,\n :policy_type_name => type.to_s,\n :policy_attributes => attribute_list)\n\n LoadBalancerPolicy.new(load_balancer, name, :type => type.to_s)\n\n end",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_params\n params.require(:balancer).permit(:name)\n end",
"def delete_load_balancer(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create\n @loadbalancer = Loadbalancer.new(params[:loadbalancer])\n @loadbalancer.account_id = @oeaccount.id\n respond_to do |format|\n if @loadbalancer.save\n format.html { redirect_to loadbalancers_url, notice: 'Loadbalancer was successfully created.' }\n format.json { render json: @loadbalancer, status: :created, location: @loadbalancer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @loadbalancer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def set_load_balancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def load_balancer # rubocop:disable AbcSize\n raise 'Can not determine hostname to load client for' if @new_resource.f5.nil?\n @@load_balancers ||= []\n add_lb(@new_resource.f5) if @@load_balancers.empty?\n add_lb(@new_resource.f5) if @@load_balancers.find { |lb| lb.name == @new_resource.f5 }.nil?\n @@load_balancers.find { |lb| lb.name == @new_resource.f5 }\n end",
"def request_parameters; end",
"def set_load_banancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBanancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def list_load_balancer_pools_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesLoadbalancerApi.list_load_balancer_pools, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/loadbalancer/pools'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPoolListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#list_load_balancer_pools\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def rest_endpoint=(_arg0); end",
"def describe_load_balancers(ids = [], options = {})\n ids = [*ids]\n params = {}\n params['Marker'] = options[:marker] if options[:marker]\n params['PageSize'] = options[:page_size] if options[:page_size]\n params.merge!(Fog::AWS.serialize_keys('LoadBalancerArns', ids)) if ids.any?\n params.merge!(Fog::AWS.serialize_keys('Names', options[:names])) if options[:names]\n request({\n 'Action' => 'DescribeLoadBalancers',\n :parser => Fog::Parsers::AWS::ELBV2::DescribeLoadBalancers.new\n }.merge!(params))\n end",
"def http=(_arg0); end",
"def allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs)\n end",
"def lb_get\n str = config_get('itd_service', 'load_balance', @get_args)\n return nil if str.nil?\n if str.include?('method') && str.include?('range')\n regexp = Regexp.new('load-balance *(?<bundle_select>method \\S+)?'\\\n ' *(?<bundle_hash>\\S+)?'\\\n ' *(?<proto>\\S+)?'\\\n ' *(?<start_port>range \\d+)?'\\\n ' *(?<end_port>\\d+)?'\\\n ' *(?<buckets>buckets \\d+)?'\\\n ' *(?<mask>mask-position \\d+)?')\n elsif str.include?('method')\n regexp = Regexp.new('load-balance *(?<bundle_select>method \\S+)?'\\\n ' *(?<bundle_hash>\\S+)?'\\\n ' *(?<buckets>buckets \\d+)?'\\\n ' *(?<mask>mask-position \\d+)?') unless str.include?('range')\n else\n regexp = Regexp.new('load-balance *(?<buckets>buckets \\d+)?'\\\n ' *(?<mask>mask-position \\d+)?')\n end\n regexp.match(str)\n end",
"def request_params; end",
"def patch_lb_service_0_with_http_info(lb_service_id, lb_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.patch_lb_service_0 ...'\n end\n # verify the required parameter 'lb_service_id' is set\n if @api_client.config.client_side_validation && lb_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service_id' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.patch_lb_service_0\"\n end\n # verify the required parameter 'lb_service' is set\n if @api_client.config.client_side_validation && lb_service.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.patch_lb_service_0\"\n end\n # resource path\n local_var_path = '/infra/lb-services/{lb-service-id}'.sub('{' + 'lb-service-id' + '}', lb_service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi#patch_lb_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def populate\n response = @connection.lbreq(\"GET\",@lbmgmthost,\"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n data = JSON.parse(response.body)['loadBalancer']\n @id = data[\"id\"]\n @name = data[\"name\"]\n @protocol = data[\"protocol\"]\n @port = data[\"port\"]\n @algorithm = data[\"algorithm\"]\n @connection_logging = data[\"connectionLogging\"][\"enabled\"]\n @status = data[\"status\"]\n @timeout = data[\"timeout\"]\n true\n end",
"def http_options; end",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def status_params\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def balance_post_with_http_info(addrs, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.balance_post ...'\n end\n # verify the required parameter 'addrs' is set\n if @api_client.config.client_side_validation && addrs.nil?\n fail ArgumentError, \"Missing the required parameter 'addrs' when calling DefaultApi.balance_post\"\n end\n # resource path\n local_var_path = '/api/v1/balance'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = addrs\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#balance_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update_lb_service_0_with_http_info(lb_service_id, lb_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.update_lb_service_0 ...'\n end\n # verify the required parameter 'lb_service_id' is set\n if @api_client.config.client_side_validation && lb_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service_id' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.update_lb_service_0\"\n end\n # verify the required parameter 'lb_service' is set\n if @api_client.config.client_side_validation && lb_service.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.update_lb_service_0\"\n end\n # resource path\n local_var_path = '/infra/lb-services/{lb-service-id}'.sub('{' + 'lb-service-id' + '}', lb_service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LBService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi#update_lb_service_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_balance (opts={})\n query_param_keys = []\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n \n }.merge(opts)\n\n #resource path\n path = \"/get-balance.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"def http_options=(_arg0); end",
"def http; end",
"def patch_lb_service_with_http_info(lb_service_id, lb_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.patch_lb_service ...'\n end\n # verify the required parameter 'lb_service_id' is set\n if @api_client.config.client_side_validation && lb_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service_id' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.patch_lb_service\"\n end\n # verify the required parameter 'lb_service' is set\n if @api_client.config.client_side_validation && lb_service.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.patch_lb_service\"\n end\n # resource path\n local_var_path = '/global-infra/lb-services/{lb-service-id}'.sub('{' + 'lb-service-id' + '}', lb_service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi#patch_lb_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def ready_load_balancer(action_handler, lb_spec, lb_options, machine_specs)\n end",
"def new_brb_in_request(meth, *args)\r\n\r\n if is_brb_request_blocking?(meth)\r\n\r\n m = meth.to_s\r\n m = m[0, m.size - 6].to_sym\r\n\r\n idrequest = args.pop\r\n thread = args.pop\r\n begin\r\n r = ((args.size > 0) ? @object.send(m, *args) : @object.send(m))\r\n brb_send([ReturnCode, r, thread, idrequest])\r\n rescue Exception => e\r\n brb_send([ReturnCode, e, thread, idrequest])\r\n BrB.logger.error e.to_s\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n #raise e\r\n end\r\n else\r\n\r\n begin\r\n (args.size > 0) ? @object.send(meth, *args) : @object.send(meth)\r\n rescue Exception => e\r\n BrB.logger.error \"#{e.to_s} => By calling #{meth} on #{@object.class} with args : #{args.inspect}\"\r\n BrB.logger.error e.backtrace.join(\"\\n\")\r\n raise e\r\n end\r\n\r\n end\r\n\r\n end",
"def read_load_balancer_pool_with_http_info(pool_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesLoadbalancerApi.read_load_balancer_pool ...'\n end\n # verify the required parameter 'pool_id' is set\n if @api_client.config.client_side_validation && pool_id.nil?\n fail ArgumentError, \"Missing the required parameter 'pool_id' when calling ManagementPlaneApiServicesLoadbalancerApi.read_load_balancer_pool\"\n end\n # resource path\n local_var_path = '/loadbalancer/pools/{pool-id}'.sub('{' + 'pool-id' + '}', pool_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LbPool')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesLoadbalancerApi#read_load_balancer_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n respond_to do |format|\n if @loadbalancer.update_attributes(params[:loadbalancer])\n format.html { redirect_to @loadbalancer, notice: 'Loadbalancer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @loadbalancer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_lb_service_with_http_info(lb_service_id, lb_service, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.update_lb_service ...'\n end\n # verify the required parameter 'lb_service_id' is set\n if @api_client.config.client_side_validation && lb_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service_id' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.update_lb_service\"\n end\n # verify the required parameter 'lb_service' is set\n if @api_client.config.client_side_validation && lb_service.nil?\n fail ArgumentError, \"Missing the required parameter 'lb_service' when calling PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi.update_lb_service\"\n end\n # resource path\n local_var_path = '/global-infra/lb-services/{lb-service-id}'.sub('{' + 'lb-service-id' + '}', lb_service_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(lb_service)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LBService')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingNetworkServicesLoadBalancingLoadBalancerServicesApi#update_lb_service\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_method\n raise \"Implement in child class\"\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def private_get_address_book_get_with_http_info(currency, type, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_get_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_get_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/private/get_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_get_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_params\n {}\n end",
"def block_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.block ...'\n end\n # resource path\n local_var_path = '/api/v1/block'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'seq'] = opts[:'seq'] if !opts[:'seq'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<BlockSchema>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#block\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request_method; end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def operational_values\n\t\treturn super.merge(\n\t\t\turi: self.uri,\n\t\t\thttp_method: self.http_method,\n\t\t\texpected_status: self.expected_status,\n\t\t\tbody: self.body,\n\t\t\tbody_mimetype: self.body_mimetype\n\t\t)\n\tend",
"def service_endpoint; end",
"def service_endpoint; end",
"def valid_params_request?; end",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def rest_endpoint; end",
"def endpoints; end",
"def build_request(method); end",
"def method_missing(method, *params, &block)\n @endpoint_parts << method.to_s\n\n @endpoint_parts << params\n @endpoint_parts = @endpoint_parts.flatten!\n\n block&.call\n\n self || super\n end",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def new\n @loadbalancer = Loadbalancer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @loadbalancer }\n end\n end",
"def adjust_params \n #if request is like this:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations\n if params[:action] == 'index'\n \n # If it is \n # GET /relations\n # Then we cannot sevice this request, must specify the entity.\n# if !params[:database_id] and !params[:entity_id]\n# render :text => 'GET /relations is not available', :status => 400\n# return false;\n# end\n\n # But in the remaining two cases:\n # * /entities/relations\n # * /databases/entities/relations\n # Allow the class\n return true;\n end\n \n # if it is:\n # GET /relations\n # GET /entities/relations\n # GET /databases/entities/relations/\n # Becasue show needs to have an ID, therefore\n # any of the above URL will do and no context is needed.\n #FIXME: What other possibility the show action might face?\n if params[:action] == 'show'\n return true;\n end\n \n #If its like this:\n # POST /relations\n # POST /entities/relations\n # POST /databases/entities/relations\n # NOTE: For now, the relation resource should be totally complete\n # even if the call is being as a nested resource.\n #\n if params[:action] == 'create'\n \n #if it is like this:\n # POST /relations\n # Then the relations resource should be complete in\n # every respect.\n if !params[:database_id] and !params[:entity_id]\n #return true if valid_relation_resource?\n # Otherwise, the resource is not vaild and we need to tell the user\n #render :json => report_errors(nil, 'The provided realtion resource is incomplete')[0], \n # :status => 400 and return false;\n end\n \n # But if its something like this:\n # POST /entities/:entity_id/relations\n # POST /databases/entities/:entity_id/relations\n #\n if params[:database_id] or params[:entity_id]\n # Then if the relation resource is valid, \n # the entity_id parameter is altogather ignored.\n #return true if valid_relation_resource? \n end\n return true\n end\n \n # if its either of these:\n # PUT /relations\n # PUT /entities/relations\n # PUT /databases/entities/relations\n #\n if params[:action] == 'update'\n # Set the params[:relation_id] because\n # the underlying Admin::EntitiesController#add_link function\n # expects it\n params[:relation_id] = params[:id] and return true;\n end\n \n # If it is either of these:\n # DELETE /relations\n # DELETE /entities/relations\n # DELETE /databases/entities/relations\n #\n if params[:action] == 'destroy'\n \n # For now, you can only make a nested call.\n #PENDING: This would change when the rest call would include the user\n # authenticiy information which would help to determine whether the \n # relation being deleted belongs to the user or not.\n if !params[:entity_id]\n render :json => report_errors(nil, 'DELETE /relations call is not available for now. Call DELETE /entities/relations instead')[0],\n :status => 400 and return false\n end\n \n params[:source_id] = params[:entity_id]\n return true;\n \n end\n \n # In all cases, the request is not handled by this controller!\n render :json => report_errors(nil, \"The requested action is \\\"#{params[:action]}\\\" \" + \n \" on controller \\\"#{params[:controller]}\\\" while I am\" + \n \" \\\"#{self.class.name}\\\" and cannot handle your request.\")[0],:status => 400 and return false;\n \n end",
"def update!(**args)\n @backend_type = args[:backend_type] if args.key?(:backend_type)\n @backend_uri = args[:backend_uri] if args.key?(:backend_uri)\n @backends = args[:backends] if args.key?(:backends)\n @health_check_uri = args[:health_check_uri] if args.key?(:health_check_uri)\n @load_balancer_type = args[:load_balancer_type] if args.key?(:load_balancer_type)\n end",
"def method_missing(name, *args, &_block)\n # Capture the version\n if name.to_s == 'version'\n @version = args[0]\n return _\n end\n # We have reached the end of the method chain, make the API call\n return build_request(name, args) if @methods.include?(name.to_s)\n\n # Add a segment to the URL\n _(name)\n end",
"def operations\n # Base URI works as-is.\n end",
"def balance_get_with_http_info(addrs, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.balance_get ...'\n end\n # verify the required parameter 'addrs' is set\n if @api_client.config.client_side_validation && addrs.nil?\n fail ArgumentError, \"Missing the required parameter 'addrs' when calling DefaultApi.balance_get\"\n end\n # resource path\n local_var_path = '/api/v1/balance'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = addrs\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#balance_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def request(endpoint, request, &block); end",
"def service_type_name\n \"REST\"\n end",
"def request(params)\n\n # Add auth header\n headers = params[:headers] || {}\n headers['x-vcloud-authorization'] = @auth_key if !@auth_key.nil? || !@auth_key.equal?('')\n\n # set connection options\n options = {:url => params[:url],\n :body => params[:body] || '',\n :expects => params[:expects] || 200,\n :headers => headers || {},\n :method => params[:method] || 'GET'\n }\n\n # connect\n res = RestClient::Request.execute options\n\n raise res if (res.code!=params[:expects] && res.code!=200)\n\n res\n\n\n end",
"def request(*args); end",
"def load_balancer_check_params\n params.require(:load_balancer_check).permit(:name, :passed, :ticket)\n end",
"def get_realization_state_barrier_config_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiRealizationApi.get_realization_state_barrier_config ...'\n end\n # resource path\n local_var_path = '/realization-state-barrier/config'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'RealizationStateBarrierConfig')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiRealizationApi#get_realization_state_barrier_config\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def private_add_to_address_book_get_with_http_info(currency, type, address, name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InternalApi.private_add_to_address_book_get ...'\n end\n # verify the required parameter 'currency' is set\n if @api_client.config.client_side_validation && currency.nil?\n fail ArgumentError, \"Missing the required parameter 'currency' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"BTC\", \"ETH\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(currency)\n fail ArgumentError, \"invalid value for \\\"currency\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'type' is set\n if @api_client.config.client_side_validation && type.nil?\n fail ArgumentError, \"Missing the required parameter 'type' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify enum value\n allowable_values = [\"transfer\", \"withdrawal\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling InternalApi.private_add_to_address_book_get\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling InternalApi.private_add_to_address_book_get\"\n end\n # resource path\n local_var_path = '/private/add_to_address_book'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'currency'] = currency\n query_params[:'type'] = type\n query_params[:'address'] = address\n query_params[:'name'] = name\n query_params[:'tfa'] = opts[:'tfa'] if !opts[:'tfa'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InternalApi#private_add_to_address_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def bi_service\n end"
] | [
"0.6909721",
"0.6828887",
"0.67474425",
"0.6447085",
"0.63585633",
"0.620061",
"0.59820795",
"0.59377414",
"0.5841316",
"0.5826932",
"0.57243174",
"0.5650492",
"0.5558808",
"0.5551457",
"0.54907346",
"0.5480091",
"0.545946",
"0.54384315",
"0.5415502",
"0.54100215",
"0.54038006",
"0.5403653",
"0.53935087",
"0.53831905",
"0.5356136",
"0.53375924",
"0.5311681",
"0.5252973",
"0.5237453",
"0.5203355",
"0.5189104",
"0.51876456",
"0.51849365",
"0.51832247",
"0.5181065",
"0.51779324",
"0.5177217",
"0.51590675",
"0.515221",
"0.51492435",
"0.5135795",
"0.51342654",
"0.5133859",
"0.51294845",
"0.5113241",
"0.5109246",
"0.5104347",
"0.5091758",
"0.5087574",
"0.5087574",
"0.507696",
"0.507696",
"0.507696",
"0.507696",
"0.5075167",
"0.50637144",
"0.50593257",
"0.50504637",
"0.50455815",
"0.50429076",
"0.5040747",
"0.502007",
"0.5015555",
"0.50133735",
"0.49839735",
"0.4962824",
"0.4961141",
"0.4959478",
"0.49555516",
"0.49497044",
"0.4948185",
"0.49472877",
"0.49351397",
"0.4929459",
"0.4929459",
"0.4924991",
"0.49204165",
"0.49104878",
"0.49068373",
"0.49051568",
"0.489922",
"0.48897052",
"0.48892263",
"0.48885968",
"0.48843402",
"0.48811144",
"0.48809043",
"0.48760608",
"0.48751545",
"0.48686007",
"0.48663804",
"0.48612186",
"0.48609987",
"0.4856229",
"0.48548377",
"0.48541802",
"0.48538858",
"0.48505837",
"0.48498693",
"0.48420486"
] | 0.65761095 | 3 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: connect_port, type: Integer name: connect_timeout, type: Integer name: health_check, type: String name: healthy_threshold, type: Integer, min value: 1, max value: 10 name: host_id, type: String name: interval, type: Integer name: listener_port, type: Integer name: load_balancer_id, type: String name: owner_account, type: String name: persistence_timeout, type: Integer name: scheduler, type: String name: unhealthy_threshold, type: Integer, min value: 1, max value: 10 | def set_load_balancer_t_c_p_listener_attribute(optional={})
args = self.class.new_params
args[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :connect_port
args[:query]['ConnectPort'] = optional[:connect_port]
end
if optional.key? :connect_timeout
args[:query]['ConnectTimeout'] = optional[:connect_timeout]
end
if optional.key? :health_check
args[:query]['HealthCheck'] = optional[:health_check]
end
if optional.key? :healthy_threshold
raise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1
raise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10
args[:query]['HealthyThreshold'] = optional[:healthy_threshold]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :interval
args[:query]['Interval'] = optional[:interval]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
if optional.key? :persistence_timeout
args[:query]['PersistenceTimeout'] = optional[:persistence_timeout]
end
if optional.key? :scheduler
args[:query]['Scheduler'] = optional[:scheduler]
end
if optional.key? :unhealthy_threshold
raise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1
raise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10
args[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def params\n {\n \"add-header\" => nil,\n \"burst-length\" => nil,\n \"client\" => nil,\n \"close-with-reset\" => nil,\n \"debug\" => nil,\n \"failure-status\" => nil,\n \"hog\" => nil,\n \"http-version\" => nil,\n \"max-connections\" => nil,\n \"max-piped-calls\" => nil,\n \"method\" => nil,\n \"no-host-hdr\" => nil,\n \"num-calls\" => nil,\n \"num-conns\" => nil,\n \"period\" => nil,\n \"port\" => nil,\n \"print-reply\" => nil,\n \"print-request\" => nil,\n \"rate\" => nil,\n \"recv-buffer\" => nil,\n \"retry-on-failure\" => nil,\n \"send-buffer\" => nil,\n \"server\" => nil,\n \"server-name\" => nil,\n \"session-cookies\" => nil,\n \"ssl\" => nil,\n \"ssl-ciphers\" => nil,\n \"ssl-no-reuse\" => nil,\n \"think-timeout\" => nil,\n \"timeout\" => nil,\n \"uri\" => nil,\n \"verbose\" => nil,\n \"version\" => nil,\n \"wlog\" => nil,\n \"wsess\" => nil,\n \"wsesslog\" => nil,\n \"wset\" => nil\n }\n end",
"def http_options; end",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def unboundRequest(params)\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n\n resources = []\n\n h1 = Hash.new\n h2 = Hash.new\n\n # puts Time.zone.now\n\n if params[:start_date] != \"\"\n valid_from = params[:start_date] + \":00 \"\n valid_from = Time.zone.parse(valid_from)\n else\n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n time_from = roundTimeUp(time_now)\n valid_from = Time.zone.now.to_s.split(\" \")[0] + \" \" +time_from+ \":00 \"\n valid_from = Time.zone.parse(valid_from)\n end\n\n #For nodes\n if params[:number_of_nodes] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Node\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_nodes].to_i.times {resources << h1}\n\n end\n\n #For channels\n if params[:number_of_channels] != \"\"\n if params[:duration_t1] != \"\"\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, duration: params[:duration_t1].to_i, valid_from: valid_from}\n end\n else\n if params[:domain1] != \"\"\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from, domain: params[:domain1]}\n else\n h1 = { type: \"Channel\", exclusive: true, valid_from: valid_from}\n end\n end \n\n params[:number_of_channels].to_i.times {resources << h1}\n\n end\n\n options = {body: {\n resources: resources\n }.to_json, :headers => { 'Content-Type' => 'application/json' } , :verify => false}\n response = HTTParty.get(broker_url+\"/resources\", options)\n\n puts options\n\n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response\n flash[:danger] = response\n else \n puts response\n response[\"resource_response\"][\"resources\"].each do |element|\n element[\"valid_from\"] = Time.zone.parse(element[\"valid_from\"]).to_s\n element[\"valid_until\"] = Time.zone.parse(element[\"valid_until\"]).to_s\n end\n\n return response\n end\n end",
"def request_parameters; end",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def to_http_health_params\n {\n port: http_health_port,\n path: http_health_path\n }\n end",
"def endpoints; end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def api(params = {})\n Celluloid::Logger.info \"Registering api...\"\n self.use_api = true\n self.api_host = params[:host] || '127.0.0.1'\n self.api_port = params[:port] || '4321'\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def http; end",
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def query_parameters; end",
"def service_endpoint; end",
"def service_endpoint; end",
"def rest_endpoint; end",
"def request_params; end",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_params\n {}\n end",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def initialize params = {}\n defaults = {\n :port => 80,\n :user_agent => 'Net::HTTP::RestClient'\n }\n if params[:port]==443 && !params[:ssl]\n defaults.merge! :ssl => {\n :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE\n } \n end\n @params = defaults.merge(params)\n @cookies = {}\n @headers = {}\n @params[:headers] && @headers=@params[:headers]\n @params[:cookies] && @cookies=@params[:cookies]\n end",
"def endpoint_options\n {user: @username,\n pass: @password,\n host: @host,\n port: @port,\n operation_timeout: @timeout_in_seconds,\n no_ssl_peer_verification: true,\n disable_sspi: true}\n end",
"def rest_endpoint=(_arg0); end",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def connection_params(host, port)\n \n params = {}\n \n if !host.nil?\n params[:host] = host\n elsif !Nagios::Connection.instance.host.nil?\n params[:host] = Nagios::Connection.instance.host\n else\n raise ArgumentError, \"You must provide a Nagios host or use Nagios::Connection\"\n end\n\n if !port.nil?\n params[:port] = port\n elsif !Nagios::Connection.instance.port.nil?\n params[:port] = Nagios::Connection.instance.port\n else\n raise ArgumentError, \"You must provide a Nagios port or use Nagios::Connection\"\n end\n\n return params\n end",
"def turbot_api_parameters\n uri = URI.parse(host)\n\n {\n :host => uri.host,\n :port => uri.port,\n :scheme => uri.scheme,\n }\n end",
"def http_method\n METHODS[self[:method]]\n end",
"def http_connection_params\n params.require(:http_connection).permit(:toggl_api, :clockify_api, :harvest_account_id, :harvest_personal_access_token)\n end",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def http_options=(_arg0); end",
"def restconnection_params\n params.require(:restconnection).permit(:host, :appname, :appid, :description, :debug, :username, :password)\n end",
"def get_endpoint()\n end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def initialize(options)\n unless (@logger = options[:logger])\n raise ::ArgumentError, \"options[:logger] is required: #{@logger.inspect}\"\n end\n unless (@mode = options[:mode].to_s) && MODES.include?(@mode)\n raise ::ArgumentError, \"options[:mode] must be one of #{MODES.inspect}: #{@mode.inspect}\"\n end\n unless (@kind = options[:kind].to_s) && KINDS.include?(@kind)\n raise ::ArgumentError, \"options[:kind] must be one of #{KINDS.inspect}: #{@kind.inspect}\"\n end\n unless (@uri = options[:uri]) && @uri.respond_to?(:path)\n raise ::ArgumentError, \"options[:uri] must be a valid parsed URI: #{@uri.inspect}\"\n end\n unless (@verb = options[:verb]) && VERBS.include?(@verb)\n raise ::ArgumentError, \"options[:verb] must be one of #{VERBS.inspect}: #{@verb.inspect}\"\n end\n unless (@headers = options[:headers]).kind_of?(::Hash)\n raise ::ArgumentError, \"options[:headers] must be a hash: #{@headers.inspect}\"\n end\n unless (@route_data = options[:route_data]).kind_of?(::Hash)\n raise ::ArgumentError, \"options[:route_data] must be a hash: #{@route_data.inspect}\"\n end\n @http_status = options[:http_status]\n if @kind == 'response'\n @http_status = Integer(@http_status)\n elsif !@http_status.nil?\n raise ::ArgumentError, \"options[:http_status] is unexpected for #{@kind}.\"\n end\n unless (@variables = options[:variables]).kind_of?(::Hash)\n raise ::ArgumentError, \"options[:variables] must be a hash: #{@variables.inspect}\"\n end\n if (@effective_route_config = options[:effective_route_config]) && !@effective_route_config.kind_of?(::Hash)\n raise ::ArgumentError, \"options[:effective_route_config] is not a hash: #{@effective_route_config.inspect}\"\n end\n @body = options[:body] # not required\n\n # merge one or more wildcard configurations matching the current uri and\n # parameters.\n @headers = normalize_headers(@headers)\n @typenames_to_values = compute_typenames_to_values\n\n # effective route config may already have been computed for request\n # (on record) or not (on playback).\n @effective_route_config ||= compute_effective_route_config\n\n # apply the configuration by substituting for variables in the request and\n # by obfuscating wherever a variable name is nil.\n erck = @effective_route_config[@kind]\n case @mode\n when 'validate'\n # used to validate the fixtures before playback; no variable\n # substitution should be performed.\n else\n if effective_variables = erck && erck[VARIABLES_KEY]\n recursive_replace_variables(\n [@kind, VARIABLES_KEY],\n @typenames_to_values,\n effective_variables,\n erck[TRANSFORM_KEY])\n end\n end\n if logger.debug?\n logger.debug(\"#{@kind} effective_route_config = #{@effective_route_config[@kind].inspect}\")\n logger.debug(\"#{@kind} typenames_to_values = #{@typenames_to_values.inspect}\")\n end\n\n # recreate headers and body from data using variable substitutions and\n # obfuscations.\n @headers = @typenames_to_values[:header]\n @body = normalize_body(@headers, @typenames_to_values[:body] || @body)\n end",
"def update(options={})\n data = Hash.new\n data[:type] = options[:type].upcase if options[:type]\n data[:delay] = options[:delay] if options[:delay]\n data[:timeout] = options[:timeout] if options[:timeout]\n data['attemptsBeforeDeactivation'] = options[:attempts_before_deactivation] if options[:attempts_before_deactivation]\n data[:type].upcase! if data[:type]\n if ['HTTP','HTTPS'].include?(data[:type])\n data[:path] = options[:path] if options[:path]\n data['statusRegex'] = options[:status_regex] if options[:status_regex]\n data['bodyRegex'] = options[:body_regex] if options[:body_regex]\n end\n response = @connection.lbreq(\"PUT\",@lbmgmthost,\"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@load_balancer.id.to_s)}/healthmonitor\",@lbmgmtport,@lbmgmtscheme,{},data.to_json)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n populate\n true\n end",
"def method_request( method, params )\n #merge auth params into our request querystring\n querystring = @auth.merge( params.is_a?(Hash) ? params : {} )\n resp = self.class.get(\"/#{@data_type}/#{method.to_s}\",{:query => querystring})\n if resp['error'] \n raise RuntimeError, resp['error']['error_message'], caller[1..-1]\n end\n return resp\n end",
"def valid_params_request?; end",
"def conditions(host,port,verb,path,query)\n\t response=nil\n if path.include?(\"/blue/\") \n host=\"doom.zoom.com\"\n port=9141\n elsif port==9142\n host=\"doom2.zoom.com\"\n port=9141\n elsif path.match(/myregularexpression/)\n host=\"doom.zoom.com\"\n port=9134\n elsif port==443 and path.match(/myregularexpression/) and verb==\"POST\"\n host=\"doom.zoom.com\"\n port=9157\n\t #when adding autoresponses only the path and the verb can be used to select\t\n\t elsif path.include?(\"/cp/xala/\")\n\t\tresponse=[200, {'Content-Type' => 'application/json'}, \n\t\t { \n\t\t\tname: 'Peter Daily',\n\t\t\tcity: 'New York',\n\t\t\tisClient: false,\n\t\t\tcurrency: 'EUR',\n\t\t\tbalance: 4663\n\t\t }.to_json\n\t\t]\n\t #when adding autoresponses only the path and the verb can be used to select\t\n\t elsif path.include?(\"/cp/alabi/\")\n\t\tresponse=[200, {'Content-Type' => 'application/json'}, \n\t\t { \n\t\t\tname: 'Mario',\n\t\t\tcity: 'London',\n\t\t\tisClient: true,\n\t\t\tcurrency: 'EUR',\n\t\t\tbalance: 323\n\t\t }.to_json\n\t\t]\n end\n if !response.nil? #to use rack for autoresponses\n\t\thost=\"localhost\"\n\t\tport=9292\n\t end\n return host,port,verb,path,query,response\n \n end",
"def rest_api_params\n params.require(:rest_api).permit(:name, :request, :response, :method, :http_status_code, :webservice_id)\n end",
"def query_parameters\n end",
"def request_method; end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def http=(_arg0); end",
"def params() @param_types end",
"def initialize(host, username, password, port=443, sslcheck=false, timeout=8)\n @resturl = sprintf('https://%s:%d/rest', host, port)\n @rpcurl = sprintf('https://%s:%d/rpc', host, port)\n @timeout = timeout\n @sslcheck = sslcheck\n @username = Base64.strict_encode64(username)\n @password = Base64.strict_encode64(password)\n\n # Map the new naming convention against the old one\n #FIXME# Filtering json hash content can be done this way\n # h1 = {:a => 1, :b => 2, :c => 3, :d => 4}\n # h1.slice(:a, :b) # return {:a=>1, :b=>2}, but h1 is not changed\n # h2 = h1.slice!(:a, :b) # h1 = {:a=>1, :b=>2}, h2 = {:c => 3, :d => 4}\n @servicemapper = {\n 'ip_site_add' => ['ip_site_add', 'This service allows to add an IP address Space.'],\n 'ip_site_update' => ['ip_site_add', 'This service allows to update an IP address Space.'],\n 'ip_site_count' => ['ip_site_count', 'This service returns the number of IP address Spaces matching optional condition(s).'],\n 'ip_site_list' => ['ip_site_list', 'This service returns a list of IP address Spaces matching optional condition(s).'],\n 'ip_site_info' => ['ip_site_info', 'This service returns information about a specific IP address Space.'],\n 'ip_site_delete' => ['ip_site_delete', 'This service allows to delete a specific IP address Space.'],\n 'ip_subnet_add' => ['ip_subnet_add', 'This service allows to add an IPv4 Network of type Subnet or Block.'],\n 'ip_subnet_update' => ['ip_subnet_add', 'This service allows to update an IPv4 Network of type Subnet or Block.'],\n 'ip_subnet_count' => ['ip_block_subnet_count', 'This service returns the number of IPv4 Networks matching optional condition(s).'],\n 'ip_subnet_list' => ['ip_block_subnet_list', 'This service returns a list of IPv4 Networks matching optional condition(s).'],\n 'ip_subnet_info' => ['ip_block_subnet_info', 'This service returns information about a specific IPv4 Network.'],\n 'ip_subnet_delete' => ['ip_subnet_delete', 'This service allows to delete a specific IPv4 Network.'],\n 'ip_subnet_find_free' => ['ip_find_free_subnet', 'This service allows to retrieve a list of available IPv4 Networks matching optional condition(s).'],\n 'ip_subnet6_add' => ['ip6_subnet6_add', 'This service allows to add an IPv6 Network of type Subnet or Block.'],\n 'ip_subnet6_update' => ['ip6_subnet6_add', 'This service allows to update an IPv6 Network of type Subnet or Block.'],\n 'ip_subnet6_count' => ['ip6_block6_subnet6_count', 'This service returns the number of IPv6 Networks matching optional condition(s).'],\n 'ip_subnet6_list' => ['ip6_block6_subnet6_list', 'This service returns a list of IPv6 Networks matching optional condition(s).'],\n 'ip_subnet6_info' => ['ip6_block6_subnet6_info', 'This service returns information about a specific IPv6 Network.'],\n 'ip_subnet6_delete' => ['ip6_subnet6_delete', 'This service allows to delete a specific IPv6 Network.'],\n 'ip_subnet6_find_free' => ['ip6_find_free_subnet6', 'This service allows to retrieve a list of available IPv6 Networks matching optional condition(s).'],\n 'ip_pool_add' => ['ip_pool_add', 'This service allows to add an IPv4 Address Pool.'],\n 'ip_pool_update' => ['ip_pool_add', 'This service allows to update an IPv4 Address Pool.'],\n 'ip_pool_count' => ['ip_pool_count', 'This service returns the number of IPv4 Address Pools matching optional condition(s).'],\n 'ip_pool_list' => ['ip_pool_list', 'This service returns a list of IPv4 Address Pools matching optional condition(s).'],\n 'ip_pool_info' => ['ip_pool_info', 'This service returns information about a specific IPv4 Address Pool.'],\n 'ip_pool_delete' => ['ip_pool_delete', 'This service allows to delete a specific IPv4 Address Pool.'],\n 'ip_pool6_add' => ['ip6_pool6_add', 'This service allows to add an IPv6 Address Pool.'],\n 'ip_pool6_update' => ['ip6_pool6_add', 'This service allows to update an IPv6 Address Pool.'],\n 'ip_pool6_count' => ['ip6_pool6_count', 'This service returns the number of IPv6 Address Pools matching optional condition(s).'],\n 'ip_pool6_list' => ['ip6_pool6_list', 'This service returns a list of IPv6 Address Pools matching optional condition(s).'],\n 'ip_pool6_info' => ['ip6_pool6_info', 'This service returns information about a specific IPv6 Address Pool.'],\n 'ip_pool6_delete' => ['ip6_pool6_delete', 'This service allows to delete a specific IPv6 Address Pool.'],\n 'ip_address_add' => ['ip_add', 'This service allows to add an IPv4 Address.'],\n 'ip_address_update' => ['ip_add', 'This service allows to update an IPv4 Address.'],\n 'ip_address_count' => ['ip_address_count', 'This service returns the number of IPv4 Addresses matching optional condition(s).'],\n 'ip_address_list' => ['ip_address_list', 'This service returns a list of IPv4 Addresses matching optional condition(s).'],\n 'ip_address_info' => ['ip_address_info', 'This service returns information about a specific IPv4 Address.'],\n 'ip_address_delete' => ['ip_delete', 'This service allows to delete a specific IPv4 Address.'],\n 'ip_address_find_free' => ['ip_find_free_address', 'This service allows to retrieve a list of available IPv4 Addresses matching optional condition(s).'],\n 'ip_address6_add' => ['ip6_address6_add', 'This service allows to add an IPv6 Address'],\n 'ip_address6_update' => ['ip6_address6_add', 'This service allows to update an IPv6 Address'],\n 'ip_address6_count' => ['ip6_address6_count', 'This service returns the number of IPv6 Addresses matching optional condition(s).'],\n 'ip_address6_list' => ['ip6_address6_list', 'This service returns a list of IPv6 Addresses matching optional condition(s).'],\n 'ip_address6_info' => ['ip6_address6_info', 'This service returns information about a specific IPv6 Address.'],\n 'ip_address6_delete' => ['ip6_address6_delete', 'This service allows to delete a specific IPv6 Address.'],\n 'ip_address6_find_free' => ['ip6_find_free_address6', 'This service allows to retrieve a list of available IPv6 Addresses matching optional condition(s).'],\n 'ip_alias_add' => ['ip_alias_add', 'This service allows to associate an Alias of type A or CNAME to an IPv4 Address.'],\n 'ip_alias_list' => ['ip_alias_list', 'This service returns the list of an IPv4 Address\\' associated Aliases.'],\n 'ip_alias_delete' => ['ip_alias_delete', 'This service allows to remove an Alias associated to an IPv4 Address.'],\n 'ip_alias6_add' => ['ip6_alias_add', 'This service allows to associate an Alias of type A or CNAME to an IPv4 Address.'],\n 'ip_alias6_list' => ['ip6_alias_list', 'This service returns the list of an IPv6 Address\\' associated Aliases.'],\n 'ip_alias6_delete' => ['ip6_alias_delete', 'This service allows to remove an Alias associated to an IPv6 Address.'],\n 'vlm_domain_add' => ['vlm_domain_add', 'This service allows to add a VLAN Domain.'],\n 'vlm_domain_update' => ['vlm_domain_add', 'This service allows to update a VLAN Domain.'],\n 'vlm_domain_count' => ['vlmdomain_count', 'This service returns the number of VLAN Domains matching optional condition(s).'],\n 'vlm_domain_list' => ['vlmdomain_list', 'This service returns a list of VLAN Domains matching optional condition(s).'],\n 'vlm_domain_info' => ['vlmdomain_info', 'This service returns information about a specific VLAN Domain.'],\n 'vlm_domain_delete' => ['vlm_domain_delete', 'This service allows to delete a specific VLAN Domain.'],\n 'vlm_range_add' => ['vlm_range_add', 'This service allows to add a VLAN Range.'],\n 'vlm_range_update' => ['vlm_range_add', 'This service allows to update a VLAN Range.'],\n 'vlm_range_count' => ['vlmrange_count', 'This service returns the number of VLAN Ranges matching optional condition(s).'],\n 'vlm_range_list' => ['vlmrange_list', 'This service returns a list of VLAN Domains matching optional condition(s).'],\n 'vlm_range_info' => ['vlmrange_info', 'This service returns information about a specific VLAN Range.'],\n 'vlm_range_delete' => ['vlm_range_delete', 'This service allows to delete a specific VLAN Range.'],\n 'vlm_vlan_add' => ['vlm_vlan_add', 'This service allows to add a VLAN.'],\n 'vlm_vlan_update' => ['vlm_vlan_add', 'This service allows to update a VLAN.'],\n 'vlm_vlan_count' => ['vlmvlan_count', 'This service returns the number of VLANs matching optional condition(s).'],\n 'vlm_vlan_list' => ['vlmvlan_list', 'This service returns a list of VLANs matching optional condition(s).'],\n 'vlm_vlan_info' => ['vlmvlan_info', 'This service returns information about a specific VLAN.'],\n 'vlm_vlan_delete' => ['vlm_vlan_delete', 'This service allows to delete a specific VLAN.']\n }\n end",
"def restclient_option_keys\n [:method, :url, :payload, :headers, :timeout, :open_timeout,\n :verify_ssl, :ssl_client_cert, :ssl_client_key, :ssl_ca_file]\n end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def endpoint\n raise NotImplementedError\n end",
"def operational_values\n\t\treturn super.merge(\n\t\t\turi: self.uri,\n\t\t\thttp_method: self.http_method,\n\t\t\texpected_status: self.expected_status,\n\t\t\tbody: self.body,\n\t\t\tbody_mimetype: self.body_mimetype\n\t\t)\n\tend",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def connection_options\n { :request => {\n :timeout => options[:timeout],\n :open_timeout => options[:timeout] },\n :proxy => options[:proxy_uri]\n }\n end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def resource_params\n raise NotImplementedError\n end",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def connection_type; end",
"def request_params\n rid = create_uuid\n request_type = params[:request_type]\n request_url = params[:url]\n request_parameters = params[:request_parameters]\n request_headers = params[:request_headers]\n request_payload = params[:request_payload]\n username = params[:username]\n password = params[:password]\n private_request = params[:private_request]\n\n request = Faraday.new\n\n # If authentication is filled out, apply it.\n request.basic_auth(username, password) if username.present?\n\n # Be nice and send a descriptive user agent. Also handy for debugging and\n # tracking down potential problems.\n request.headers['User-Agent'] = 'ReHTTP/v1.0'\n\n # Split the additional headers out into the name and value and then apply\n # then to the request.\n request_headers.split(\"\\r\\n\").each do |header|\n header_components = header.split(':')\n request.headers[header_components[0]] = header_components[1]\n end\n\n # Ensure the parameters are available before trying to create a new hash\n # from them.\n if request_parameters.present?\n request_params = Hash[request_parameters.split(\"\\r\\n\").map {|params| params.split('=') }]\n else\n request_params = {}\n end\n\n case request_type\n when 'GET'\n response = request.get(request_url, request_params)\n when 'POST'\n response = request.post(request_url, request_payload)\n when 'PUT'\n response = request.put(request_url, request_params)\n when 'DELETE'\n response = request.delete request_url\n when 'OPTIONS'\n response = request.options request_url\n when 'HEAD'\n response = request.head request_url\n when 'PATCH'\n response = request.patch request_url\n end\n\n {\n rid: rid,\n request_type: request_type,\n url: request_url,\n private_request: private_request,\n request_data: {\n headers: request.headers,\n data: {}\n }.to_json,\n response_data: {\n headers: response.headers,\n body: response.body,\n status: response.status\n }.to_json\n }\n end",
"def valid_request(h = {})\n h.merge!({:use_route => :sensit_api, :format => \"json\", :api_version => \"1\"})\n end",
"def http_statistics\n super\n end",
"def platform_endpoint; end",
"def initialize(params = {})\n @hostname = params[:hostname]\n @lang = params[:lang]\n @api_key = params[:api_key]\n @timeout = params[:timeout] || 5\n @api_key_in_params = params[:api_key_in_params]\n @enable_logging = params[:enable_logging] || ENV['ENABLE_LOGGING']\n end",
"def request(params)\n\n # Add auth header\n headers = params[:headers] || {}\n headers['x-vcloud-authorization'] = @auth_key if !@auth_key.nil? || !@auth_key.equal?('')\n\n # set connection options\n options = {:url => params[:url],\n :body => params[:body] || '',\n :expects => params[:expects] || 200,\n :headers => headers || {},\n :method => params[:method] || 'GET'\n }\n\n # connect\n res = RestClient::Request.execute options\n\n raise res if (res.code!=params[:expects] && res.code!=200)\n\n res\n\n\n end",
"def request_timeout(type, options); end",
"def params\n raise NotImplementedError\n end",
"def parameter_types; end",
"def initialize(name, url, params = {})\r\n @name, @url, @params = name, url, params\r\n end",
"def service_type_name\n \"REST\"\n end",
"def url_tester(method,schema,base_domain,page,query,expected_code,timeout,headers,https_verify,logger)\n\n uri = URI.join(\"#{schema}://#{base_domain}\",page)\n http = Net::HTTP.new(uri.host, uri.port)\n if schema == \"https\"\n http.use_ssl = true\n http.verify_mode = https_verify ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE\n end\n http.open_timeout = timeout\n\n # Catch errors and set http status codes manually\n begin\n request = Net::HTTP::Get.new(uri.request_uri)\n if !headers.empty?\n headers.each { |header|\n header_array = header.split(':', 2)\n logger.debug_message \"header_array: #{header_array}\"\n request.initialize_http_header({header_array[0] => header_array[1]})\n }\n end\n start_time = Time.now\n response = http.request(request)\n end_time = Time.now\n response_time = end_time - start_time\n return uri.to_s, response.code.to_i, response_time \n # Catch time outs and set code to HTTPGatewayTimeOut: 504.\n rescue Net::OpenTimeout\n return uri.to_s, 504\n end\nend",
"def connection_status_mcnet_request; end",
"def operations\n # Base URI works as-is.\n end",
"def base_params\n {\n v: PROTOCOL_VERSION,\n # Client ID\n cid: @user_id,\n # Tracking ID\n tid: TRACKING_ID,\n # Application Name\n an: APPLICATION_NAME,\n # Application Version\n av: Bolt::VERSION,\n # Anonymize IPs\n aip: true,\n # User locale\n ul: Locale.current.to_rfc,\n # Custom Dimension 1 (Operating System)\n cd1: @os\n }\n end",
"def http_timeout; end",
"def rest_call(url, method, options = {})\n methods = %w{get post put}\n result = {\"status\" => \"ERROR\", \"response\" => \"\", \"message\" => \"\"}\n method = method.downcase\n verbose = get_option(options, \"verbose\") == \"yes\" or get_option(options, \"verbose\")\n headers = get_option(options, \"headers\", {:accept => :json, :content_type => :json})\n return result[\"message\"] = \"ERROR - #{method} not recognized\" unless methods.include?(method)\n log \"Rest URL: #{url}\" if verbose\n begin\n data = get_option(options, \"data\")\n rest_params = {}\n rest_params[:url] = url\n rest_params[:method] = method.to_sym\n rest_params[:verify_ssl] = OpenSSL::SSL::VERIFY_NONE if url.start_with?(\"https\")\n rest_params[:payload] = data.to_json unless data == \"\"\n if options.has_key?(\"username\") && options.has_key?(\"password\")\n rest_params[:user] = options[\"username\"]\n rest_params[:password] = options[\"password\"]\n end\n rest_params[:headers] = headers\n log \"RestParams: #{rest_params.inspect}\" if verbose\n if %{put post}.include?(method)\n return result[\"message\"] = \"ERROR - no data param for post\" if data == \"\"\n response = RestClient::Request.new(rest_params).execute\n else\n response = RestClient::Request.new(rest_params).execute\n end\n rescue Exception => e\n result[\"message\"] = e.message\n raise \"RestError: #{result[\"message\"]}\" unless get_option(options, \"suppress_errors\") == true\n return result\n end\n log \"Rest Response:\\n#{response.inspect}\" if verbose\n if headers[:accept] == :json\n parsed_response = JSON.parse(response) rescue nil\n else\n parsed_response = response\n end\n parsed_response = {\"info\" => \"no data returned\"} if parsed_response.nil?\n result[\"code\"] = response.code\n if response.code < 300\n result[\"status\"] = \"success\"\n result[\"data\"] = parsed_response\n elsif response.code == 422\n result[\"message\"] = \"REST call returned code 422 usually a bad token\"\n else\n result[\"message\"] = \"REST call returned HTTP code #{response.code}\"\n end\n if result[\"status\"] == \"ERROR\"\n raise \"RestError: #{result[\"message\"]}\" unless get_option(options, \"suppress_errors\") == true\n end\n result\n end",
"def status_params\n end",
"def request_and_handle http_method, path, options\n if http_method.is_a?(String) || http_method.is_a?(Symbol)\n http_method = HTTP_METHODS[http_method.to_s]\n raise \"Unknown http method: #{http_method}\" unless http_method\n end\n \n req_options = default_options.dup\n req_options = req_options.merge(options)\n \n raise ConfigurationError.new \"No endpoint defined\" if !path || path.empty?\n raise ConfigurationError.new \"No hostname defined\" if !req_options[:base_uri] || req_options[:base_uri].empty?\n \n # prepare request\n req = HTTParty::Request.new http_method, path, req_options\n req.options[:timeout] = CityGrid.custom_timeout if req.options && CityGrid.custom_timeout_set?\n\n # Sanitized request for logs\n safe_req_options = strip_unsafe_params(http_method, req_options)\n req_to_output = HTTParty::Request.new http_method, path, safe_req_options\n req_for_airbrake = { :method => http_method, :path => path, :options => safe_req_options }\n\n begin\n response = req.perform\n rescue => ex \n if defined?(Rails.logger)\n Rails.logger.error safe_req_options\n Rails.logger.error req_to_output\n Rails.logger.error req_for_airbrake\n Rails.logger.error ex\n end\n raise CityGridExceptions::RequestError.new req_for_airbrake, nil, ex.message, req_to_output.to_curl\n ensure\n if CityGrid.print_curls? \n if defined?(Rails.logger)\n Rails.logger.info req_to_output.to_curl\n puts req_to_output.to_curl\n else\n puts req_to_output.to_curl\n end\n end\n end\n\n response_status = parse_response_status response\n \n begin \n # catch unparsable responses (html etc)\n if !response.parsed_response.is_a?(Hash)\n #pp \"[gem] the response was unparsable (response was not a hash)\"\n raise CityGridExceptions::ResponseParseError.new req_for_airbrake, response, \"the response was unparsable (response was not a hash)\", req_to_output.to_curl\n else\n # Parse and handle new response codes \n if !response_status.nil? && response_status[\"code\"] != \"SUCCESS\" && response_status[\"code\"] != 200\n raise CityGridExceptions.appropriate_error(response_status[\"code\"]).new req_for_airbrake, response, response_status[\"message\"].to_s, req_to_output.to_curl\n else\n return CityGrid::API::Response.new response\n end\n end\n rescue => ex\n pp \"API ERROR: #{ex}\"\n raise ex if CityGrid.raise_errors?\n end\n end",
"def initialize(method, uri, body: nil, headers: nil, opts: {})\n @tag = 0\n method = method.downcase.to_sym\n unless method == :get || method == :put || method == :post || method == :delete\n raise ArgumentError, \"Invalid method #{method} for request : '#{uri}'\"\n end\n self.method = method\n self.path = uri\n self.body = body\n self.headers = headers || {}\n self.opts = opts || {}\n end",
"def request(*args); end",
"def parameter_type; end",
"def parameter_type; end",
"def query_params; end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def update!(**args)\n @client_operation_id = args[:client_operation_id] if args.key?(:client_operation_id)\n @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)\n @description = args[:description] if args.key?(:description)\n @end_time = args[:end_time] if args.key?(:end_time)\n @error = args[:error] if args.key?(:error)\n @http_error_message = args[:http_error_message] if args.key?(:http_error_message)\n @http_error_status_code = args[:http_error_status_code] if args.key?(:http_error_status_code)\n @id = args[:id] if args.key?(:id)\n @insert_time = args[:insert_time] if args.key?(:insert_time)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @operation_type = args[:operation_type] if args.key?(:operation_type)\n @progress = args[:progress] if args.key?(:progress)\n @region = args[:region] if args.key?(:region)\n @self_link = args[:self_link] if args.key?(:self_link)\n @start_time = args[:start_time] if args.key?(:start_time)\n @status = args[:status] if args.key?(:status)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target_id = args[:target_id] if args.key?(:target_id)\n @target_link = args[:target_link] if args.key?(:target_link)\n @user = args[:user] if args.key?(:user)\n @warnings = args[:warnings] if args.key?(:warnings)\n @zone = args[:zone] if args.key?(:zone)\n end",
"def url_options; end",
"def rest_send( url, method, payload )\n begin\n response = RestClient::Request.execute( method: method,\n url: URI.escape( url ),\n payload: payload,\n content_type: :json,\n accept: :json,\n timeout: self.timeout )\n\n if ok?( response.code ) && response.empty? == false && response != ' '\n return response.code, JSON.parse( response )\n end\n return response.code, {}\n rescue RestClient::BadRequest => ex\n log_error( method, url, nil, payload )\n return 400, {}\n rescue RestClient::ResourceNotFound => ex\n log_error( method, url, nil, payload )\n return 404, {}\n rescue RestClient::RequestTimeout => ex\n log_error( method, url, nil, payload )\n puts \"ERROR: request timeout: #{url}\"\n return 408, {}\n rescue RestClient::Exception, SocketError, Exception => ex\n log_error( method, url, ex, payload )\n return 500, {}\n end\n end",
"def request(method, url, payload, format)\n opts = {\n :method => method,\n :url => url,\n :payload => payload,\n :headers => {:content_type => CONTENT_TYPES[format]},\n :timeout => TIMEOUT,\n :open_timeout => OPEN_TIMEOUT\n }\n \n RestClient::Request.execute(opts)\n end",
"def type_params; end",
"def type_params; end"
] | [
"0.59732234",
"0.57500786",
"0.56919616",
"0.56631744",
"0.565759",
"0.565759",
"0.565759",
"0.565759",
"0.56524473",
"0.5647434",
"0.55865693",
"0.5535142",
"0.5500358",
"0.54681146",
"0.5435296",
"0.5419128",
"0.5416722",
"0.5416722",
"0.5413054",
"0.54054886",
"0.5401759",
"0.53989667",
"0.5373593",
"0.5373593",
"0.53652924",
"0.5355594",
"0.53529865",
"0.53521293",
"0.53116864",
"0.530629",
"0.53008187",
"0.526075",
"0.52606773",
"0.52604705",
"0.5235104",
"0.5225294",
"0.5223795",
"0.5223228",
"0.5188104",
"0.5187048",
"0.51836675",
"0.51836437",
"0.5179303",
"0.517629",
"0.51748437",
"0.5166985",
"0.51640934",
"0.5143975",
"0.5129656",
"0.5119479",
"0.5115162",
"0.5114875",
"0.5113223",
"0.5112669",
"0.5112209",
"0.5096947",
"0.5089919",
"0.50811666",
"0.5076763",
"0.50696844",
"0.50642556",
"0.50617987",
"0.5057274",
"0.5053631",
"0.5052996",
"0.5052234",
"0.5051887",
"0.5044122",
"0.5044043",
"0.50426906",
"0.50417024",
"0.50360096",
"0.5035469",
"0.503074",
"0.5030541",
"0.50281686",
"0.5026534",
"0.5014837",
"0.5014439",
"0.5010012",
"0.5005145",
"0.49994266",
"0.49980628",
"0.49937814",
"0.4988213",
"0.49857616",
"0.49833623",
"0.49798137",
"0.4977192",
"0.4965311",
"0.49603736",
"0.49603736",
"0.49596035",
"0.4956697",
"0.4956697",
"0.49529195",
"0.4951802",
"0.4950312",
"0.49450713",
"0.49450713"
] | 0.5206276 | 38 |
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: host_id, type: String name: listener_port, type: Integer name: listener_status, type: String name: load_balancer_id, type: String name: owner_account, type: String | def set_load_banancer_listener_status(optional={})
args = self.class.new_params
args[:query]['Action'] = 'SetLoadBanancerListenerStatus'
args[:region] = optional[:_region] if (optional.key? :_region)
if optional.key? :_method
raise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]
args[:method] = optional[:_method]
end
if optional.key? :_scheme
raise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]
args[:scheme] = optional[:_scheme]
end
if optional.key? :host_id
args[:query]['HostId'] = optional[:host_id]
end
if optional.key? :listener_port
args[:query]['ListenerPort'] = optional[:listener_port]
end
if optional.key? :listener_status
args[:query]['ListenerStatus'] = optional[:listener_status]
end
if optional.key? :load_balancer_id
args[:query]['LoadBalancerId'] = optional[:load_balancer_id]
end
if optional.key? :owner_account
args[:query]['OwnerAccount'] = optional[:owner_account]
end
self.run(args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_load_balancer_t_c_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backend_server_port\n\t\t\targs[:query]['BackendServerPort'] = optional[:backend_server_port]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_listener_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerListenerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :listener_status\n\t\t\targs[:query]['ListenerStatus'] = optional[:listener_status]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :domain\n\t\t\targs[:query]['Domain'] = optional[:domain]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session\n\t\t\targs[:query]['StickySession'] = optional[:sticky_session]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :u_r_i\n\t\t\targs[:query]['URI'] = optional[:u_r_i]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :connect_port\n\t\t\targs[:query]['ConnectPort'] = optional[:connect_port]\n\t\tend\n\t\tif optional.key? :connect_timeout\n\t\t\targs[:query]['ConnectTimeout'] = optional[:connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check\n\t\t\targs[:query]['HealthCheck'] = optional[:health_check]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :interval\n\t\t\targs[:query]['Interval'] = optional[:interval]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless optional[:bandwidth] < -1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_t_c_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerTCPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :is_public_address\n\t\t\targs[:query]['IsPublicAddress'] = optional[:is_public_address]\n\t\tend\n\t\tif optional.key? :load_balancer_mode\n\t\t\targs[:query]['LoadBalancerMode'] = optional[:load_balancer_mode]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def start_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StartLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_t_c_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_type\n\t\t\targs[:query]['HealthCheckType'] = optional[:health_check_type]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :syn_proxy\n\t\t\targs[:query]['SynProxy'] = optional[:syn_proxy]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer_u_d_p_listener(backend_server_port, bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerUDPListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['healthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_status\n\t\t\targs[:query]['LoadBalancerStatus'] = optional[:load_balancer_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :load_balancer_name\n\t\t\targs[:query]['LoadBalancerName'] = optional[:load_balancer_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :address\n\t\t\targs[:query]['Address'] = optional[:address]\n\t\tend\n\t\tif optional.key? :address_type\n\t\t\targs[:query]['AddressType'] = optional[:address_type]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def endpoint; end",
"def http_method(v)\n endpoint_info[:http_method] = v\n end",
"def describe_load_balancer_h_t_t_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def endpoint_params\n params.require(:data).permit(:type, {\n attributes: [:verb, :path, response: [:code, :body, headers: {}]]\n })\n end",
"def describe_load_balancer_t_c_p_listener_attribute(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_load_balancer_h_t_t_p_s_listener(backend_server_port, bandwidth, health_check, listener_port, load_balancer_id, server_certificate_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateLoadBalancerHTTPSListener'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'backend_server_port must be equal or greater than 1' unless backend_server_port < 1\n\t\traise ArgumentError, 'backend_server_port must be equal or less than 65535' unless backend_server_port > 65535\n\t\targs[:query]['BackendServerPort'] = backend_server_port\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_name(load_balancer_id, load_balancer_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerName'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerName'] = load_balancer_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def delete_load_balancer_listener(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def rest_endpoint=(_arg0); end",
"def request_parameters; end",
"def stop_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StopLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http=(_arg0); end",
"def service_endpoint; end",
"def service_endpoint; end",
"def describe_load_balancers(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancers'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :server_id\n\t\t\targs[:query]['ServerId'] = optional[:server_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_h_t_t_p_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http; end",
"def set_load_balancer_u_d_p_listener_attribute(bandwidth, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerUDPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than 1' unless optional[:health_check_connect_port] < 1\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_connect_timeout\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or greater than 1' unless optional[:health_check_connect_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_connect_timeout must be equal or less than 50' unless optional[:health_check_connect_timeout] > 50\n\t\t\targs[:query]['HealthCheckConnectTimeout'] = optional[:health_check_connect_timeout]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :persistence_timeout\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or greater than 0' unless optional[:persistence_timeout] < 0\n\t\t\traise ArgumentError, 'persistence_timeout must be equal or less than 86400' unless optional[:persistence_timeout] > 86400\n\t\t\targs[:query]['PersistenceTimeout'] = optional[:persistence_timeout]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_h_t_t_p_s_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_listener_access_control_status(access_control_status, listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['AccessControlStatus'] = access_control_status\n\t\targs[:query]['Action'] = 'SetListenerAccessControlStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def http_method(request)\n raise NotImplementedError\n end",
"def http_method(request)\n raise NotImplementedError\n end",
"def endpoints; end",
"def http_parse_args\n [(self.api.base_url + self.method), self.params]\n end",
"def service_request(service); end",
"def describe_health_status(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeHealthStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :listener_port\n\t\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless optional[:listener_port] < 1\n\t\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless optional[:listener_port] > 65535\n\t\t\targs[:query]['ListenerPort'] = optional[:listener_port]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request_params; end",
"def delete_load_balancer_listener(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancerListener'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def describe_load_balancer_t_c_p_listener_attribute(listener_port, load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeLoadBalancerTCPListenerAttribute'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def set_load_balancer_h_t_t_p_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def create_load_balancer_listeners(lb_name, listeners)\n params = {}\n\n listener_protocol = []\n listener_lb_port = []\n listener_instance_port = []\n listener_instance_protocol = []\n listener_ssl_certificate_id = []\n listeners.each do |listener|\n listener_protocol.push(listener['Protocol'])\n listener_lb_port.push(listener['LoadBalancerPort'])\n listener_instance_port.push(listener['InstancePort'])\n listener_instance_protocol.push(listener['InstanceProtocol'])\n listener_ssl_certificate_id.push(listener['SSLCertificateId'])\n end\n\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.Protocol', listener_protocol))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.LoadBalancerPort', listener_lb_port))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.InstancePort', listener_instance_port))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.InstanceProtocol', listener_instance_protocol))\n params.merge!(Fog::AWS.indexed_param('Listeners.member.%d.SSLCertificateId', listener_ssl_certificate_id))\n\n request({\n 'Action' => 'CreateLoadBalancerListeners',\n 'LoadBalancerName' => lb_name,\n :parser => Fog::Parsers::AWS::ELB::Empty.new\n }.merge!(params))\n end",
"def request_method; end",
"def set_load_balancer_h_t_t_p_s_listener_attribute(bandwidth, health_check, listener_port, load_balancer_id, sticky_session, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerHTTPSListenerAttribute'\n\t\targs[:query]['HealthCheck'] = health_check\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['StickySession'] = sticky_session\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :cookie\n\t\t\targs[:query]['Cookie'] = optional[:cookie]\n\t\tend\n\t\tif optional.key? :cookie_timeout\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or greater than 1' unless optional[:cookie_timeout] < 1\n\t\t\traise ArgumentError, 'cookie_timeout must be equal or less than 86400' unless optional[:cookie_timeout] > 86400\n\t\t\targs[:query]['CookieTimeout'] = optional[:cookie_timeout]\n\t\tend\n\t\tif optional.key? :health_check_connect_port\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or greater than -520' unless optional[:health_check_connect_port] < -520\n\t\t\traise ArgumentError, 'health_check_connect_port must be equal or less than 65535' unless optional[:health_check_connect_port] > 65535\n\t\t\targs[:query]['HealthCheckConnectPort'] = optional[:health_check_connect_port]\n\t\tend\n\t\tif optional.key? :health_check_domain\n\t\t\targs[:query]['HealthCheckDomain'] = optional[:health_check_domain]\n\t\tend\n\t\tif optional.key? :health_check_http_code\n\t\t\targs[:query]['HealthCheckHttpCode'] = optional[:health_check_http_code]\n\t\tend\n\t\tif optional.key? :health_check_interval\n\t\t\traise ArgumentError, 'health_check_interval must be equal or greater than 1' unless optional[:health_check_interval] < 1\n\t\t\traise ArgumentError, 'health_check_interval must be equal or less than 5' unless optional[:health_check_interval] > 5\n\t\t\targs[:query]['HealthCheckInterval'] = optional[:health_check_interval]\n\t\tend\n\t\tif optional.key? :health_check_timeout\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or greater than 1' unless optional[:health_check_timeout] < 1\n\t\t\traise ArgumentError, 'health_check_timeout must be equal or less than 50' unless optional[:health_check_timeout] > 50\n\t\t\targs[:query]['HealthCheckTimeout'] = optional[:health_check_timeout]\n\t\tend\n\t\tif optional.key? :health_check_u_r_i\n\t\t\targs[:query]['HealthCheckURI'] = optional[:health_check_u_r_i]\n\t\tend\n\t\tif optional.key? :healthy_threshold\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or greater than 1' unless optional[:healthy_threshold] < 1\n\t\t\traise ArgumentError, 'healthy_threshold must be equal or less than 10' unless optional[:healthy_threshold] > 10\n\t\t\targs[:query]['HealthyThreshold'] = optional[:healthy_threshold]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :scheduler\n\t\t\targs[:query]['Scheduler'] = optional[:scheduler]\n\t\tend\n\t\tif optional.key? :server_certificate_id\n\t\t\targs[:query]['ServerCertificateId'] = optional[:server_certificate_id]\n\t\tend\n\t\tif optional.key? :sticky_session_type\n\t\t\targs[:query]['StickySessionType'] = optional[:sticky_session_type]\n\t\tend\n\t\tif optional.key? :unhealthy_threshold\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or greater than 1' unless optional[:unhealthy_threshold] < 1\n\t\t\traise ArgumentError, 'unhealthy_threshold must be equal or less than 10' unless optional[:unhealthy_threshold] > 10\n\t\t\targs[:query]['UnhealthyThreshold'] = optional[:unhealthy_threshold]\n\t\tend\n\t\tif optional.key? :x_forwarded_for\n\t\t\targs[:query]['XForwardedFor'] = optional[:x_forwarded_for]\n\t\tend\n\t\traise ArgumentError, 'bandwidth must be equal or greater than -1' unless bandwidth < -1\n\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless bandwidth > 1000\n\t\targs[:query]['Bandwidth'] = bandwidth\n\t\traise ArgumentError, 'listener_port must be equal or greater than 1' unless listener_port < 1\n\t\traise ArgumentError, 'listener_port must be equal or less than 65535' unless listener_port > 65535\n\t\targs[:query]['ListenerPort'] = listener_port\n\t\tself.run(args)\n\tend",
"def request(*)\n raise 'HttpApiBuilder::BaseClient#request must be implemented, see documentation'\n end",
"def client(\n name,\n method: nil,\n url: nil,\n status_callback_event: nil,\n status_callback_method: nil,\n status_callback: nil,\n **keyword_args\n )\n append(Client.new(\n name,\n method: method,\n url: url,\n status_callback_event: status_callback_event,\n status_callback_method: status_callback_method,\n status_callback: status_callback,\n **keyword_args\n ))\n end",
"def request(*args); end",
"def listener_endpoint\n data[:listener_endpoint]\n end",
"def http_options; end",
"def set_load_balancer_status(load_balancer_id, load_balancer_status, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetLoadBalancerStatus'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:query]['LoadBalancerStatus'] = load_balancer_status\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def protocol; end",
"def protocol; end",
"def protocol; end",
"def protocol; end",
"def http_call(payload); end",
"def request(endpoint, request, &block); end",
"def method_missing(name)\n @listener_info[name.to_s]\n super\n end",
"def handle_request(socket, request_type, request_args)\n raise 'not implemented'\n end",
"def endpoint_params\n params.require(:endpoint).permit(:description, :method_type, :url, :detail, :resource_id, :project_id)\n end",
"def service_type_name\n \"REST\"\n end",
"def define_parameters #:nodoc:#\n @request_parameters = [:version, :method, :startdate, :enddate,\n :email, :receiver, :receiptid,\n :transactionid, :invnum, :acct, :auctionitemnumber,\n :transactionclass, :amt, :currencycode, :status]\n end",
"def rest_endpoint; end",
"def set_request; end",
"def endpoint_params\n params.fetch(:data).permit(\n attributes: [:verb, :path, :response_code, :response_body, response_headers: {}]\n )\n end",
"def endpoint=(_arg0); end",
"def http_options=(_arg0); end",
"def callback_type; end",
"def endpoint_params\n params.require(:endpoint).permit(:url, :name)\n end",
"def protocol=(_arg0); end",
"def valid_params_request?; end",
"def request type, uri_fragment, payload = {}\n url = \"#{@server_url}api/#{uri_fragment}\"\n uri = create_uri(url)\n auth = @digest_auth.auth_header uri, @header, type.to_s.upcase\n RestClient::Request.execute(:method => type, :url => url, :headers => {:authorization => auth}, :payload => payload)\n end",
"def remote_method_uri(method, format='ruby')\n params = {'run_id' => @agent_id, 'marshal_format' => format}\n uri = \"/agent_listener/#{PROTOCOL_VERSION}/#{@license_key}/#{method}\"\n uri << '?' + params.map do |k,v|\n next unless v\n \"#{k}=#{v}\"\n end.compact.join('&')\n uri\n end",
"def modify_load_balancer_internet_spec(load_balancer_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyLoadBalancerInternetSpec'\n\t\targs[:query]['LoadBalancerId'] = load_balancer_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :bandwidth\n\t\t\traise ArgumentError, 'bandwidth must be equal or greater than 1' unless optional[:bandwidth] < 1\n\t\t\traise ArgumentError, 'bandwidth must be equal or less than 1000' unless optional[:bandwidth] > 1000\n\t\t\targs[:query]['Bandwidth'] = optional[:bandwidth]\n\t\tend\n\t\tif optional.key? :internet_charge_type\n\t\t\targs[:query]['InternetChargeType'] = optional[:internet_charge_type]\n\t\tend\n\t\tif optional.key? :master_zone_id\n\t\t\targs[:query]['MasterZoneId'] = optional[:master_zone_id]\n\t\tend\n\t\tif optional.key? :max_conn_limit\n\t\t\targs[:query]['MaxConnLimit'] = optional[:max_conn_limit]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :security_status\n\t\t\targs[:query]['SecurityStatus'] = optional[:security_status]\n\t\tend\n\t\tif optional.key? :slave_zone_id\n\t\t\targs[:query]['SlaveZoneId'] = optional[:slave_zone_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def http_request_params\n params.require(:http_request).permit(:method, :parameters, :ip_address)\n end",
"def interface_sender_params\n params.require(:interface_sender).permit(:method_name, :class_name, :status, :operate_time, :url, :url_method, :url_content, :type)\n end",
"def _param_agent name, type = nil, one_of: nil, all_of: nil, any_of: nil, not: nil, **schema_hash\n combined_schema = one_of || all_of || any_of || (_not = binding.local_variable_get(:not))\n type = schema_hash[:type] ||= type\n pp \"[ZRO] Syntax Error: param `#{name}` has no schema type!\" and return if type.nil? && combined_schema.nil?\n\n schema_hash = CombinedSchema.new(one_of: one_of, all_of: all_of, any_of: any_of, _not: _not) if combined_schema\n param @param_type.to_s.delete('!'), name, type, (@param_type['!'] ? :req : :opt), schema_hash\n end",
"def get_endpoint()\n end",
"def request_type; \"RequestType\"; end",
"def validated_name_args(method_name, body)\n @args = json_parse(body)\n args = case method_name\n when /^sha$/ then []\n when /^alive$/ then []\n when /^ready$/ then []\n when /^image_names$/ then []\n when /^names$/ then []\n when /^manifests$/ then []\n when /^manifest$/ then [name]\n else\n raise ClientError, 'json:malformed'\n end\n if query?(method_name)\n method_name += '?'\n end\n [method_name, args]\n end",
"def endpoint\n raise NotImplementedError\n end",
"def build_request(method); end",
"def send_request(method, params, &block); end",
"def http_method\n raise \"Implement in child class\"\n end",
"def method_missing *args, &blk\n if m = caller.first.match(/^(#{__FILE__}:\\d+):in `method_missing'$/) # protect against a typo within this function creating a stack overflow\n raise \"Method missing calling itself with #{args.first} in #{m[1]}\"\n end\n is_built_in = false\n # If you define a method named get,post,create,etc don't require the method type\n if Endpoint::BUILT_IN_METHODS.include?(args.first) && !Endpoint::BUILT_IN_METHODS.include?(args[1])\n name = args.shift\n\n if Endpoint::BUILT_IN_MAP.has_key?(name.to_sym)\n method = name.to_sym\n is_built_in = true\n else\n method = Endpoint::BULT_IN_MAP.find do |meth,aliases|\n aliases.include?(name)\n end\n\n method = method[0] if method\n end\n else\n name = args.shift\n method = args.shift if args.first.is_a?(Symbol)\n end\n name = name.to_sym\n\n method ||= :get\n \n options = args.shift||{}\n options[:requires] ||= []\n options[:requires] = [options[:requires]] unless options[:requires].is_a?(Array)\n options[:into] ||= blk if block_given?\n @_endpoint.method_inflate_into[name] = options[:into]\n\n @_endpoint.class_eval <<-RUBY, __FILE__, __LINE__\n def #{name} force_params={}, args={}\n params = #{(options[:default]||{}).inspect}.merge(force_params)\n #{(options[:requires]||[]).inspect}.each do |req|\n raise RequiredParameter, \"#{name} endpoint requires the \"<<req<<\" paramerter\" unless params.include?(req.to_sym) || params.include?(req.to_s)\n end\n\n if #{is_built_in.inspect}\n super(params,args)\n else\n transform_response(#{method}(params,args),method_inflate_into[#{name.inspect}])\n end\n end\n RUBY\n end",
"def delete_load_balancer(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteLoadBalancer'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :load_balancer_id\n\t\t\targs[:query]['LoadBalancerId'] = optional[:load_balancer_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end",
"def request; end"
] | [
"0.63837177",
"0.6372391",
"0.6250731",
"0.6059074",
"0.6011611",
"0.5975739",
"0.59615475",
"0.58857226",
"0.57540584",
"0.5750123",
"0.5721178",
"0.57137656",
"0.56760687",
"0.56727606",
"0.5600799",
"0.5530732",
"0.5530732",
"0.5530732",
"0.5530732",
"0.55079454",
"0.550392",
"0.54894596",
"0.54841584",
"0.54752946",
"0.5444863",
"0.54443896",
"0.54089415",
"0.54046583",
"0.53961134",
"0.5391202",
"0.53808385",
"0.53808385",
"0.5373387",
"0.53688264",
"0.5341238",
"0.53290766",
"0.5307722",
"0.5304123",
"0.5296782",
"0.5296782",
"0.5289462",
"0.5288336",
"0.5270827",
"0.52597797",
"0.52449167",
"0.5244514",
"0.523084",
"0.52196527",
"0.5212927",
"0.52110326",
"0.5192641",
"0.5190227",
"0.51813084",
"0.5174612",
"0.5167854",
"0.5133788",
"0.51318854",
"0.5110306",
"0.5110306",
"0.5110306",
"0.5110306",
"0.51079875",
"0.50981206",
"0.50958574",
"0.5095514",
"0.50927114",
"0.508705",
"0.5081356",
"0.5081118",
"0.5065759",
"0.5059331",
"0.5059291",
"0.50574386",
"0.5054997",
"0.5051214",
"0.5047788",
"0.5033468",
"0.50326455",
"0.5024591",
"0.5014815",
"0.5001018",
"0.49979076",
"0.4995556",
"0.4994024",
"0.49905106",
"0.49891907",
"0.498885",
"0.49883136",
"0.49854106",
"0.49834824",
"0.49586013",
"0.49585018",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978",
"0.49577978"
] | 0.6279545 | 2 |
before_action :check_if_admin, only: [:index] | def profile
@user = @current_user
render :show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_actions\n unless @current_admin.is_super_admin\n flash[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n return\n end\n end",
"def any_action?\n admin?\n end",
"def check_admin\n redirect_to :root unless current_user.admin?\n end",
"def check_admin\n redirect_to new_admin_session_path unless is_admin?\n end",
"def authorize_admin\n redirect_to(:controller => 'main', :action => 'index') and return false unless @logged_in_user.is_admin?\n end",
"def show\n checkadmin\n end",
"def check_admin\n return redirect_to user_dashboard_path unless current_user.is_admin?\n end",
"def ensure_admin_user\n redirect_to dashboard_index_path unless is_admin?\n end",
"def index?\n not admin.nobody?\n end",
"def admin?\n controller.admin?\n end",
"def check_admin\n redirect_to root_path, alert: \"You do not have admin privileges.\" unless current_user.admin\n end",
"def check_admin\n redirect_to root_path, alert: \"You do not have admin privileges.\" unless current_user.admin\n end",
"def show\n isadmin\n end",
"def show\n is_admin?\n end",
"def check_admin\n if not ensure_admin\n redirect_to root_url, alert: \"you are not authorized\"\n end # end if\n end",
"def require_admin\n unless view_context.admin?\n redirect_to root_url\n end\n end",
"def check_admin\n redirect_to root_path unless current_user.has_role? :admin\n end",
"def admin_check\n render_401 && return unless current_user\n render_403 && return unless current_user.admin?\n end",
"def index?\n # @current_user.admin?\n end",
"def check_if_should_be_admin\n end",
"def check_admin\n if !current_user.admin?\n flash[:error] = \"You dont have access to this Page!!!!!\"\n redirect_to root_path\n end\n end",
"def ensure_admin!\n authorize! :read, :admin_dashboard\n end",
"def ensure_admin!\n authorize! :read, :admin_dashboard\n end",
"def admin!\n redirect_to root_path, alert: \"Not authorized\" and return unless is_admin?\n end",
"def check_if_admin\n unless current_user.admin\n redirect_to \"/login\"\n end\n end",
"def admin\n end",
"def admin\n end",
"def admin\n end",
"def admin\n end",
"def check_if_admin\n redirect_to root_path unless @current_user.present? && @current_user.admin?\n end",
"def check_admin\n redirect_to houses_path, alert: \"You do not have admin privileges.\" unless current_user.admin\n end",
"def admin_required\n redirect_to(\"/\") unless admin?\n end",
"def index?\n @current_user.admin?\n end",
"def index\n prevent_non_admin\n end",
"def require_admin\n redirect_to(root_path) unless current_user.admin?\n end",
"def is_admin?\n redirect_to home_index_path, alert: '请以管理员身份登陆后进行操作!' unless user_signed_in?&¤t_user.admin?\n end",
"def is_admin?\n redirect_to home_index_path, alert: '请以管理员身份登陆后进行操作!' unless user_signed_in?&¤t_user.admin?\n end",
"def authorize_admin!\n unless admin?\n flash[:alert] = 'Unauthorized access'\n redirect_to home_path\n false\n end\n end",
"def check_permission\n redirect_to dashboard_path, notice: 'You are not authorised to perform this action.' unless current_user&.admin?\n end",
"def authorizeAdmin\n redirect_to '/adminlogin' unless admin_user\n end",
"def verify_is_admin\n return unless !current_user.admin?\n redirect_to root_path, alert: 'Admins only!'\n end",
"def check_if_admin\n redirect_to(root_path) unless @current_user.is_admin?\n end",
"def check_if_admin\n redirect_to(root_path) unless @current_user.is_admin?\n end",
"def authorize_admin\n redirect_to root_path, notice: \"You don't have access to admin pages.\" if !current_user.admin?\n end",
"def admin_user\n redirect_to(admin_page_url) if current_user.admin?\n end",
"def admin\n\n end",
"def check_admin\n if !current_user.admin?\n return redirect_to '/messages/no_access'\n end\n end",
"def before_action \n end",
"def show\n is_admin?\n end",
"def admin\n #TODO\n end",
"def i_am_admin\n unless current_user.is_admin?\n redirect_to :root \n flash[:error] = \"You haven't the rights to access the required page.\"\n end\n end",
"def admin_user\n redirect_to(news_index_path) unless is_admin?\n end",
"def check_permissions\n unless current_user.is_admin?\n redirect_to index_path, alert: 'You do not have the permissions to visit the admin page'\n end\n end",
"def check_if_admin\n if !current_user.admin?\n flash[:alert] = 'Sorry, only admins allowed!'\n redirect_to root_path\n end\n end",
"def check_admin\n @user = find_current_user\n\n unless @user.present? and @user.is_admin?\n redirect_to root_path\n end\n end",
"def admin_view?\n params[:controller] =~ /admin/ and admin?\n end",
"def admin_view?\n params[:controller] =~ /admin/ and admin?\n end",
"def admin?; false end",
"def require_admin\n end",
"def verify_admin\n render_401 unless current_user.is_admin?\n end",
"def admin?\n false\n end",
"def test_admin\n return if session[:admin]\n if %w[destroy edit update].index(action_name)\n redirect_to @materiel, notice: \"Vous n'êtes pas administrateur\"\n else\n redirect_to materiels_url, notice: \"Vous n'êtes pas administrateur\"\n end\n end",
"def check_admin\n if authenticate_user! && current_user.admin\n return true\n else\n redirect_to \"/kopis/new\"\n end\n end",
"def admin_only\n unless current_user.admin\n redirect_to home_path, notice: \n \"You must be an admin to perform that function!\"\n end\n end",
"def admin_user\n redirect_to(admin_page_url) if current_user.admin?\n end",
"def authorize_admin\n return unless !current_admin\n redirect_to root_path, alert: 'Admins only!'\n end",
"def verify_admin\n admin_is_logged_in? || not_found\n end",
"def authorize_admin\n return unless current_user.admin?\n redirect_to root_path, alert: 'Admins only!'\n end",
"def show\n\t\trequire_admin!\n\tend",
"def is_admin\n \tif current_user != nil\n\t \t \tif !current_user.admin\n redirect_to root_path, :alert => \"Acceso denegado\"\n\t \tend\n\t\t else\n redirect_to root_path, :alert => \"Acceso denegado\"\n\t\t end\n \t\t\n\n end",
"def check_Admin\n\t\tif current_user.role != \"admin\"\n\t\t\tredirect_to('/')\n\t\tend\n\tend",
"def checkAdmin\n if !admin_signed_in?\n # if current user is not an admin then can't access the page like add teacher,department,college and new subject\n redirect_to root_path, notice: \"Only Admin Can Access This Page\"\n end\n end",
"def authorize_admin!\n redirect_to home_path unless current_user&.admin\n end",
"def isAdmin\n \n end",
"def require_admin_permission\n redirect_to tables_path, notice: 'Necesita permisos de administrador para visualizar la configuracion' unless current_user_admin?\n end",
"def check_for_admin\n unless user_signed_in? && current_user.admin?\n redirect_to root_path\n end\n end",
"def check_for_admin\n unless user_signed_in? && current_user.admin?\n redirect_to root_path\n end\n end",
"def check_for_admin\n unless user_signed_in? && current_user.admin?\n redirect_to root_path\n end\n end",
"def check_for_admin\n unless user_signed_in? && current_user.admin?\n redirect_to root_path\n end\n end",
"def admin?\n admin\n end",
"def require_admin\n redirect_to root_path unless admin_logged_in?\n end",
"def admin_required\n if current_user && current_user.admin\n return\n end\n redirect_to \"/login\", notice: 'Logga in som administratör.'\n end",
"def is_in_admin_view\n !request.path.match(\"/admin\").nil?\n end",
"def is_in_admin_view\n !request.path.match(\"/admin\").nil?\n end",
"def authorize_admin\n return unless !current_user.admin?\n redirect_to root_path, alert: 'Admins only!'\n end",
"def authorize_admin\n return unless !current_user.admin?\n redirect_to root_path, alert: 'Admins only!'\n end",
"def authorize_admin!\n redirect_to login_path unless current_user\n end",
"def is_admin\n unless admin?\n flash[:danger]= t 'h.sessions.requireadmin'\n redirect_to(root_url)\n end\n end",
"def admin?() false end",
"def admin_authorize\n unless admin?\n unauthorized_access\n end\n end",
"def require_admin\n if logged_in? and !current_user.admin?\n #flash[:danger] = 'Only admin users can perform that action'\n redirect_to root_path\n end\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\nend",
"def is_admin\n if !is_admin?\n flash[:danger] = \"Unauthorized. You are not an admin\"\n redirect_to home_path\n end\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n # redirect_to(root_url) unless\n current_user.admin?\n end",
"def is_admin\n render status: :unauthorized unless current_user.admin\n end",
"def admin_user\n render_forbidden unless current_user.admin?\n end",
"def authorize_admin!\n authorize! :manage, :all\n end",
"def check_admin_rights\n unless logged_in? and current_user.is_admin?\n flash[:error] = \"Permiso denegado\"\n redirect_to '/'\n end\n end",
"def verify_super_admin\n redirect_to admin_path unless current_user.user_level == \"super_admin_access\"\n\n end",
"def check_if_admin\n if(is_admin?)\n return true\n else\n flash[:notice] = 'You need to be signed in to perform that action'\n redirect_to :back\n end\n end"
] | [
"0.7955673",
"0.787282",
"0.7815589",
"0.778126",
"0.77725923",
"0.7766669",
"0.7731227",
"0.7706988",
"0.76438016",
"0.76393396",
"0.76359767",
"0.76359767",
"0.7622286",
"0.76172316",
"0.76114625",
"0.7609318",
"0.75978595",
"0.75577706",
"0.7542272",
"0.753394",
"0.75295526",
"0.75221956",
"0.75221956",
"0.7500662",
"0.7469523",
"0.74628",
"0.74628",
"0.74628",
"0.74628",
"0.7457339",
"0.7438463",
"0.7431733",
"0.7418835",
"0.7414889",
"0.7410029",
"0.7404396",
"0.7404396",
"0.7399316",
"0.7396111",
"0.7391646",
"0.73903126",
"0.73782283",
"0.73782283",
"0.73662466",
"0.7362963",
"0.7359962",
"0.7358934",
"0.7352587",
"0.7345581",
"0.7341659",
"0.7340584",
"0.73388445",
"0.7330458",
"0.73240936",
"0.7323806",
"0.7320078",
"0.7320078",
"0.7319098",
"0.73188",
"0.7312006",
"0.73045564",
"0.73042834",
"0.7304142",
"0.73031056",
"0.7299537",
"0.7295617",
"0.72905713",
"0.72897583",
"0.72881776",
"0.7284986",
"0.72829276",
"0.7279802",
"0.7277469",
"0.7271366",
"0.72700447",
"0.726329",
"0.726329",
"0.726329",
"0.726329",
"0.72613126",
"0.7256165",
"0.72479224",
"0.7228672",
"0.7228672",
"0.72275645",
"0.72275645",
"0.72210765",
"0.7209863",
"0.72083837",
"0.72059214",
"0.72040504",
"0.7203581",
"0.72006094",
"0.7193245",
"0.7192485",
"0.718986",
"0.7186486",
"0.7185626",
"0.7175619",
"0.7175509",
"0.71755046"
] | 0.0 | -1 |
maybe later display these as a tag cloud? Font size increasing with numbe of times a word is mentioned? | def get_keywords
tweets = self.get_tweets
counts = Hash.new(0)
tweets.each do |tweet|
tweet.text.downcase.split(/\s+/).each do |word|
word.gsub!(/\p{^Alnum}/,'')
next if word.size < 1
counts[word] += 1
end
end
temp_nest_array = (counts.select{ |k, v| v.to_i > 1}).sort_by{ |k, v| -v } # sort by count (descending) on counts of more than one word
count_hash = Hash.new(0)
temp_nest_array.each do |k, v|
count_hash[k] = v
end
count_hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_tag_cloud(tags)\n max, min = 30, 10 # font size of tags\n popularity = []\n tags.each{|t| (popularity << t.popularity)}\n x = ((max - min) / popularity.uniq.length)\n for i in 0...(tags.length)\n if i != 0 && tags[i - 1].popularity.to_i > tags[i].popularity.to_i\n max=max - x # Setting font size\n end\n yield tags[i].name, max.to_s+'px'\n end\n end",
"def tags\n tags= Tag.find_all_with_article_counters(20)\n total= tags.inject(0) {|total,tag| total += tag[:article_counter] }\n average = total.to_f / tags.size.to_f\n sizes = tags.inject({}) {|h,tag| h[tag[:name]] = (tag[:article_counter].to_f / average); h} # create a percentage\n # apply a lower limit of 50% and an upper limit of 200%\n sizes.each {|tag,size| sizes[tag] = [[2.0/3.0, size].max, 2].min * 100}\n\n str= \"<p style=\\\"overflow:hidden\\\">\"\n tags.sort{|x,y| x[:name] <=> y[:name]}.each do |tag|\n str += \"<span style=\\\"font-size:#{sizes[tag[:name]]}%\\\"> #{link_to(tag[:name], url(:tag, tag[:name]))}</span>\"\n end\n str += \"</p>\"\n @body= str\n render\n end",
"def tag_cloud(entries)\r\n # collect counts for each library\r\n h = Hash.new(0)\r\n entries.each do |e|\r\n e.paths.each do |kind, path| \r\n lib = path_to_lib(path)\r\n h[lib] += 1 if lib\r\n end\r\n end\r\n\r\n min_size = 11\r\n max_size = 30\r\n \r\n max = h.values.max\r\n h = h.to_a.sort.map do |lib, count|\r\n # s = min_size + count * (max_size - min_size) / max # linear\r\n s = (min_size + Math.sqrt(count * max) * (max_size - min_size) / max).to_i # quadratic\r\n \"<span class=\\\"tag\\\" style=\\\"font-size:#{s}px;\\\" title=\\\"#{count} changes\\\">#{lib}</span>\"\r\n end\r\n \"<div class=\\\"cloud\\\">#{h.join(\" \")}</div>\"\r\n end",
"def tag\n puts \"\\ntagging\"\n tagged_arr = Hash.new\n (2..4).each do |k|\n @grams[k].each_with_index do |item, index|\n item_count = count index, k\n if item_count > 1\n unless equals tagged_arr, item\n tagged_arr[item.clone] = item_count\n end\n end\n end\n end\n tagged_arr\n end",
"def tag_cloud\n Tag.all.map do |tag_name, tag_occurence|\n search_link_to(\"#{tag_name} (#{tag_occurence})\", { :tag => tag_name }, { :class => \"nobr\" })\n end.join(\", \")\n end",
"def word_sizes(sentence)\n sentence.split.each_with_object(Hash.new(0)) { |word, obj| obj[word.size] += 1 } \nend",
"def display\n if count_dracula > 0\n fill(255)\n elsif count_franken > 0\n fill(0)\n end\n # Its size is also tied to number of occurences\n fs = map1d(total_count, (5..25), (2..24.0))\n fs = (2..48).clip fs\n text_size(fs)\n text_align(CENTER)\n text(word, position[X], position[Y])\n end",
"def quick_text_tags(text, ii, font_change)\n ret = text_tags(text, ii, font_change)\n [ret[0], ret[1], ret[2]]\n end",
"def word_sizes(text)\n word_size = Hash.new(0)\n words = text.split\n words.each { |word| word_size[word.size] += 1 }\n word_size\nend",
"def tag_cloud\n @tags = Snippet.tag_counts_on(:tags)\n end",
"def tags_with_counts\n counts = Hash.new(0)\n Tag.all(:id => taggings, :select => 'word').collect(&:word).each{|val|counts[val]+=1}\n counts.sort{|a,b| a[1] <=> b[1]}.reverse\n end",
"def designerPdfViewer(h, word)\n heights = Array.new\n hsh = Hash.new\n (\"a\"..\"z\").each_with_index { |letter, i| hsh[letter] = h[i] }\n word.each_char { |ch| heights << hsh[ch] }\n return heights.max * heights.count\nend",
"def tag_cloud\r\n \t@tags = Post.tag_counts_on(:tags)\r\n end",
"def build_tag_cloud(tag_cloud, style_list)\nmax, min = 0, 0\ntag_cloud.each do |tag|\nmax = tag.popularity.to_i if tag.popularity.to_i > max\nmin = tag.popularity.to_i if tag.popularity.to_i < min\nend\n\ndivisor = ((max - min) / style_list.size) + 1\n\ntag_cloud.each do |tag|\nyield tag.name, style_list[(tag.popularity.to_i - min) / divisor]\nend\nend",
"def lede(word_count = 25)\n doc = self.hpricot_body\n #wipe images\n doc.search(\"img\").remove\n paras = doc.search(\"//p\")\n text = \"\" \n while paras.size > 0 && text.split(\" \").size < word_count\n text += paras.shift.to_html\n end\n if (arr = text.split(\" \")).size > word_count\n return arr[0..word_count].join(\" \") + \" ...\"\n else \n return arr.join(\" \")\n end\n end",
"def tag_cloud\n @tags = Post.tag_counts_on(:skill_tags)\n end",
"def word_instances(text)\n instances = Hash.new(0)\n normalize(text).each do |word|\n instances[word] += 1\n end\n instances\nend",
"def word_sizes(sentence)\n cleaned = sentence.gsub(/[^0-9a-z]/i, ' ')\n grouped = cleaned.split.group_by {|x| x.length }\n results = grouped.each {|x, i| grouped[x] = i.length}\n end",
"def tag_counts\n JekyllTags.tag_count.each do |tag,count|\n puts \"#{tag}: #{count}\"\n end\n end",
"def word_sizes(txt)\n arr = txt.split\n hsh = {}\n arr.each do |e|\n hsh.has_key?(e.size) ? hsh[e.size] += 1 : hsh[e.size] = 1\n end\n hsh\nend",
"def word_sizes(text)\n word_size = Hash.new(0)\n text.split.map do |word|\n word.delete \"^A-Za-z\"\n word_size[word.size] += 1\n end\n word_size\nend",
"def index\n @posts = Post.all\n\n # words_array = Array.new\n\n # # @posts.each do |post|\n # # str = post.text.html_safe.downcase\n\n # # words_array.push str.split(\" \")\n # # end\n # words_array = \"eu nao qero mais brincar disso, cansei\".split(\" \")\n\n # @word_cloud = words_array\n\n @tag_cloud = [\n { text: \"test\", weight: 15},\n { text: \"Ipsum\", weight: 9, link: \"http://jquery.com/\"},\n { text: \"Dolor\", weight: 6, html: {title: \"I can haz any html attribute\"}},\n { text: \"Sit\", weight: 7}, {text: \"Amet\", weight: 5}\n ]\n end",
"def process_words\n reset_counts\n # iterate through radlib_array and add counts\n self.each do |w|\n Rails.logger.debug(w.inspect)\n case w[\"type\"]\n when \"word\"\n @num_words += 1\n if w[\"selectable\"] && w[\"selected\"]\n @num_blanks += 1\n # fix for old radlibs\n unless w[\"user_pos\"]\n w[\"user_pos\"] = w[\"predicted_pos\"]\n end\n type = w[\"user_pos\"].gsub(\"-\", \"_\").to_sym\n Rails.logger.debug(type)\n @num_blanks_by_type[type] += 1\n end\n when \"whitespace\"\n # don't need to do anything here\n when \"punc\"\n @num_sentences += 1 if w[\"text\"] == \".\" || w[\"text\"] == \"!\" || w[\"text\"] == \"?\"\n end\n end\n end",
"def bpd_word_count(data)\n\t\tword_count = []\n\t\tword_count_scaled = []\n\n\t\tdata.each do |row|\n\t\t\tword_count << {\"text\" => row[0], \"size\" => row[1]}\n\t\tend\n\n\t\t# scaling for word cloud\n\t\tword_count = word_count.reverse\n\n\t\tnew_max = 20.0\n\t\tnew_min = 1.0\n\n\t\tfirstword = word_count.first\n\t\tlastword = word_count.last\n\n\t\told_range = word_count.last['size'].to_i - word_count.first['size'].to_i\n\t\tnew_range = new_max - new_min\n\n\t\tword_count_scaled << {\"text\" => firstword['text'], \"size\" => 1}\n\n\t\tword_count.slice(1..-2).each do |word|\n\t\t\tnew_value = (((word['size'].to_i - word_count.first['size'].to_i) * new_range)/old_range) + new_min\n\t\t\tword_count_scaled << {\"text\" => word['text'], \"size\" => new_value}\n\t\tend\n\n\t\tword_count_scaled << {\"text\" => lastword['text'], \"size\" => 10}\n\n\t\tword_count_scaled.to_json\n\tend",
"def process_sentance(blob)\n # strip out enclosures\n blob = blob.gsub(/\\\\/,'')\n # test for quotes\n # if quotes, these words are important (flag them)\n test = blob.match(/[\"'](.*)['\"]/)\n if test && test.size > 1\n @words = test[1..test.size].join(\" \")\n #test.each{|word|\n # @words << word\n #}\n #blob = blob.gsub(@words,'')\n blob = blob.gsub(/([\"'])/,'')\n end\n unless @words.nil?\n # break up and add to @local_important\n tmp = @words.split(\" \")\n tmp.each{|word|\n @local_important << word.downcase unless @local_important.include? word\n }\n end\n #puts blob\n the_pieces = blob.split(\" \")\n parse_words(the_pieces)\n \n # try to sort words\n words = grab_important_words\n puts words.inspect\n \n puts \"Derived Tags: #{words.join(' ')}\"\n \n end",
"def text_width(font_handle, text)\n end",
"def another_print_fonts\n for index in 0..@fonts.size do\n puts \"#{index} -> #{@fonts[index]}\" # use of templating\n end\nend",
"def tags_with_counts\n counts = model_tags.map{|tag| [tag.word, tag.tagging_count]}\n counts.sort{|a, b| b[1] <=> a[1]}\n end",
"def word_sizes(sentence)\n hash = Hash.new(0)\n sentence.split.each do |word|\n hash[word.size] += 1\n end\n hash\nend",
"def text_tags(text, pos, font_change, final = false, x = 0, y = 0, size = 0, angle = 0, word_space_adjust = 0)\n tag_size = 0\n\n tag_match = %r!^<(/)?([^>]+)>!.match(text[pos..-1])\n\n if tag_match\n closed, tag_name = tag_match.captures\n cts = @current_text_state # Alias for shorter lines.\n tag_size = tag_name.size + 2 + (closed ? 1 : 0)\n\n case tag_name\n when %r{^(?:b|strong)$}o\n if closed\n cts.slice!(-1, 1) if ?b == cts[-1]\n else\n cts << ?b\n end\n when %r{^(?:i|em)$}o\n if closed\n cts.slice!(-1, 1) if ?i == cts[-1]\n else\n cts << ?i\n end\n when %r{^r:}o\n _match = MATCH_TAG_REPLACE_RE.match(tag_name)\n if _match.nil?\n warn PDF::Writer::Lang[:callback_warning] % [ 'r:', tag_name ]\n tag_size = 0\n else\n func = _match.captures[0]\n params = parse_tag_params(_match.captures[1] || \"\")\n tag = TAGS[:replace][func]\n\n if tag\n text[pos, tag_size] = tag[self, params]\n tag_size, text, font_change, x, y = text_tags(text, pos,\n font_change,\n final, x, y, size,\n angle,\n word_space_adjust)\n else\n warn PDF::Writer::Lang[:callback_warning] % [ 'r:', func ]\n tag_size = 0\n end\n end\n when %r{^C:}o\n _match = MATCH_TAG_DRAW_ONE_RE.match(tag_name)\n if _match.nil?\n warn PDF::Writer::Lang[:callback_warning] % [ 'C:', tag_name ]\n tag_size = 0\n else\n func = _match.captures[0]\n params = parse_tag_params(_match.captures[1] || \"\")\n tag = TAGS[:single][func]\n\n if tag\n font_change = false\n\n if final\n # Only call the function if this is the \"final\" call. Assess\n # the text position. Calculate the text width to this point.\n x, y = text_end_position(x, y, angle, size, word_space_adjust,\n text[0, pos])\n info = {\n :x => x,\n :y => y,\n :angle => angle,\n :params => params,\n :status => :start,\n :cbid => @callbacks.size + 1,\n :callback => func,\n :height => font_height(size),\n :descender => font_descender(size)\n }\n\n ret = tag[self, info]\n if ret.kind_of?(Hash)\n ret.each do |rk, rv|\n x = rv if rk == :x\n y = rv if rk == :y\n font_change = rv if rk == :font_change\n end\n end\n end\n else\n warn PDF::Writer::Lang[:callback_Warning] % [ 'C:', func ]\n tag_size = 0\n end\n end\n when %r{^c:}o\n _match = MATCH_TAG_DRAW_PAIR_RE.match(tag_name)\n\n if _match.nil?\n warn PDF::Writer::Lang[:callback_warning] % [ 'c:', tag_name ]\n tag_size = 0\n else\n func = _match.captures[0]\n params = parse_tag_params(_match.captures[1] || \"\")\n tag = TAGS[:pair][func]\n\n if tag\n font_change = false\n\n if final\n # Only call the function if this is the \"final\" call. Assess\n # the text position. Calculate the text width to this point.\n x, y = text_end_position(x, y, angle, size, word_space_adjust,\n text[0, pos])\n info = {\n :x => x,\n :y => y,\n :angle => angle,\n :params => params,\n }\n\n if closed\n info[:status] = :end\n info[:cbid] = @callbacks.size\n\n ret = tag[self, info]\n\n if ret.kind_of?(Hash)\n ret.each do |rk, rv|\n x = rv if rk == :x\n y = rv if rk == :y\n font_change = rv if rk == :font_change\n end\n end\n\n @callbacks.pop\n else\n info[:status] = :start\n info[:cbid] = @callbacks.size + 1\n info[:tag] = tag\n info[:callback] = func\n info[:height] = font_height(size)\n info[:descender] = font_descender(size)\n\n @callbacks << info\n\n ret = tag[self, info]\n\n if ret.kind_of?(Hash)\n ret.each do |rk, rv|\n x = rv if rk == :x\n y = rv if rk == :y\n font_change = rv if rk == :font_change\n end\n end\n end\n end\n else\n warn PDF::Writer::Lang[:callback_warning] % [ 'c:', func ]\n tag_size = 0\n end\n end\n else\n tag_size = 0\n end\n end\n [ tag_size, text, font_change, x, y ]\n end",
"def draw_text(xp, yp, step, strs, draw, canvas) # xp,yp is X,Y position. draw is the drawing method, canvas is where to draw on\n for str in strs\n yp = yp + step\n draw.annotate(canvas,647,600,xp,yp,str){\n draw.fill = '#ddd'\n draw.stroke = 'transparent'\n draw.pointsize = 20\n # self.font = \"BS.ttf\" \n draw.font = $config[\"fonts\"][3] \n }\n end\n return yp\nend",
"def process\n tokenize(text).each do |word|\n token = TfIdfSimilarity::Token.new word\n if token.valid?\n @term_counts[token.lowercase_filter.classic_filter.to_s] += 1\n end\n end\n @size = term_counts.values.reduce(:+)\n end",
"def fog\n ( words_per_sentence + percent_fog_complex_words ) * 0.4\n end",
"def hashtagify(sentence, tags)\n\nend",
"def word_sizes(sentence)\n hash = Hash.new(0)\n words = sentence.split(\" \")\n words.map! { |word| word.gsub(/[^a-zA-Z]/, ' ')}\n words.map! { |word| word.delete(\" \")}\n words.each { |word| hash[word.length] += 1 }\n hash\nend",
"def word_sizes2(string)\n frequency = Hash.new(0) #set the default value to 0\n string.split.each do |word| \n frequency[word.length] += 1\n end\n frequency\nend",
"def call\n if words.size < 3\n color_size = 3\n elsif words.size > 9\n color_size = 9\n else\n color_size = words.size\n end\n\n # This will raise an exception if you pass a color ramp that doesn't\n # exist in ColorBrewer.\n colors = ColorBrewer::SEQUENTIAL_COLOR_SCHEMES[color_size].fetch(color)\n\n # Write out to PDF and return the PDF\n pdf_with_header(header: header) do |pdf|\n # Get the path to the font file itself. Again, it'll raise if you\n # pass a bad font.\n font_path = pdf.font_families.fetch(font)[:normal]\n\n # Get our point sizes for each word\n range = (words.values.min..words.values.max)\n words_to_points = words.each_with_object({}) do |(word, freq), ret|\n ret[word] = point_size_for(frequency_range: range,\n frequency: freq)\n end\n\n # Build the canvas and place the words\n canvas = Canvas.new(words: words_to_points, font_path: font_path)\n positions = words_to_points.each_with_object({}) do |(word, size), ret|\n ret[word] = [canvas.place_word(word: word, size: size), size]\n end\n\n pdf.font(font)\n\n # Compute how much space we have and how we should scale from our\n # canvas to the PDF\n space_x = pdf.bounds.width\n space_y = pdf.bounds.height - 18 - 20\n\n scale_x = space_x / canvas.width\n scale_y = space_y / canvas.height\n scale = [scale_x, scale_y].min\n\n # Center the block of text. Which of these dimensions is larger is\n # stochastic, so don't care about test coverage\n x_offset = y_offset = 0\n # :nocov:\n if scale == scale_x\n y_offset = (space_y - scale * canvas.height) / 2\n else\n x_offset = (space_x - scale * canvas.width) / 2\n end\n # :nocov:\n\n # Draw all the words, stroked in the darkest color from the color\n # scheme\n pdf.stroke_color(colors.last[1, 6])\n pdf.line_width(0.25)\n\n positions.each_with_index do |(word, (pos, size)), i|\n pdf.fill_color(colors[i % colors.size][1, 6])\n pdf.text_rendering_mode(:fill_stroke) do\n pdf.draw_text(word, size: size * scale,\n at: [pos[0] * scale + x_offset,\n pos[1] * scale + y_offset])\n end\n end\n end\n end",
"def word_sizes(words)\n length_arr = []\n hash_words = {}\n words.gsub(/[^[:word:]\\s]/, '').split(' ').each do |word| \n length_arr << word.length\n end\n length_arr.uniq.each do |element|\n hash_words[element] = length_arr.count(element)\n end\n hash_words\nend",
"def word_sizes(str)\n\n\tcounts = Hash.new(0)\n\n\tstr.split.each do |word|\n\tcounts[word.size] += 1\n\tend\t\n\tcounts\nend",
"def font_descender(size = nil)\n size = @font_size if size.nil? or size <= 0\n\n select_font(\"Helvetica\") if @fonts.empty?\n hi = @fonts[@current_font].fontbbox[1].to_f\n (size * hi / 1000.0)\n end",
"def word_sizes(input)\n\n occurrences = Hash.new(0)\n\n input.split.each do |element|\n occurrences[element.size] += 1\n end\n \n occurrences\nend",
"def word_sizes(sentence)\n words = Hash.new(0)\n sentence.split.each {|x| words[x.count(\"A-Za-z\")] += 1}\n words\nend",
"def make_cloud(string)\n\tarr = string.scan(/[a-zA-Z]+-[a-zA-Z]+|[a-zA-Z]+/).map{|word| word.downcase}\n\tcloud = Hash.new {|k,v| k[v] = 0}\n\n\tuntil arr.empty?\n\t\tword = arr.pop\n\t\tcloud[word] += 1\n\tend\n\ncloud\nend",
"def tag_cloud(tags, classes)\n tags.each do |tag|\n index = tag.recipes.count.to_f / tags.last.recipes.count * (classes.size - 1)\n yield(tag, classes[index.round])\n end\n end",
"def word_sizes(str)\n str.split.each_with_object({}) do |word, hsh|\n hsh[word.size] ||= 0\n hsh[word.size] += 1\n end\nend",
"def word_instances(text)\n instances = Hash.new(0)\n normalized_words = normalize(text)\n unique(text).each do |word|\n instances[word] = normalized_words.count(word)\n end\n instances\nend",
"def tagged_words\n @part_of_speech.map.with_index {|pos, i| [@tokens[i], pos] }.reject(&:nil?)\n end",
"def text_size s, f = font\n f.text_size s\n end",
"def text_size s, f = font\n f.text_size s\n end",
"def kincaid\n (11.8 * syllables_per_word) + (0.39 * words_per_sentence) - 15.59\n end",
"def nice_typography(text)\n widont(amp(rubypants(text)))\n end",
"def word_sizes(string)\n string.split.map do |word|\n word.size\n end.tally\n \nend",
"def word_sizes(str)\n str = str.gsub(/[^a-zA-Z ]/,\"\")\n h1 = Hash.new(0)\n str.split.each do |element|\n h1[element.size] += 1\n end\n h1\nend",
"def create_texts\n add_text(TEXT_OX, 0, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 0)) # Attack !\n add_text(TEXT_OX + DELTA_X, 0, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 1)) # Bag\n add_text(TEXT_OX, DELTA_Y, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 2)) # Pokemon\n add_text(TEXT_OX + DELTA_X, DELTA_Y, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 3)) # Flee\n end",
"def tags\n if @tags.nil? # build categories\n @tags = {}\n @sentences.each do |sentence|\n sentence.each do |element|\n if @tags[element[1]].nil?\n @tags[element[1]] = 1\n else\n @tags[element[1]] = @tags[element[1]] + 1\n end\n end\n end\n end\n\n @tags\n end",
"def tag_cloud(tags, classes)\r\n return if tags.empty?\r\n \r\n max_count = tags.sort_by(&:count).last.count.to_f\r\n \r\n tags.each do |tag|\r\n index = ((tag.count / max_count) * (classes.size - 1)).round\r\n yield tag, classes[index]\r\n end\r\n end",
"def word_count_engine(document)\n document = document.gsub(/[^ 0-9A-Za-z]/, '').downcase.split(' ')\n\n store = {}\n max = 0\n\n document.each do |element|\n if store[element]\n store[element] += 1\n max = [store[element], max].max\n else\n store[element] = 1\n max = 1 if max == 0\n end\n end\n\n buckets = Array.new(max) { [] }\n\n store.each do |key, value|\n buckets[max - value].push([key, value.to_s])\n end\n\n buckets.flatten(1)\nend",
"def small_font\n [-2, 0, 0, 0, 0, 255]\n end",
"def word_sizes(word_string)\n word_sizes = Hash.new(0)\n array = word_string.split.each { |string| string.slice!(/[^a-zA-Z]/) }\n array.each { |word| word_sizes[word.size] += 1 }\n word_sizes\nend",
"def noun_count\n 20\nend",
"def learn_from_line line\n tokens = tokenize(line)\n\n count_tag_unigrams @tag_unigram_counts, tokens\n count_word_tag_unigrams @word_tag_unigram_counts, tokens\n\n count_tag_bigrams @tag_bigram_counts, tokens\n count_tag_trigrams @tag_trigram_counts, tokens\n\n count_tag_bigrams @tag_skip1_bigram_counts, tokens, gap=1\n end",
"def top_words\n\t\ttgr = EngTagger.new\n\t\tdesc_string = @desc_array.join(\" \").downcase.delete \".\"\n\n\t\t#Adds parts of speech to each word in the descriptions\n\t\ttagged = tgr.add_tags(desc_string)\n\t\t#Collects all words tagged as nouns or noun phrases with the number of times they occur\n\t\tnouns = tgr.get_noun_phrases(tagged)\n\t\t#collects all words tagged as adjectives with the number of times they occur\n\t\tadj = tgr.get_adjectives(tagged)\n\t\tif nouns #prevents app from breaking with invalid username\n\t\t\t@valid_username = true\n\t\t\t#Combines noun phrases and adjectives into one hash\n\t\t\twords = nouns.merge(adj)\n\t\t\t#Removes some meaningless words as keys. Didn't remove them earlier because I imagine some could potentially still be useful in noun phrases\n\t\t\twords = words.except(\"beer\", \"brew\", \"flavor\", \"first\", \"character\", \"finish\", \"color\", \"style\", \"taste\", \"aroma\", \"aromas\", \"brewery\", \"brewing\", \"%\", \"other\", \"one\", \"perfect\", \"bottle\", \"flavors\", \"abv\", \"profile\", \"new\", \"notes\", \"great\", \"delicious\", \"beers\", \"such\", \"alcohol\")\n\t\t\t#Exclude words with count of 2 (for now) or fewer\n\t\t\tvalid_keys = []\n\t\t\twords.each do |k,v| \n\t\t\t\tif v > 2\n\t\t\t\t\tvalid_keys.push(k)\n\t\t\t\tend\t\n\t\t\tend\n\t\t\twords.slice!(*valid_keys)\n\t\t\t#Converts hash into array and sorts with highest value first\n\t\t\t@words_array = words.sort {|k,v| v[1]<=>k[1]}\n\t\t\t@words_array = @words_array.first(60)\n\t\t\tbubble_chart_hack\n\t\telse\n\t\t\t@valid_username = false\n\t\tend\n\tend",
"def font_size\n @font_size ||= [cell_height, cell_width].sort.shift * 0.8\n end",
"def word_sizes(str)\n word_count = Hash.new(0)\n\n str.split(' ').each do |word|\n word_count[word.size] += 1\n end\n\n word_count\n\nend",
"def word_sizes(str)\n ary = str.split\n # Create array of word lengths\n num_array = ary.map do |word|\n word.length\n end\n rtn_hsh = ary.each_with_object({}) do |word, hsh|\n hsh[word.length] = num_array.count(word.length)\n end\n rtn_hsh\nend",
"def word_number\n text.split.size\n end",
"def tag_on(model, text)\n return if (text.length == 0)\n words = text.split(' ')\n taggings = []\n\n words.each do |word|\n tag = Tag.find_or_create_by(name: word)\n\n if Tagging.where(tagger: self, taggable: model, tag: tag).first \n return\n end\n\n tagging = self.taggings.create(tag: tag, taggable: model)\n if tagging\n tag.inc(:taggings_count, 1)\n else\n return\n end\n\n # taggings << tagging\n\n model_tag = model.model_tags.find_or_create_by(name: word)\n model_tag.user_ids << self.id unless model_tag.user_ids.include?(self.id)\n model_tag.inc(:taggings_count, 1)\n model_tag.save \n model.reload\n end\n\n # taggings\n\n # return if (text.length == 0)\n\n # tag = Tag.find_or_create_by(name: text)\n\n # if Tagging.where(tagger: self, taggable: model, tag: tag).first \n # return\n # end\n\n # if tagging = self.taggings.create(tag: tag, taggable: model)\n # tag.inc(:taggings_count, 1)\n # end\n\n # model_tag = model.model_tags.find_or_create_by(name: text)\n # model_tag.user_ids << self.id unless model_tag.user_ids.include?(self.id)\n # model_tag.inc(:taggings_count, 1)\n # model_tag.save \n # model.reload\n # tagging\n end",
"def word_sizes(str)\n str.split.map { |element| element.size }.tally\nend",
"def designerPdfViewer(h, word)\n # Write your code here\n letters = ('a'..'z').to_a\n value = []\n word.each_char{|ch| value << h[letters.find_index(ch)]}\n value.max * word.length\nend",
"def tags_with_user_tag_counts\n\t\tuser_tags = tags.pluck(:name)\n\t\tuser_tag_list = Hash.new(0)\n\n\t\tuser_tags.each do |t|\n\t\t\tuser_tag_list[t] += 1\n\t\tend\n\n\t\ttags = treasures.tag_counts_on(:tags)\n\t\ttags.map do |t|\n\t\t\tt.taggings_count = user_tag_list[t.name]\n\t\tend\n\n\t\ttags\n\tend",
"def word_sizes(string)\n string.split.map { |word| word.size }.tally\nend",
"def word_sizes(string)\n\tword_count = {}\n\tstring.split.each do |word|\n\t\tword_s = word.size\n\t\tif word_count[word_s]\n\t\t\tword_count[word_s] += 1\n\t\telse\n\t\t\tword_count[word_s] = 1\n\t\tend\n\tend\n\tword_count\nend",
"def word_sizes(string)\n word_count = Hash.new(0)\n\n string.split.each do |element|\n word_count[element.size] += 1\n end\n word_count\nend",
"def subtitle_print(words)\n title = Artii::Base.new :font => 'slant'\n puts title.asciify(words).colorize(:blue)\n end",
"def size_article(string)\n sentences = []\n iterator = 1\n num_times = string.size / 103\n sentence_chars = string.chars\n num_times.times do\n if iterator == 1\n sentence = sentence_chars.shift(95).join(\"\") + \"\\n\"\n sentences << sentence\n else\n sentence = sentence_chars.shift(103).join(\"\") + \"\\n\"\n sentences << sentence\n end\n iterator += 1\n end\n sentences\n end",
"def word_sizes(str)\n counter = Hash.new(0)\n str.split.each do |word|\n counter[word.gsub(/\\W/,'').length] += 1\n end \n counter\nend",
"def word_sizes(string)\n \n sizes = string.gsub(/[^a-z A-Z]/, '').split(' ').map{ |word| word.size }.sort\n sizes.uniq.zip(sizes.uniq.map { |size| sizes.count(size) }).to_h\n \n # Method 2\n # h = {}\n # sizes.uniq.each { |size| h[size] = sizes.count(size) }\n # h\n \nend",
"def word_sizes(str)\n words_by_sizes = {}\n\n str.split.each do |word|\n if words_by_sizes.key?(word.size)\n words_by_sizes[word.size] += 1\n else\n words_by_sizes[word.size] = 1\n end\n end\n words_by_sizes\nend",
"def each_word_count(text)\n word_counts = {}\n normalize(text).each do |word|\n word_counts[word] = 0 if !word_counts[word]\n word_counts[word] += 1\n end\n word_counts\nend",
"def ajouterTexte(font,texte,couleur,position)\r\n\t\ttexte = GLib.convert(texte, \"ISO-8859-15\", \"UTF-8\") #Conversion de l'UTF8 vers ISO-8859-15\r\n\t\tposition = @justification[position]\r\n\t\t\r\n\t\tr = couleur.red.to_i / 256\r\n\t\tv = couleur.green.to_i / 256\r\n\t\tb = couleur.blue.to_i / 256\r\n\t\t\r\n\t\tvaleur = ((b * 256) + v) * 256 + r\t\r\n\t\t\r\n\t\t\r\n\t\tf = font.split()\r\n\t\t\r\n\t\ttaille = f.pop().to_i\r\n\t\tstylePolice = f.pop() if f.include?(\"Bold\") || f.include?(\"Italic\") || f.include?(\"Bold Italic\")\r\n\t\tpolice = f.join(\" \")\r\n\t\t\r\n\t\ttailleDefaut = taille\r\n\t\t\r\n\t\ttab = []\r\n\t\t\r\n\t\tr = %r{(<big>.*</big>)|(<small>.*</small>)|(<span size=.*>.*</span>)}\r\n\t\ttexte.split(r).each do |c|\r\n\t\t\tif %r{<big>(.*)</big>}.match(c)\r\n\t\t\t\ttexte = $1\r\n\t\t\t\ttaille = tailleDefaut + 2\r\n\t\t\telsif %r{<small>(.*)</small>}.match(c)\r\n\t\t\t\ttexte = $1\r\n\t\t\t\ttaille = tailleDefaut - 2\r\n\t\t\telsif %r{<span size=\\\"(x{1,2})-large\\\">(.*)</span>}.match(c)\r\n\t\t\t\tcase $1\r\n\t\t\t\t\twhen \"x\"\r\n\t\t\t\t\t\ttaille = 22\r\n\t\t\t\t\twhen \"xx\"\r\n\t\t\t\t\t\ttaille = 26\r\n\t\t\t\tend\r\n\t\t\t\ttexte = $2\r\n\t\t\telse\r\n\t\t\t\ttaille = tailleDefaut\r\n\t\t\t\ttexte = c\r\n\t\t\tend\r\n\t\t\ttab << [texte,taille]\r\n\t\tend\r\n\t\r\n\t\tre = %r{(<u>.*</u>)|(<b>.*</b>)|(<i>.*</i>)|(<s>.*</s>)}\r\n\t\ttab.each do |t|\r\n\t\t\tt[0].split(re).each do |d|\r\n\t\t\t\tif %r{<u>(.*)</u>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.Underline = true\r\n\t\t\t\telsif %r{<b>(.*)</b>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.Bold = true\r\n\t\t\t\telsif %r{<i>(.*)</i>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.Italic = true\r\n\t\t\t\telsif %r{<s>(.*)</s>}.match(d)\r\n\t\t\t\t\ts = $1\r\n\t\t\t\t\t@word.Selection.Font.StrikeThrough = true\r\n\t\t\t\telse\r\n\t\t\t\t\ts = d\r\n\t\t\t\t\t@word.Selection.Font.Underline = false\r\n\t\t\t\t\t@word.Selection.Font.Bold = false\r\n\t\t\t\t\t@word.Selection.Font.Italic = false\r\n\t\t\t\t\t@word.Selection.Font.StrikeThrough = false\r\n\t\t\t\tend\r\n\t\t\t\t\r\n\t\t\t\t@word.Selection.Font.Bold = true if stylePolice == \"Bold\" || stylePolice == \"Bold Italic\"\r\n\t\t\t\t@word.Selection.Font.Italic = true if stylePolice == \"Italic\" || stylePolice == \"Bold Italic\"\r\n\t\t\t\t@word.Selection.Font.Name = police\r\n\t\t\t\t@word.Selection.Font.Size = t[1]\r\n\t\t\t\t@word.Selection.Font.Color = valeur\r\n\t\t\t\t@word.Selection.ParagraphFormat.Alignment = position\r\n\t\t\t\t@word.Selection.TypeText(s)\r\n\t\t\t\t\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"def inspect\n \"#{size} words\"\n end",
"def report_on_dups\n @sentences.each do |s|\n # Count pairs\n previous = \"\"\n s.each do |word,tag|\n if word == previous and tag != \".\" and tag != \".-hl\" and tag != \",\"\n puts word + \" \" + tag\n puts (s.map { |e| e.first }).join(' ')\n end\n previous = word\n end\n end\n end",
"def add_tags_to_verses(document, text)\n html = text.to_str\n html.gsub!(/data-srcid\\s?=\\s?['\"](.*?)['\"]/) do |match|\n tagid = DmKnowledge::Document.tagcontext_from_srcid($1)\n tag_list = document.tag_list_on(tagid)\n unless tag_list.empty?\n \"#{match} data-tags='#{tag_list.to_json}' data-tagid='#{tagid}'\"\n else\n match\n end\n end\n html.html_safe\n end",
"def tags_text\n\t\tself.tags.join(', ') #convertir el arreglo en una cadena de texto separado por ,\n\tend",
"def tag_cloud(tags, classes, options = {})\n if tags and not tags.empty?\n if options[:relevancia]\n max_count = tags.sort_by{ |t| t.relevancia.to_i }.last.relevancia.to_f\n else\n max_count = tags.sort_by{ |t| t.total.to_i }.last.total.to_f\n end\n \n tags.sort{ |b,a| b.name.downcase.remover_acentos <=> a.name.downcase.remover_acentos }.each do |tag|\n if options[:relevancia]\n index = ((tag.relevancia.to_f / max_count.to_f) * (classes.size - 1)).to_i\n else\n index = ((tag.total.to_f / max_count.to_f) * (classes.size - 1)).to_i\n end\n # logger.debug(\">>> Max: #{max_count}; tag: #{tag.name}; count: #{tag.total}; class: #{classes[index]}\")\n yield tag, classes[index]\n end\n end\n end",
"def display_words\n words = self.dictionary.map do |dictionary_entry|\n dictionary_entry.word.lexical_item\n end\n words \n end",
"def letter_counts(word)\nend",
"def tags_for_text(uri, text)\n cop_tags = RipperTags::Parser.extract(text)\n # RubyLanguageServer.logger.error(\"cop_tags: #{cop_tags}\")\n # Don't freak out and nuke the outline just because we're in the middle of typing a line and you can't parse the file.\n return nil if (cop_tags.nil? || cop_tags.length == 0)\n tags = cop_tags.map{ |reference|\n name = reference[:name] || 'undefined?'\n kind = SymbolKind[reference[:kind].to_sym] || 7\n kind = 9 if name == 'initialize' # Magical special case\n return_hash = {\n name: name,\n kind: kind,\n location: Location.hash(uri, reference[:line])\n }\n container_name = reference[:full_name].split(/(:{2}|\\#|\\.)/).compact[-3]\n return_hash[:containerName] = container_name if container_name\n return_hash\n }\n tags.reverse.each do |tag|\n child_tags = tags.select{ |child_tag| child_tag[:containerName] == tag[:name]}\n max_line = child_tags.map{ |child_tag| child_tag[:location][:range][:end][:line].to_i }.max || 0\n tag[:location][:range][:end][:line] = [tag[:location][:range][:end][:line], max_line].max\n end\n end",
"def word_sizes(str)\n length_hsh = {}\n\n str.split(' ').each do |word|\n if length_hsh.key?(word.length)\n length_hsh[word.length] += 1\n else\n length_hsh[word.length] = 1\n end\n end\n\n length_hsh\nend",
"def scaled_filter_tag tag, tags\n tags = [tags] unless tags.respond_to?(:collect)\n base = tags.map(&:name).join(' ')\n query = \"#{base} #{tag}\"\n link_to tag, search_tags_path(q: \"#{query}\"),\n style: \"font-size: #{1 + tag.normalized_taggings_count * 1}em;\",\n title: \"show items tagged with: #{query}\"\n end",
"def view\n\t\tcount = 0\n\t\tdark = \"\\u2591\"\n\t\tlight = \"\\u2593\"\n\t\tshade_line_2 = \" \" + (dark*6 + light*6)*4\n\t\tshade_line_1 = \" \" + (light*6 + dark*6)*4\n\t\tbase_letters = \" a b c d e f g h\\n\\n\"\n\t\t(0...@spots.length/8).reverse_each do |i|\n\t\t\tputs count % 2 == 0 ? shade_line_1 : shade_line_2\n\t\t\tprint (i+1).to_s + \" \"\n\t\t\tline = @spots[i*8...(i+1)*8]\n\t\t\tline.each do |spot|\n\t\t\t\tprint count % 2 == 0 ? light*2 : dark*2\n\t\t\t\tif spot[1].img == \" \"\n\t\t\t\t\tprint count % 2 == 0 ? light*2 : dark*2\n\t\t\t\telse\n\t\t\t\t\tprint spot[1].img + \" \"\n\t\t\t\tend\n\t\t\t\tprint count % 2 == 0 ? light*2 : dark*2\n\t\t\t\tcount += 1\n\t\t\tend\n\t\t\tputs \"\"\n\t\t\tputs count % 2 == 0 ? shade_line_1 : shade_line_2\n\t\t\tcount += 1\n\t\tend\n\t\tputs \"\\n\" + base_letters\n\tend",
"def calculate_width(font_size, text)\n @d.pointsize = font_size\n @d.get_type_metrics(@base_image, text.to_s).width\n end",
"def size\n label.to_s.downcase.sub(/\\s+/,'_')\n end",
"def word_sizes(string)\n\n arr_words = string.split \n hash_counts = Hash.new(0)\n\n arr_words.each do |word|\n size = word.size\n hash_counts[size] += 1\n end\n\n hash_counts\nend",
"def prepare_tags()\n\t$currentCase.create_tag(OCR_MUST)\n\t$currentCase.create_tag(OCR_IMAGES_OVER_500KB)\n\t$currentCase.create_tag(OCR_IMAGES_OVER_1MB)\n\t$currentCase.create_tag(OCR_IMAGES_OVER_5MB)\n\t$currentCase.create_tag(OCR_AVG_WORDS_01_20)\n\t$currentCase.create_tag(OCR_AVG_WORDS_21_40)\n\t$currentCase.create_tag(OCR_AVG_WORDS_41_60)\n\t$currentCase.create_tag(OCR_AVG_WORDS_61_80)\n\t$currentCase.create_tag(OCR_AVG_WORDS_81_100)\n\t$currentCase.create_tag(OCR_AVG_WORDS_101)\nend",
"def render_text_size(text = @text)\n lines = render_text_lines(text)\n width = lines.map(&:length).max\n height = lines.length\n { width: width, height: height }\n end",
"def number_word_char_count\n (1..1000).map(&:english_word).join.count_chars\nend",
"def bigram_count()\n\t@corpus.each { |sentence_arr|\n\t prev_word = \"\"\n\t sentence_arr.each { |word|\n\t\tif(prev_word != \"\")\n\t\t @bifreq[prev_word + \" \" + word] += 1\n\t\telse\n\t\t @bifreq[\"PHI \"+word] += 1\n\t\tend \t \t\n\t\tprev_word = word\n\t }\n\t}\n end",
"def word_with_most_repeats(sentence)\n\nend",
"def word_with_most_repeats(sentence)\n\nend",
"def word_sizes(words)\n count_hash = Hash.new(0)\n words.split.each do |word|\n count_hash[word.size] += 1\n end\n p count_hash\nend"
] | [
"0.74840826",
"0.6707534",
"0.6511921",
"0.6246186",
"0.6234064",
"0.61204076",
"0.6075045",
"0.60658044",
"0.6060441",
"0.60526216",
"0.59866494",
"0.5980222",
"0.5972254",
"0.5965879",
"0.594402",
"0.5893685",
"0.5861589",
"0.5854775",
"0.5843645",
"0.5769496",
"0.57649386",
"0.5743311",
"0.57045585",
"0.5694361",
"0.5657049",
"0.5645556",
"0.56420046",
"0.5637338",
"0.56347334",
"0.5627455",
"0.5623889",
"0.56083053",
"0.5596239",
"0.5584645",
"0.5579971",
"0.5557632",
"0.5547896",
"0.5530803",
"0.5519005",
"0.551434",
"0.5512119",
"0.5506522",
"0.55002826",
"0.54977226",
"0.54905975",
"0.5488508",
"0.5484423",
"0.5482755",
"0.5482755",
"0.5482636",
"0.5479393",
"0.5477089",
"0.5471955",
"0.54629266",
"0.54614645",
"0.544714",
"0.54460573",
"0.54338944",
"0.5429898",
"0.5429252",
"0.5427948",
"0.54265946",
"0.54233813",
"0.5422069",
"0.5419203",
"0.5413677",
"0.54075265",
"0.53924483",
"0.53897256",
"0.53843117",
"0.53795654",
"0.5375944",
"0.5368096",
"0.5367292",
"0.5365126",
"0.53648365",
"0.53610826",
"0.5360668",
"0.53455544",
"0.53433806",
"0.5338628",
"0.5329185",
"0.53171927",
"0.5314492",
"0.5313648",
"0.5310589",
"0.53091335",
"0.53058535",
"0.5304536",
"0.53044456",
"0.53019255",
"0.5295822",
"0.5295091",
"0.52829725",
"0.5273465",
"0.5268997",
"0.5268966",
"0.52631867",
"0.52614903",
"0.52614903",
"0.5260569"
] | 0.0 | -1 |
save any relationships that need saving, storing in the reference to the final target | def save(with_id)
@roles.each do |role|
$stderr.puts "Role: #{role.name} '#{role.needs_saving.inspect}'"
if role.needs_saving
role.role.role_user = role.user.save
role.role.role_target = with_id
role.save
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_related\n if self.links.present?\n self.links.each do | link |\n link.parent_type = :action_item\n link.parent_key = self.key\n link.save!\n end\n end\n end",
"def save(processed_map=ObjectMap.new) # use that in Reform::AR.\n processed_map[self] = true\n\n pre_save = self.class.pre_save_representer.new(self)\n pre_save.to_hash(:include => pre_save.twin_names, :processed_map => processed_map) # #save on nested Twins.\n\n\n\n # what we do right now\n # call save on all nested twins - how does that work with dependencies (eg Album needs Song id)?\n # extract all ORM attributes\n # write to model\n\n sync_attrs = self.class.save_representer.new(self).to_hash\n # puts \"sync> #{sync_attrs.inspect}\"\n # this is ORM-specific:\n model.update_attributes(sync_attrs) # this also does `album: #<Album>`\n\n # FIXME: sync again, here, or just id?\n self.id = model.id\n end",
"def save(object)\n tracker.queue(state(object).save(relation))\n self\n end",
"def save(context = :default)\n # Takes a context, but does nothing with it. This is to maintain the\n # same API through out all of dm-more. dm-validations requires a\n # context to be passed\n\n associations_saved = false\n child_associations.each { |a| associations_saved |= a.save }\n\n saved = new_record? ? create : update\n\n if saved\n original_values.clear\n end\n\n parent_associations.each { |a| associations_saved |= a.save }\n\n # We should return true if the model (or any of its associations)\n # were saved.\n (saved | associations_saved) == true\n end",
"def persist_collection_relationships(record)\n record.class.reflect_on_all_associations\n .select { |ref| ref.collection? && !ref.through_reflection && record.association(ref.name).any? }\n .map do |ref|\n [\n ref.has_inverse? ? ref.inverse_of.name : ref.options[:as],\n record.association(ref.name).target\n ]\n end\n .to_h.each do |name, targets|\n targets.each { |t| t.update name => record }\n end\n end",
"def save\n return unless @links || @unlinks\n transaction do\n if @links && @links.length > 0\n @links.each do |record|\n callback(:before_create, record)\n insert_record(record, false, false)\n callback(:after_create, record)\n end\n end\n if @unlinks && @unlinks.length > 0\n if @reflection.options[:dependent] == :destroy\n @unlinks.each do |record|\n callback(:before_destroy, record)\n delete_record(record, false, false)\n callback(:after_destroy, record)\n end\n else\n @unlinks.each { |record| callback(:before_destroy, record) }\n delete_records(@unlinks)\n @unlinks.each { |record| callback(:after_destroy, record) }\n end\n end\n end\n reset_links\n end",
"def save\n self.id = klass.generate_identifier unless persisted? || id\n save_graph = RDF::Graph.new\n fill_save_graph save_graph\n Db.insert_data( save_graph , :graph => klass.object_graph )\n persist!\n end",
"def save!\n follows = []\n # Group the follows by source and build up a list of follows based on it\n @follows.group_by(&:first).each do |source, targets|\n targets = targets.map { |(_, target)| target }\n existing = Follow.where(follower: source, followed: targets).pluck(:followed_id)\n missing = targets - existing\n follows += missing.map { |target| [source, target] }\n end\n\n Follow.import(%i[follower_id followed_id], follows, validate: false)\n follows.each do |(follower_id, followed_id)|\n Feed.client.follow_many([{\n source: \"timeline:#{follower_id}\",\n target: \"profile:#{followed_id}\"\n }], 50)\n end\n end",
"def save_relations(relations)\n current_relations = sobject.relations_as_from\n added_relations = []\n unless relations.nil?\n elements = relations.split(\",\")\n elements.each do |element|\n to_sobject_id = element.split(\"-\")[0]\n relation_id = element.split(\"-\")[1]\n added_relations << add_relation_unless(to_sobject_id,relation_id)\n end\n end\n # remove removed relationships\n (current_relations - added_relations).each { |relation| relation.destroy }\n # fix positions\n added_relations.each_with_index { |relation,index| relation.update_attribute :position, index if relation.valid? }\n end",
"def save\n if self.changed? || self.relationships_changed?\n self._version = current_version + 1\n super\n revise\n end\n end",
"def save\n resources = if loaded?\n entries\n else\n head + tail\n end\n\n # FIXME: remove this once the mutator on the child side\n # is used to store the reference to the parent.\n relate_resources(resources)\n\n resources.concat(@orphans.to_a)\n @orphans.clear\n\n resources.all? { |r| r.save }\n end",
"def save_nodes\n subject.save if subject\n predicate.save if predicate\n object.save if object\n# modifier.save if modifier\n# user.save if user\n# context.save if context\n end",
"def save!\n quest = Quest.new\n quest.parent_id = @parent_id\n quest.main_quest_slides = @main_quest_slides.try(:join, \",\")\n quest.rewards = @achievement ? nil : @rewards\n quest.achievement = @achievement\n quest.id = @quest_id\n quest.save!\n\n @objectives.each do |klass, options|\n objective = klass.new(options)\n objective.quest = quest\n objective.save!\n end\n\n quest\n end",
"def save\n @link.Save\n end",
"def save_associations\n results = []\n self.class.associations.each do | _type, associations |\n associations.each do |association|\n results << association.save(self)\n end\n end\n results.to_promise_when_on_client.to_promise_then do\n self.to_promise\n end\n end",
"def save(*)\n update_magic_properties\n clear_association_cache\n create_or_update\n end",
"def save_everything\r\n\t\tself.pictures = ImageAsset.where(attachable_id: self.id, attachable_type: \"Product\")\r\n\t\tself.pictures.each do |asset|\r\n\t\t\tasset.product_id = self.id\r\n\t\t\tasset.user_id = self.user.id\r\n\t\t\tasset.save!\r\n\t\tend\r\n\t\tif !self.pictures.empty?\r\n\t\t\tself.product_pic = self.pictures.last\r\n\t\tend\r\n\t\tself.feature_groups.each do |f|\r\n\t\t\tf.product = self\r\n\t\t\tf.product_id = self.id\r\n\t\t\tf.save!\r\n\t\tend\r\n\t\t\r\n\tend",
"def save\n on_each_node :save\n end",
"def save_results\n unless self.options[:disable_save] == true\n self.final_path.inject(nil) do |previous, link|\n unless previous.nil? || previous.element.bacon_link.present?\n previous.element.update_attribute(:bacon_link_id, link.element.id)\n end\n link\n end\n end\n\n self.final_path\n end",
"def save\n collections = [participants, people,\n contacts, events, instruments,\n response_sets,\n question_response_sets\n ].map { |c| current_for(c).compact }\n\n ActiveRecord::Base.transaction do\n collections.map { |c| save_collection(c) }.all?.tap do |ok|\n if ok\n logger.debug { \"Re-saving response sets\" }\n current_for(response_sets).select { |rs| rs }.each { |rs| rs.target.reload.save }\n logger.info { 'Merge saved' }\n else\n logger.fatal { 'Errors raised during save; rolling back' }\n raise ActiveRecord::Rollback\n end\n end\n end\n end",
"def persist!\n erase_old_resource\n final_parent << source\n @persisted = true\n end",
"def process_relations\n pending_relations.each_pair do |name, value|\n association = relations[name]\n if value.is_a?(Hash)\n association.nested_builder(value, {}).build(self)\n else\n send(\"#{name}=\", value)\n end\n end\n end",
"def save\n @@all << self\n @@current << self\n end",
"def save\n CONNECTION.execute(\"UPDATE links SET link = '#{self.link}', relative_assignment = '#{self.relative_assignment}' WHERE id = #{self.id};\")\n end",
"def save\n @@all << self #The particular concert's copy of @all\n end",
"def nullify\n target.send(metadata.foreign_key_setter, nil)\n target.send(:remove_instance_variable, \"@#{metadata.inverse(target)}\")\n base.send(:remove_instance_variable, \"@#{metadata.name}\")\n target.save\n end",
"def save(*)\n if super\n promotion_rules.each(&:save)\n end\n end",
"def save(*)\n if super\n promotion_rules.each { |p| p.save }\n end\n end",
"def save_employment\n self.current_stage = :references_stage\n self.save\n true\n end",
"def save_location\n location.attachable = self\n location.save!\n end",
"def run_after_save\n return if append_id.blank?\n return if post_save_resource.id == append_id\n remove_from_old_parent\n add_to_new_parent\n # Re-save to solr unless it's going to be done by save_all\n persister.save(resource: post_save_resource) unless transaction?\n end",
"def update_links\n return if self.suppress_recreate_trigger == true\n \n marc_foreign_objects = Hash.new\n \n # All the allowed relation types *must* be in this array or they will be dropped\n allowed_relations = [\"people\", \"standard_titles\", \"standard_terms\", \"institutions\", \"catalogues\", \"liturgical_feasts\", \"places\"]\n \n # Group all the foreign associations by class, get_all_foreign_associations will just return\n # a flat list of objects\n marc.get_all_foreign_associations.each do |object_id, object|\n next if object.is_a? Source\n \n foreign_class = object.class.name.pluralize.underscore\n marc_foreign_objects[foreign_class] = [] if !marc_foreign_objects.include? (foreign_class)\n \n marc_foreign_objects[foreign_class] << object\n \n end\n \n # allowed_relations explicitly needs to contain the classes we will repond to\n # Log if in the Marc there are \"unknown\" classes, should never happen\n unknown_classes = marc_foreign_objects.keys - allowed_relations\n # If there are unknown classes purge them\n related_classes = marc_foreign_objects.keys - unknown_classes\n \n if !unknown_classes.empty?\n puts \"Tried to relate with the following unknown classes: #{unknown_classes.join(',')}\"\n end\n \n related_classes.each do |foreign_class|\n relation = self.send(foreign_class)\n \n # The foreign class array holds the correct number of object\n # We want to delete or add only the difference betweend\n # what is in marc and what is in the DB relations\n new_items = marc_foreign_objects[foreign_class] - relation.to_a\n remove_items = relation.to_a - marc_foreign_objects[foreign_class]\n \n # Delete or add to the DB relation\n relation.delete(remove_items)\n relation << new_items\n\n # If this item was manipulated, update also the src count\n # Unless the suppress_update_count is set\n if !self.suppress_update_count_trigger\n (new_items + remove_items).each do |o|\n o.update_attribute( :src_count, o.sources.count )\n end\n end\n \n end\n \n # update the parent manuscript when having 773/772 relationships\n update_77x unless self.suppress_update_77x_trigger == true \n end",
"def save\n super save\n end",
"def save(model)\n associated = model.instance_variable_get(\"@#{local_attr}\") # back door, don't want to trigger resolution\n promise = nil\n local_key_value = model.send(local_key)\n if has?\n if has_many?\n if associated\n unless associated.is_a?(Enumerable)\n fail \"#{model.class} expects has_many attr #{local_attr} to be an array or enumerable\"\n end\n associated.each do |a|\n check_associate(model, a, local_key_value, false)\n end\n end\n else # has_one?\n if associated\n check_associate(model, associated, local_key_value, true)\n associated = [associated]\n else\n msg = \" : #{model.class} association #{type} : expected #{local_attr} to be set\"\n trace __FILE__, __LINE__, self, __method__, msg\n # fail msg\n end\n end\n # is model is the owner, then do the database save of associations here\n if associated && owner?\n associated = associated\n promise = save_associates(local_key_value, associated)\n end\n elsif belongs_to? || join?\n check_associate(model, associated, local_key_value, true)\n else\n fail \"unhandled association type #{type}\"\n end\n Robe::Promise.value(promise || model)\n end",
"def save!\n no_recursion do\n _sq_around_original_save do\n super if defined?(super)\n end\n\n save_queue.save!\n end\n end",
"def save_finalized\n\n # finalize it\n state = save\n\n # must assign a slug after saving\n if state && !self.slug \n self.slug = \"#{self.id}\"\n state = save\n end\n\n # must tag after saving - make sure to destroy the note if this fails\n if state && self.id && self.tagstring\n # TODO fix tagging - we are using relationships now instead to tag\n # also ... a relation between two notes can be defined by a tag...\n # we want relationships between two notes explicitly ...\n # Note.find_by_sql(\"DELETE FROM notes_relations WHERE note_id = #{self.id}\")\n # self.tag self.tagstring\n end\n\n return state\n end",
"def save_ref\n if ref = ref_for(nil, false) # Use current user, don't create ref\n ref.save \n end\n end",
"def full_save\n types.each do |t|\n ActiveRDF::FederationManager.add(self, N::RDF::type, t)\n end\n\n ActiveRDF::Query.new(N::URI).distinct(:p,:o).where(self, :p, :o).execute do |p, o|\n ActiveRDF::FederationManager.add(self, p, o)\n end\n end",
"def complete_weak_set\n relation.weaker.each do |r|\n if relation_set(r).blank?\n t = relation_set.build :relation => r\n t._without_inverse = true\n t.save!\n end\n end\n end",
"def save\n response = []\n \n if self.ownership.blank?\n self.ownership = Solve360::Config.config.default_ownership\n end\n \n if new_record?\n response = self.class.request(:post, \"/#{self.class.resource_name}\", to_request)\n \n if !response[\"response\"][\"errors\"]\n self.id = response[\"response\"][\"item\"][\"id\"]\n end\n else\n response = self.class.request(:put, \"/#{self.class.resource_name}/#{id}\", to_request)\n end\n \n if response[\"response\"][\"errors\"]\n message = response[\"response\"][\"errors\"].map {|k,v| \"#{k}: #{v}\" }.join(\"\\n\")\n raise Solve360::SaveFailure, message\n else\n related_items.concat(related_items_to_add)\n\n response\n end\n\n end",
"def assimilate(victims)\n victims = victims.reject {|v| (v.class == self.class) && (v.id == self.id)}\n\n self.class.relationship_dependencies.each do |relationship, models|\n models.each do |model|\n model.transfer(relationship, self, victims)\n end\n end\n\n DB.attempt {\n victims.each(&:delete)\n }.and_if_constraint_fails {\n raise MergeRequestFailed.new(\"Can't complete merge: record still in use\")\n }\n\n trigger_reindex_of_dependants\n end",
"def follow(other)\n active_relationships.create(followed_id: other.id)\nend",
"def cascade_resort_id=(resort_id)\n self.resort_id = resort_id\n save\n children.each {|c| c.cascade_resort_id = resort_id}\n end",
"def save\n unless @added.empty? && @deleted.empty?\n # We cannot reuse the allocated space, since the data\n # that is copied would be destroyed.\n if polymorphic?\n offset = @database.allocate_polymorphic_join_elements(@size)\n else\n offset = @database.allocate_join_elements(@size)\n end\n pairs =\n @size.times.map do |index|\n rod_id = id_for(index)\n if rod_id.is_a?(Model)\n object = rod_id\n if object.new?\n if polymorphic?\n object.reference_updaters <<\n ReferenceUpdater.for_plural(self,index,@database)\n else\n object.reference_updaters <<\n ReferenceUpdater.for_plural(self,index,@database)\n end\n next\n else\n rod_id = object.rod_id\n end\n end\n [rod_id,index]\n end.compact\n if polymorphic?\n pairs.each do |rod_id,index|\n class_id = (rod_id == 0 ? 0 : class_for(index).name_hash)\n @database.set_polymorphic_join_element_id(offset,index,rod_id,class_id)\n end\n else\n pairs.each do |rod_id,index|\n @database.set_join_element_id(offset,index,rod_id)\n end\n end\n @offset = offset\n @added.clear\n @deleted.clear\n @map.clear\n @original_size = @size\n end\n @offset\n end",
"def save\n response = []\n \n if self.ownership.blank?\n self.ownership = Solve360::Config.config.default_ownership\n end\n \n if new_record?\n response = self.class.request(:post, \"/#{self.class.resource_name}\", to_request)\n \n if !response[\"response\"][\"errors\"]\n self.id = response[\"response\"][\"item\"][\"id\"]\n end\n else\n response = self.class.request(:put, \"/#{self.class.resource_name}/#{id}\", to_request)\n end\n \n if response[\"response\"][\"errors\"]\n message = response[\"response\"][\"errors\"].map {|k,v| \"#{k}: #{v}\" }.join(\"\\n\")\n raise Solve360::SaveFailure, message\n else\n related_items.concat(related_items_to_add)\n self.related_items_to_add = []\n\n categories.concat(categories_to_add)\n self.categories_to_add = []\n\n response\n end\n\n end",
"def save\n self.class.save(self)\n end",
"def save!\n object.save!\n end",
"def save_self(safe = true)\n super && embedments.values.each do |e|\n e.loaded?(self) && Array(e.get!(self)).each { |r| r.original_attributes.clear }\n end\n end",
"def <<(object, will_save=true)\n\t\t\t\t\tif object.descendants.include? @parent\n\t\t\t\t\t\tobject.instance_variable_set :@_cyclic, true\n\t\t\t\t\telse\n\t\t\t\t\t\tobject.write_attribute object.parent_id_field, @parent._id\n\t\t\t\t\t\tobject[object.path_field] = @parent[@parent.path_field] + [@parent._id]\n\t\t\t\t\t\tobject[object.depth_field] = @parent[@parent.depth_field] + 1\n\t\t\t\t\t\tobject.instance_variable_set :@_will_move, true\n\t\t\t\t\t\tobject.save if will_save\n\t\t\t\t\tend\n\n\t\t\t\t\tsuper(object)\n\t\t\t\tend",
"def associate_target(object)\n case target_class.associations[target_association][:type]\n when :has_one, :belongs_to\n object.update_attribute(target_attribute, source.id)\n when :has_many, :has_and_belongs_to_many\n object.update_attribute(target_attribute, target_ids.merge(Array(source.id)))\n end\n end",
"def save\n perform_save\n end",
"def handle_save\n if self.valid? && !self.is_straightforward\n user = self.collection.user\n # user.default_collections = user.collections.includes(:games).limit(3)\n # Search default collections for the game\n user.default_collections\n user.default_collections.each do |collection|\n if collection.id == self.collection_id\n next\n else\n collection.games.each do |game|\n if game.id == self.game_id\n self.default_game_collection = CollectionGame.find_by(\n game_id: game.id,\n collection_id: collection.id)\n break\n end\n end\n end\n end\n # If the game is found in the defaults, and the target collection\n # is also default, destroy the previous association.\n if self.default_game_collection\n if user.default_collections.pluck(:id).include?(self.collection_id)\n default_game_collection.is_straightforward = true\n default_game_collection.destroy\n self.to_remove = default_game_collection.collection_id\n end\n #If the game is not yet in the defaults, and the target collection\n #is not a default, create a new association in the defaults\n elsif !user.default_collections.pluck(:id).include?(self.collection_id) &&\n !self.is_straightforward\n cg = CollectionGame.new(\n collection_id: user.default_collections[1].id,\n game_id: self.game_id)\n cg.save!\n self.to_add = user.default_collections[1].id\n end\n end\n\n\n\n end",
"def update_and_save\n self.last_update = Time.now\n self.save!\n\n self.parents.each do |parent|\n parent.update_and_save\n end\n end",
"def delete( object )\n\n write_targets do |target|\n rel = rel_for_object( object )\n target.reject! { |l| l['rel'] == rel }\n end\n\n if (c = @klass.correlation_for( object )) && c.recipocal?\n if self.owner && object.respond_to?( :links )\n if object.links.recipocal?( self.owner )\n object.links.delete( self.owner )\n object.save unless object.new? || @recipocating\n end\n end\n end\n\n self.owner.save if self.owner && !self.owner.new? && !@recipocating\n\n self\n end",
"def belongs_to(goal, options = { })\n self.foreign_keys[goal.foreign_key] = \"references\"\n self.validates(:presence_of, goal.foreign_key)\n self.associate(:belongs_to, goal, options)\n end",
"def associations_after_save\n # # WARNING: the associations here are not using active_record, so they are not auto saved with user intake\n # # we are saving the associations manually here\n # collapse_associations # make obsolete ones = nil\n #\n # TODO: conflicting with 1.6.0 pre-quality. removed to check compatiblity or related errors\n # for remaining, fill login, password details only when login is empty\n # This is a 3 step process\n # \n # Thu Nov 11 00:14:24 IST 2010, ramonrails\n # Link per user, once only. compact.uniq ensures that\n [\"senior\", \"subscriber\", \"caregiver1\", \"caregiver2\", \"caregiver3\"].each do |_what|\n # \n # Sat Nov 20 02:03:52 IST 2010, ramonrails\n # * this logic is required when uset simply toggles the flag and saves\n _user = self.send( _what) # fetch the associated user\n unless _user.blank? || _user.nothing_assigned?\n # * default properties\n _user.autofill_login # create login and password if not already\n _user.lazy_associations[:user_intake] = self\n _user.skip_validation = true # TODO: patch for 1.6.0 release. fix later with business logic, if required\n\n case _what\n when 'senior'\n # _user.save\n # _user.is_halouser_of( group) unless _user.blank? || group.blank? # role\n _user.lazy_roles[:halouser] = group unless _user.blank? || group.blank? # role\n _user.save\n \n when 'subscriber'\n if subscribed_for_self? # senior is same as subscriber\n if was_subscribed_for_self?\n # * user and subscriber are same. not changed\n else\n # * subscriber was different. now same as senior\n self.subscriber_is_user = false # create old condition\n subscriber.is_not_subscriber_of( senior) unless subscriber.blank? || senior.blank? # remove old role first\n # subscriber.delete # remove this extra user\n self.subscriber_is_user = true # back to current situation\n end\n # _user.save\n # _user.is_subscriber_of( senior) unless _user.blank? || senior.blank? # role\n _user.lazy_roles[:subscriber] = senior unless _user.blank? || senior.blank? # role\n _user.save\n\n else # senior different from subscriber\n if was_subscribed_for_self?\n _user = senior.clone_with_profile if senior.equal?( subscriber) # same IDs, clone first\n senior.is_not_subscriber_of( senior) unless senior.blank? # senior was subscriber, not now\n else\n # all good. nothing changed\n end\n # _user.save\n # _user.is_subscriber_of( senior) unless _user.blank? || senior.blank? # role\n _user.lazy_roles[:subscriber] = senior unless _user.blank? || senior.blank? # role\n _user.save\n end\n \n when 'caregiver1'\n if caregiving_subscriber? # subscriber is caregiver\n if was_caregiving_subscriber?\n # all good. nothing changed\n else\n # was separate\n self.subscriber_is_caregiver = false # make old condition\n caregiver1.is_not_caregiver_of( senior) unless caregiver1.blank? || senior.blank?\n # caregiver1.delete # remove extra\n self.subscriber_is_caregiver = true # current condition again\n end\n \n else # subscriber different from caregiver1\n if was_caregiving_subscriber?\n _user = subscriber.clone_with_profile if subscriber.equal?( caregiver1) # same ID? clone first\n subscriber.is_not_caregiver_of( senior) unless subscriber.blank? || senior.blank? # remove caregiving role for subscriber\n else\n # all good. nothing changed\n end\n end\n if caregiving_subscriber? || (caregiver1_required? && _user.something_assigned? && !senior.blank? && !_user.equal?( senior))\n # _user.save\n # _user.is_caregiver_of( senior) unless _user.blank? || senior.blank? || _user.equal?( senior)\n # _user.options_for_senior( senior, mem_caregiver1_options)\n _user.lazy_roles[:caregiver] = senior\n _user.lazy_options[ senior] = mem_caregiver1_options\n _user.save\n # else\n # self.no_caregiver_1 = true\n # self.send(:update_without_callbacks)\n end\n \n when 'caregiver2'\n if caregiver2_required? && _user.something_assigned? && !senior.blank? && !_user.equal?( senior)\n # _user.save\n # _user.is_caregiver_of( senior) unless _user.blank? || senior.blank? || _user.equal?( senior)\n # _user.options_for_senior( senior, mem_caregiver2_options)\n _user.lazy_roles[:caregiver] = senior\n _user.lazy_options[ senior] = mem_caregiver2_options\n _user.save\n else\n self.no_caregiver_2 = true\n self.send(:update_without_callbacks)\n end\n\n when 'caregiver3'\n if caregiver3_required? && _user.something_assigned? && !senior.blank? && !_user.equal?( senior)\n # _user.save\n # _user.is_caregiver_of( senior) unless _user.blank? || senior.blank? || _user.equal?( senior)\n # _user.options_for_senior( senior, mem_caregiver3_options)\n _user.lazy_roles[:caregiver] = senior\n _user.lazy_options[ senior] = mem_caregiver3_options\n _user.save\n else\n self.no_caregiver_3 = true\n self.send(:update_without_callbacks)\n end\n end # case\n end # blank?\n end # _what\n \n # \n # Thu Jan 13 02:38:38 IST 2011, ramonrails\n # * Not required anymore\n # * lazy_associations attaches each user to this user intake\n # #\n # # * replace earlier associations. keep fresh ones\n # # * do not create duplicate associations\n # # QUESTION: what happens to orphaned users here?\n # # * reject new_record? anything not saved does not get assigned\n # # * only associate one copy of each\n # self.users = [senior, subscriber, caregiver1, caregiver2, caregiver3].reject(&:new_record?).compact.uniq\n # # # \n # # # Thu Jan 13 02:34:27 IST 2011, ramonrails\n # # # * pre_quality.feature had error dispatching emails\n # # # * This might dispatch the email more than once\n # # self.users.each(&:dispatch_emails)\n\n\n # [\"senior\", \"subscriber\", \"caregiver1\", \"caregiver2\", \"caregiver3\"].each do |_what|\n # \n # # \n # # Fri Nov 19 03:17:32 IST 2010, ramonrails\n # # * skip saving the object if already saved\n # # * happens when object is shared. subscriber == user, or, subscriber == caregiver\n # # * saving also dispatches emails. A few more triggers/callbacks. Please check model code\n # _skip = ((_what == 'subscriber') && subscribed_for_self?)\n # _skip = (_skip || (_what == 'caregiver1' && caregiving_subscriber?))\n # # \n # # Thu Nov 11 00:32:18 IST 2010, ramonrails\n # # Do not save any non-assigned data, or blank ones\n # unless _user.blank? || _user.nothing_assigned? || _skip\n # _user.skip_validation = true # TODO: patch for 1.6.0 release. fix later with business logic, if required\n # \n # # _user.autofill_login # Step 1: make them valid\n # if _user.save # Step 2: save them to database\n # # \n # # Thu Nov 11 00:13:31 IST 2010, ramonrails\n # # https://redmine.corp.halomonitor.com/issues/3696\n # # caused a bug that created multiple links to the same user\n # self.users << _user unless users.include?( _user) # Step 3: link them to user intake\n # end\n # end\n # end\n # #\n # # * add roles and options\n # # * roles are already handled by user model\n # # * this will not double write the roles\n # # senior\n # senior.is_halouser_of( group) unless senior.blank?\n # # subscriber\n # unless senior.blank? || subscriber.blank?\n # subscriber.is_subscriber_of( senior)\n # subscriber.is_caregiver_of( senior) if caregiving_subscriber?\n # end\n # # Wed Oct 27 23:55:22 IST 2010\n # # * no need to check subscriber_is_caregiver here. that is done in caregiver1 method\n # # * just call for each caregiver and assign position and other options\n # (1..3).each do |index|\n # _caregiver = self.send(\"caregiver#{index}\".to_sym)\n # _required = self.send(\"caregiver#{index}_required?\")\n # unless (_caregiver.blank? || !_required || _caregiver.nothing_assigned?)\n # _caregiver.is_caregiver_of( senior) unless _caregiver.is_caregiver_of?( senior)\n # # \n # # Thu Nov 4 05:57:16 IST 2010, ramonrails\n # # user values were stored with apply_attributes_from_hash\n # # now we persist them into database\n # _options = self.send(\"mem_caregiver#{index}_options\")\n # # \n # # Thu Nov 18 20:58:29 IST 2010, ramonrails\n # # * Do not use any other method here, cyclic dependency can occur\n # _caregiver.options_for_senior( senior, _options)\n # end\n # end\n\n end",
"def update_relations\n # relational saves require an id\n return false unless @id.present?\n # verify we have relational changes before we do work.\n return true unless relation_changes?\n raise \"Unable to update relations for a new object.\" if new?\n # get all the relational changes (both additions and removals)\n additions, removals = relation_change_operations\n\n responses = []\n # Send parallel Parse requests for each of the items to update.\n # since we will have multiple responses, we will track it in array\n [removals, additions].threaded_each do |ops|\n next if ops.empty? #if no operations to be performed, then we are done\n responses << client.update_object(parse_class, @id, ops, session_token: _session_token)\n end\n # check if any of them ended up in error\n has_error = responses.any? { |response| response.error? }\n # if everything was ok, find the last response to be returned and update\n #their fields in case beforeSave made any changes.\n unless has_error || responses.empty?\n result = responses.last.result #last result to come back\n set_attributes!(result)\n end #unless\n has_error == false\n end",
"def cleanup_relationships\n @involved_relationships = self.relationships\n @iterations = @involved_relationships.length\n @iterations.times do |i|\n @involved_relationships[i].destroy\n end\n end",
"def cascade!\n cascades.each do |name|\n if !metadata || !metadata.versioned?\n meta = relations[name]\n strategy = meta.cascade_strategy\n strategy.new(self, meta).cascade\n end\n end\n end",
"def save_references(reference, params)\n reference.attributes = params\n if reference.valid?\n self.current_stage = :statement_stage\n self.reference = reference\n self.save\n return true\n end\n false\n end",
"def add_relationships\n actor_stack.update\n rescue StandardError => e\n message = \"failed to add relationships work #{@work.pid}, #{e.message}\"\n Rails.logger.error message\n raise StandardError, message\n end",
"def save\n CONNECTION.execute(\"UPDATE links SET assignment_id = '#{self.assignment_id}', link = '#{self.link}', type = '#{self.type}', WHERE id = #{self.id};\")\n end",
"def save_object\n end",
"def save_with_frbr\n logger.debug \"Saving with frbr for work\"\n begin\n transaction do\n logger.debug \"**TRACE1**\"\n save! #This will throw an exception if it fails\n logger.debug \"**TRACE2 expression has id #{self.expression_id}**\"\n update_frbr_for_expression_work_relationship(self.updated_by) #This also throws an exception if it fails\n logger.debug \"**TRACE3 - relationship added\"\n end\n rescue Exception => e\n logger.debug \"Exception: #{e.class}: #{e.message}\\n\\t#{e.backtrace.join(\"\\n\\t\")}\"\n\n logger.debug \"**TRACE4**\"\n return false\n end\n\n logger.debug \"TRACEDONE\"\n #Got this far so all good\n return true\n end",
"def ar_save_resource\n @resource.save\n end",
"def _save\n properties\n end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save; end",
"def save_and_apply\n self.save\n self.apply\n end",
"def add_relationship ( user , country_list, rel_type )\n country_list.each do |country_node|\n rel_instance = get_rel_instance rel_type\n rel_instance.from_node = user\n rel_instance.to_node = country_node\n rel_instance.save\n end\n end",
"def persist!\n @snapshot.save!\n @processes.each(&:save!)\n persist_labels\n persist_metrics\n end",
"def safe_save(dmp:)\n dmp.project = safe_save_project(project: dmp.project)\n dmp.contributors_data_management_plans = dmp.contributors_data_management_plans.map do |cdmp|\n safe_save_contributor_data_management_plan(cdmp: cdmp)\n end\n dmp.datasets = safe_save_datasets(datasets: dmp.datasets)\n dmp.save\n dmp.reload\n end",
"def cleanup_relationships\n @involved_relationships = Relationship.where(:cause_id => self.id)\n @iterations = @involved_relationships.length\n @iterations.times do |i|\n @involved_relationships[i].destroy\n end\n end",
"def save\n perform_mapping\n unless self.errors[:data].present?\n save_nested_models\n self.record.save\n end\n end",
"def run\n attributes = @adapter.persistence_attributes(self, @attributes)\n\n parents = @adapter.process_belongs_to(self, attributes)\n persisted = persist_object(@meta[:method], attributes)\n @resource.decorate_record(persisted)\n assign_temp_id(persisted, @meta[:temp_id])\n\n associate_parents(persisted, parents)\n\n children = @adapter.process_has_many(self, persisted)\n\n associate_children(persisted, children) unless @meta[:method] == :destroy\n\n post_process(persisted, parents)\n post_process(persisted, children)\n after_graph_persist = -> { @resource.after_graph_persist(persisted, metadata) }\n add_hook(after_graph_persist, :after_graph_persist)\n before_commit = -> { @resource.before_commit(persisted, metadata) }\n add_hook(before_commit, :before_commit)\n after_commit = -> { @resource.after_commit(persisted, metadata) }\n add_hook(after_commit, :after_commit)\n persisted\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n @@all << self\n end",
"def save\n object.save\n end",
"def save!(*)\n super.tap do\n changes_applied\n end\n end",
"def add_relationship(rel_attr); end",
"def finalize_associations\n @association_reflections.each_value(&:finalize)\n end",
"def cascade_preservation\n self.reload\n if self.can_perform_cascading?\n self.cascading_elements.each do |pib|\n pib.preservation_profile = self.preservation_profile\n pib.save\n end\n end\n end",
"def post_process_insert\n self.new_record = false\n flag_descendants_persisted\n true\n end",
"def save_record!\n game = Game.find_by(little_golem_id: self.little_golem_id)\n if game\n game.red_master ||= self.red_master\n game.blue_master ||= self.blue_master\n game.save!\n else\n save!\n end\n end",
"def save\n self.class.all << self\n end",
"def save\n self.class.all << self\n end",
"def save\n self.class.all << self\n end",
"def save\n self.class.all << self\n end"
] | [
"0.71147573",
"0.6635284",
"0.65061784",
"0.63429606",
"0.6298138",
"0.6297294",
"0.6288878",
"0.6224133",
"0.61287117",
"0.61071855",
"0.60599345",
"0.605781",
"0.6054804",
"0.6050412",
"0.5969446",
"0.5958421",
"0.5930621",
"0.58953774",
"0.58931583",
"0.58112025",
"0.57741714",
"0.5768712",
"0.5766792",
"0.5764275",
"0.57587004",
"0.5744443",
"0.5735885",
"0.5735678",
"0.571496",
"0.5714581",
"0.56969446",
"0.5688349",
"0.56770134",
"0.56639594",
"0.56440854",
"0.5642448",
"0.56187195",
"0.5577",
"0.55736643",
"0.5553326",
"0.55487037",
"0.55374026",
"0.5532405",
"0.5530086",
"0.5523049",
"0.5517767",
"0.55086213",
"0.55055356",
"0.55037737",
"0.5502738",
"0.5501525",
"0.55013317",
"0.54900753",
"0.5475585",
"0.5474051",
"0.5472112",
"0.54717475",
"0.5454939",
"0.5454143",
"0.544715",
"0.54455125",
"0.5444036",
"0.5443448",
"0.54396975",
"0.54382294",
"0.54274553",
"0.5425755",
"0.5425755",
"0.5425755",
"0.5425755",
"0.5425755",
"0.5425755",
"0.5425755",
"0.5425755",
"0.54224056",
"0.54220307",
"0.5410716",
"0.54106617",
"0.5407811",
"0.54051125",
"0.5403167",
"0.53950286",
"0.53950286",
"0.53950286",
"0.53950286",
"0.53950286",
"0.53950286",
"0.53950286",
"0.53950286",
"0.53878856",
"0.538635",
"0.53851235",
"0.53828555",
"0.5382069",
"0.5377685",
"0.53753287",
"0.5361687",
"0.5361687",
"0.5361687",
"0.5361687"
] | 0.54842347 | 53 |
Find out what new roles need filling in, and (at the same time) which ones need saving. We need filling in if 'dont_know' is set or if an email address is given which isn't in the system. It needs saving if it needs filling in or if is has a valid email address | def needs_filling_in?
any_need_filling = false
@roles.select{|r| r.new_entry }.each do |role|
role.needs_saving = role.needs_filling_in = false
if role.dont_know
role.needs_filling_in = true
role.needs_saving = true
elsif !role.email.empty?
role.needs_saving = true
user = User.with_email(role.email)
if user
role.role.role_user = user.user_id
else
role.needs_filling_in = true
role.user.contact.con_email = role.email
end
end
any_need_filling ||= role.needs_filling_in
end
any_need_filling
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_possible_roles\n\tif User.has_role Role.ADMINISTRATOR,session[:roles]\n\t @roles=Role.all\n\t return\n\tend\n\n\t@logged_in_user_role_id = UserRoleMap.getRoleidByUserid(session[:session_user])\n\t#@roles = Role.where(:id => RoleReportTo.select(\"user_role_id\").where(:manager_role_id => @logged_in_user_role_id))\n\t@roles = Role.getRolesByRoleid(RoleReportTo.getUserRoleidByManagerRoleid(@logged_in_user_role_id))\n\thas_volunteer=false\n\t@roles.each do |role|\n\t if role.role == Role.VOLUNTEER\n\t\thas_volunteer=true\n\t\tbreak\n\t end\n\tend\n\tunless has_volunteer\n\t @volunteer_role=Role.where(role:Role.VOLUNTEER)\n\t @volunteer_role.each do |role|\n\t\t@roles.push role\n\t end\n\tend\n end",
"def add_default_role \n\t\tempty_role_id = self.company.roles.find_by_designation(\"none\").id\n\t\tif self.employees.any? \n\t\t\tself.employees.each do |x| \n\t\t\t\tx.skip_password_validation = true\n\t\t\t\tx.update(role_id: empty_role_id)\n\t\t\tend\n\t\tend\n\tend",
"def assign_managers\n\tauto_assigned_managers_roles={Role.CFR_POC => [Role.CFR_FELLOW],\n\t\t\t\t\t\t\t\t Role.VOLUNTEER => [Role.EVENTS_FELLOW],\n\t\t\t\t\t\t\t\t Role.CFR_FELLOW => [Role.CITY_PRESIDENT,Role.NATIONAL_CFR_HEAD],\n\t\t\t\t\t\t\t\t Role.EVENTS_FELLOW => [Role.CITY_PRESIDENT,Role.NATIONAL_EVENTS_HEAD],\n\t\t\t\t\t\t\t\t Role.CITY_FINANCIAL_CONTROLLER=> [Role.NATIONAL_FINANCIAL_CONTROLLER]}\n\t@user_role_maps = UserRoleMap.new\n\t@user_role_maps.assign_attributes({:role_id => @user.role_id, :user_id => @user.id})\n\t@user_role_maps.save(:validate=>false)\n\tuser_role=Role.find(@user.role_id)\n\tif user_role.has_no_managers?\n\t user_manager_map=ReportsTo.new\n\t administrator = Role.where(role: Role.ADMINISTRATOR).first\n\t user_manager_map.assign_attributes(:user_id => @user.id,:manager_id => administrator.id)\n\t user_manager_map.save\n\t return\n\telse\n\t @reports_tos=[]\n\t manager = ReportsTo.new\n\t if @user.manager_id.present?\n\t\tmanager.assign_attributes(:user_id => @user.id, :manager_id => @user.manager_id)\n\t\t@reports_tos.push manager\n\t elsif user_role.role!=Role.CITY_FINANCIAL_CONTROLLER && user_role.role!=Role.CFR_FELLOW\n\t\tflash[:error] = MadConstants.error_message_no_manager_selected\n\t\traise ActiveRecord::Rollback, 'City Level roles not assigned to anybody'\n\t end\n\tend\n\tuser_role = Role.find @user.role_id\n\tauto_assigned_managers_roles[user_role.role].each do |role_name|\n\t @manager=nil\n\t if Role.is_national_level_role? role_name\n\t\t@manager=User.find_single_manager_by_role_name role_name\n\t else\n\t\t@manager=User.find_single_manager_by_role_name_and_city_id role_name,@user.city_id\n\t end\n\t if @manager.nil?\n\t\tflash[:error] = MadConstants.error_message_no_city_or_national_level_managers\n\t\traise ActiveRecord::Rollback, 'City Level roles not assigned to anybody'\n\t end\n\t user_manager_map = ReportsTo.new\n\t user_manager_map.user_id = @user.id\n\t user_manager_map.manager_id = @manager.id\n\t @reports_tos.push user_manager_map\n\tend\n\t@reports_tos.each do |reports_to|\n\t reports_to.save(:validate => false)\n\tend\n end",
"def all_roles_assigned?(roles)\n \n all_roles_assigned = false\n self.board_design_entry_users.reload\n \n roles.each do | role|\n all_roles_assigned = self.board_design_entry_users.detect { |user| \n user.role_id == role.id \n }\n break if !all_roles_assigned\n end\n\n all_roles_assigned != nil\n \n end",
"def set_roles\n roles << Role.user unless has_role?(\"user\")\n as_seller! if @registration_as_seller.to_i == 1\n end",
"def after_create\n super\n check_roles\n end",
"def set_defaults\n\t\tself.email = self.users.first.email if ['student','school_admin','admin'].include? self.role\n\t\tself.uuid = SecureRandom::uuid()\n\t\tself.active = true\n\tend",
"def before_update\n r = Role.find(self.id)\n if r.role_name == 'Administrator' then\n if r.role_name != self.role_name then\n errors.add(:role_name, \"Administrator darf nicht umbenannt werden\")\n self.role_name = r.role_name\n end\n end\n if r.role_name == 'Gast' then\n if r.role_name != self.role_name then\n errors.add(:role_name, \"Gast darf nicht umbenannt werden\")\n self.role_name = r.role_name\n end\n end \n end",
"def update_role\n organisation_change_notice = nil\n @role = Role.find(params[:id])\n \n\tprev_organisation = @role.organisation\n \n\t# if the editing user does have permission to publish CRM, set the role status to 'Pending'\n\t@role.status_id = Status::PENDING.status_id if !PrivilegesHelper.has_permission?(@login, 'CAN_PUBLISH_CRM')\n\t\n\tis_contributor = @role.is_contributor\n\tis_contributor = params[:role][:is_contributor] if (@role.contributor.blank? && !params[:role][:is_contributor].blank?) || (! @role.contributor.blank? && @role.contributor_info_empty?)\n\t\n\t@role.send('is_contributor=', is_contributor)\n\tparams[:role][:is_contributor] = is_contributor\n\t\n\tif !params[:role][:role_type_id].blank? && @role.is_a_contributor? && !RoleType.contributor_role_types.include?(RoleType.find(params[:role][:role_type_id]))\n \n\t flash[:error] = \"An error has occured. You cannot change the role type to a non-contributor type if 'Contributor' field is checked.\"\n\t \n\t redirect_to :action => 'edit', :id => @role\n\t\n\telse\n\t\t\t\n\t if @role.update_attributes(params[:role])\n\n\t if ! @role.person_id.blank? && !params[:role][:organisation_id].blank?\n\t\t # create default_contactinfos\n\t\t # for every person's contactinfo and appropriate\n\t\t # organisation contactinfo\n\t\t @role.default_contactinfos_update\n\t end \n\t \t \n organisation_change_notice=\"\"\n # role has been assigned an organisation\n if ! @role.person_id.blank? && !params[:role][:organisation_id].blank?\n\t \n\t # destroy marketing categorisation of the person from the db\n\t # as person gets marketing categorisation of the organisation\n\t @role.role_categorizations.each do |rc|\n\t \t rc.destroy\n\t end\n\t \n organisation_change_notice = \"<br/> The organisation has been changed. Please check and update the contact information and make sure that it is consistent.\"\n end\n \n # delete default_contactinfo if organisation was previously\n # assigned to a role together with person but has been deleted\n if @role.organisation_id.blank? && !@role.person_id.blank? && !prev_organisation.blank?\n # do we need to default it to 'Person' or 'preferred' contact infos????\n \t # if yes, just call @role.default_contactinfos_update instead of the line below\n\t\t @role.delete_default_contactinfos(prev_organisation.organisation_id)\n end\n \n # update all role role_contactinfos for\n # solr indexing\n RoleContactinfo.index_objects(@role.role_contactinfos)\n \n # update all communications for\n # solr indexing\n Communication.index_objects(@role.communications)\n \n # update appropriate person if any\n # for solr idexing\n if ! @role.person.blank?\n @role.person.save\n end\n\n # destroy contributor record if 'is_contributor' of the role set to false\n @role.contributor.destroy_self if ! @role.contributor.blank? && ! @role.is_a_contributor?\n\n flash[:notice] = 'Role was successfully updated.' + organisation_change_notice\n redirect_to :action => 'edit', :id => @role\n else\n @person = @role.person\n @organisation = @role.organisation unless @role.organisation.blank?\n render :action => 'edit', :id => @role\n end\n \n\tend\n \n end",
"def update\n additional_user = UsrAdditionalUser.all\n @user_contact_edit = UsrContact.find(id = current_usr_contact.id)\n if @user_contact_edit.update(usr_contact_params)\n\n @emailSet = []\n @emailAdd = params[:usr_contact][:usr_contact_vendors_attributes][\"0\"][:usr_vendor_property_attributes][:usr_additional_users_attributes]\n #Rails.logger.debug(\"My object at update: #{@emailAdd.inspect}\")\n\n if @emailAdd != nil\n @emailAdd.each do |key, value|\n\t\tif value[:email] != \"\"\n @emailSet << value[:email]\n additionalUseremail = value[:email]\n additionalUserRole = value[:role]\n UsrMailer.usr_additional_signup(additionalUseremail, additionalUserRole).deliver_now\n\t\tend\n end\n end\n\n # additioanal user save\n additional_user.each do |additioalUser|\n if (additioalUser.email == params[:usr_contact][:email])\n contact_id = UsrContact.find_by_email(params[:usr_contact][:email]).id # get userContat_id by filtering the given email address\n additional_user_roles = additional_user.find_by_email( params[:usr_contact][:email]).role # take additional users all rols as string comma separated\n roles_array = additional_user_roles.split(\",\") # split and convert into array\n roles_array.each do |val|\n role_id = UsrRole.find_by_role_name(val).id #get role_id by role name\n @usr_contact_role = UsrContactRole.new(:usr_contact_id=>contact_id, :usr_role_id=>role_id) #save contact_id and role_id to the\n @usr_contact_role.save\n end\n end\n end\n\n redirect_to root_path, notice: 'Usr vendor property was successfully updated.'\n else\n render :new, notice: 'Usr vendor property was not updated successfully.'\n end\n end",
"def create\n @member = Member.new(params[:member]) \n @roles = Role.find(:all)\n @last_update = Member.last.created_at\n @area_code = @member.home_phone.slice(1,3)\n @valid_area_codes = AreaCode.find(:all)\n\n checked_roles = []\n checked_params = params[:role_list] || []\n for check_box_id in checked_params\n role = Role.find(check_box_id)\n if not @member.user.roles.include?(role)\n @member.user.roles << role\n end\n checked_roles << role\n end\n\nif params[:caf_nickname].present?\n\nredirect_to members_application_error_path, :notice => 'Error: One of the values entered is not valid.' \n\nelsif @last_update > (Time.zone.now - 5.minute)\n\nredirect_to members_application_error_path, :notice => 'Error: Application Form Currently Unavailable.' \n\nelsif !@valid_area_codes.any? {|h| h['area_code'] == @area_code.to_i}\n\nredirect_to members_application_error_path, :notice => 'Error: One of the values entered is not valid [ac]'\n\nelse\n\n respond_to do |format| \n\n if @member.save\n if params[:Submit] == \"Submit Application\" \n MemberApplicationNotifier.created(@member).deliver\n format.html { redirect_to member_application_received_path(:id => @member), :notice => 'Application was successfully submitted and a copy has been emailed for your records.' }\n format.json { head :ok }\n else\n format.html { redirect_to @member, :notice => 'Member was successfully created.' }\n format.json { render :json => @member, :status => :created, :location => @member }\n end\n else\n if params[:Submit] == \"Submit Application\" \n format.html { render :action => \"member_application\", :notice => 'form error1.' }\n else\n format.html { render :action => \"member_application\", :notice => 'form error2.' }\n format.json { render :json => @member.errors, :status => :unprocessable_entity }\n end\n end\n end\nend\n end",
"def create_staff_for_education_organization(roles, required)\n members = []\n if !required.nil? and required.size > 0\n required[\"staff\"].each do |member|\n # skip this entry if its an Educator --> handled in 'create_teachers' method\n next if [\"Student\", \"Educator\"].include? member[:role]\n\n @num_staff_members += 1\n members << {\"id\" => member[:staff_id], \"role\" => member[:role], \"name\" => member[:name], \"begin\" => member[:begin], \"end\" => member[:end]}\n for index in (0..(roles.size - 1)) do\n if Roles.to_string(roles[index]) == member[:role]\n @log.info \"Removing role: #{member[:role]} from default roles --> specified by member in staff catalog.\"\n roles.delete_at(index)\n break\n end\n end\n end\n end\n if !roles.nil? and roles.size > 0\n for index in (0..(roles.size - 1)) do\n @num_staff_members += 1\n members << {\"id\" => @num_staff_members, \"role\" => roles[index]}\n end\n end\n members\n end",
"def validate_roles(new_roles)\n Rails.logger.debug(\"* UserRoles - validate_roles - #{self.username.to_s} new_roles:#{new_roles.inspect.to_s}\")\n new_roles = (to_array_if_not(new_roles) | DEFAULT_ROLES)\n Rails.logger.debug(\"* UserRoles - validate_roles - (new_roles | DEFAULT_ROLES):#{(new_roles | DEFAULT_ROLES).inspect.to_s}\")\n new_roles.each do |role|\n if !valid_role? (role)\n new_roles.delete(role)\n end\n end\n Rails.logger.debug(\"* UserRoles - validate_roles - #{self.username.to_s} new_roles:#{new_roles.inspect.to_s}\")\n return new_roles.join(' ')\n end",
"def create_user_information # for new users. runs last according to rails.\n self.dj_name = name\n self.roles = Role.where(:title => 'noob')\n self.active = true\n set_password\n end",
"def rebuild_accessibilities( emails=nil )\r\n emails ||= self.contact_people.collect{ |contact| contact.email }\r\n emails << self.email\r\n StoreUser.transaction do\r\n StoreUser.update_all( \"erp_account_number = NULL\", [\"erp_account_number = ?\", self.account_num] )\r\n StoreUser.update_all(\r\n \"erp_account_number = '#{self.account_num}'\",\r\n ['email_address in (?)', emails]\r\n ) unless emails.empty?\r\n end\r\n end",
"def ensure_there_is_a_role\n if role.blank?\n self.role = \"student\"\n end\n end",
"def update_roles\r\n self.roles.create(:title => \"admin\")\r\n if self.name.eql? \"Grandor Eldoran\"\r\n self.roles.create(:title => \"admin\")\r\n elsif self.name.eql? \"Test2 Test2\"\r\n self.roles.create(:title => \"member\")\r\n end\r\n end",
"def check_role!\n add_role :user if roles.blank?\n if has_role?(:admin)\n add_role :editor unless has_role?(:editor)\n add_role :user unless has_role?(:user)\n end\n end",
"def assign_roles\n roles_map.each do |role_obj|\n Authentication::Account.find_by_email(role_obj['email']).update_attributes(roles: role_obj['roles'])\n end\n end",
"def save(role_name, aff_id, reg_id, target_type, target)\n count = 0\n @roles.each do |role|\n if role.needs_saving\n Role.add(role.new_user_id, aff_id, reg_id, role_name, target_type, target)\n count += 1\n end\n end\n count\n end",
"def check_role_update\n unless current_user.is_admin?\n params[:user][:is_admin] = \"0\"\n params[:user][:is_moderator] = \"0\"\n params[:user][:is_sales] = \"0\"\n end\n end",
"def setup_combined_user_roles\n Rails.logger.debug(\" #{self.name.to_s}.#{__method__}(#{@combined_user_roles.present? ? 'True' : 'False'})\")\n return @combined_user_roles if @combined_user_roles.present?\n rc = false\n role = []\n role = assigned_groups.map do |rg|\n UserGroupRole.list_user_roles(rg)\n end\n if role.present?\n role += assigned_roles\n role += assigned_groups\n @combined_user_roles = roles = role.flatten.uniq\n rc = true\n end\n Rails.logger.debug(\" #{self.name.to_s}.#{__method__}(#{@combined_user_roles.present? ? 'True' : 'False'}) Persisted=#{rc} #{}Roles=#{@combined_user_roles.length}\")\n rc\n end",
"def modify_roles(email, role)\n\t\tresponse = @client.execute(api_method: @service.acl.insert,\n\t\t\t\t\t parameters: {'calendarId' => ENV['NSCS_Calendar_ID']}, body: JSON.dump({role: role, scope: {type: \"user\", \"value\": email}}))\n\tend",
"def regenerate?\r\n admin? or own? or invited?\r\n end",
"def check_role_description\n if role_id == PersonItemRole['Moderator'].id\n role_desc = UserInterfaceSetting.where({:key => 'moderator_role'}).first\n if role_desc\n self.description = role_desc._value\n end\n elsif role_id == PersonItemRole['OtherParticipant'].id\n role_desc = UserInterfaceSetting.where({:key => 'other_role'}).first\n if role_desc\n self.description = role_desc._value\n end\n elsif role_id == PersonItemRole['Participant'].id\n role_desc = UserInterfaceSetting.where({:key => 'participant_role'}).first\n if role_desc\n self.description = role_desc._value\n end\n else\n self.description = nil if self.description != nil\n end\n end",
"def setup_role\n if self.role_ids.empty?\n self.role_ids = self.roles.find_by_name(:registered).id\n end\n end",
"def create\n @user = User.new(user_params)\n\n if roles = params[:user][:roles]\n roles.map { |r| r.downcase }.each do |role|\n unless role.empty?\n @user.roles << Role.new(type: role)\n\n if role == \"admin\"\n respond_to do |format|\n if @user.save\n format.html { redirect_to (flash[:redirect] || :attendees), notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end\n\n if role == \"staff\"\n redirect_to get_staff_list_path\n end\n\n end\n end\n end\n end",
"def assign_language_reviewer\n if !params[:language][:email].blank? && !params[:language][:script].empty?\n @user = User.find_by_email(params[:language][:email].split(',').first) \n if @user\n @language = Language.find(params[:language][:script]) \n @reviewers_languages = @user.languages.find_by_id(@language)\n if @reviewers_languages\n flash[:errors] = \"You have already assigned this reviewer to language\"\n redirect_to assign_reviewer_path\n else\n @user.languages << @language\n flash[:notice] = @user.name+\" has been assigned reviewer role successfully.\"\n redirect_to assign_reviewer_path\n UserMailer.delay(:queue=>\"mailer\").assign_language_reviewer(@user,@language.name)\n end\n else\n flash[:errors] = \"User does not exist\"\n redirect_to assign_reviewer_path\n end\n else\n redirect_to assign_reviewer_path\n flash[:errors] = \"language can't be blank\" if params[:language][:script].empty?\n flash[:errors] = \"email can't be blank\" if params[:language][:email].blank?\n end\n end",
"def validates_role\n self.role = Role.find_by_name \"Technician\" if self.role.nil?\n end",
"def make_account_holder(save_after = true)\n self.roles << Role.find_by_title('account_holder')\n self.save if save_after\n end",
"def create\n # # Why RAW SQL? Because the ORM version was SUPER slow! More than 30 secs to exeucte. Hence, this.\n # query = \"SELECT U.* FROM `users` U \n # INNER JOIN `user_role_maps` RM ON RM.user_id=U.id\n # INNER JOIN `roles` R ON R.id=RM.role_id\n # WHERE R.role='Volunteer' AND U.`phone_no` = '\"+user_params[:phone_no]+\"' AND U.is_deleted='0'\"\n # user = User.find_by_sql query\n\n # User login possibilites...\n # Phone number not found.\n # Found - but deleted(is_deleted = 1)\n # Role is not 'Volunteer'\n # Role is not assigned. At all.\n user = User.find_by_phone_no user_params[:phone_no]\n\n # Phone number not found.\n unless user\n #raise ActionController::RoutingError.new('Not Found')\n @data = {\n :id => 0,\n :is_fc => 0,\n :message => \"Couldn't find any users with that phone number(\" + user_params[:phone_no] + \")\",\n }\n else\n\n # Found - but deleted(is_deleted = 1)\n if(user[:is_deleted] == '1')\n @data = {\n :id => 0,\n :is_fc => 0,\n :message => \"User '\" + user[:first_name] + \" \" + user[:last_name] + \"' has been deleted from the system.\"\n }\n else\n roles_query = \"SELECT R.* FROM `user_role_maps` RM \n INNER JOIN `roles` R ON R.id=RM.role_id\n WHERE RM.user_id='\" + user[:id].to_s + \"'\"\n roles = Role.find_by_sql roles_query\n\n is_fc = 0\n vol = 0\n\n puts roles.inspect\n\n roles.each { |role|\n # Role is not 'Volunteer'\n # Role is not assigned. At all.\n if role[:role] == \"Volunteer\"\n vol = 1\n elsif role[:role] == \"Finance Fellow\"\n is_fc = 1\n end\n }\n\n\n if vol == 0\n @data = {\n :id => 0,\n :is_fc => 0,\n :message => \"User '\" + user[:first_name] + \" \" + user[:last_name] + \"' is not assigned a POC. Please let your CFR Fellow know.\"\n }\n else\n @data = {\n :id => user[:id],\n :is_fc => is_fc,\n :message => \"Login successful.\"\n }\n end\n end\n end\n end",
"def update\n #found_role = Role.where(:id=> UserRoleMap.select(\"role_id\").where(:user_id => @user.id)).first\n # found_roles = Role.getRolesByRoleid(UserRoleMap.getRoleidByUserid(@user.id))\n # found_role = found_roles.to_a[0]\n # @selected_role = found_role.id\n # @user.assign_attributes(:role_id => found_role.id)\n\n # Assign user the selected Roles\n @user.assign_attributes(:role_id => user_params[:role_id])\n\n @disabled=true\n @user.assign_attributes({:first_name => user_params[:first_name],\n :last_name => user_params[:last_name],\n :email => user_params[:email],\n :city_id => user_params[:city_id],\n :phone_no => user_params[:phone_no],\n :address => user_params[:address],\n :manager_id => user_params[:manager_id]\n })\n cost = 10\n encrypted_password = ::BCrypt::Password.create(\"#{user_params[:password]}#{nil}\", :cost => cost).to_s\n @user.assign_attributes(:encrypted_password => encrypted_password, :password => user_params[:password])\n @user.transaction do\n begin\n if @user.save\n UserRoleMap.delete_all(:user_id=> @user.id)\n @reports_tos= ReportsTo.where(:user_id=> @user.id)\n if @reports_tos.present?\n @reports_tos=ReportsTo.delete_all(:user_id=> @user.id)\n end\n assign_managers\n respond_to do |format|\n format.html {redirect_to @user, notice: 'Users was successfully updated.'}\n end\n else\n respond_to do |format|\n format.html {render action: 'edit'}\n populate_user_managers_value(\"\",\"\")\n end \n end\n rescue ActiveRecord::Rollback\n handle_rollback\n end\n end\n end",
"def default_roles\n if self.user_type == \"admin\"\n self.role_ids = 1\n elsif self.user_type == \"student\"\n self.role_ids = 10\n end\n end",
"def check_if_approval_is_required\n check_by_families || check_by_supplier || check_by_project ||\n check_by_office || check_by_company || check_by_zone\n end",
"def save\r\n column_counts = [0] * NUMBER_OF_COLUMNS\r\n columns = [nil] * NUMBER_OF_COLUMNS\r\n\r\n (0...@csv.first.count).each do |index|\r\n column = @column_hash[index.to_s].to_i\r\n columns[column] = index\r\n column_counts[column] += 1\r\n end\r\n\r\n # Check to make sure all of the required columns are provided.\r\n if column_counts[COLUMN_EMAIL] == 1 &&\r\n (column_counts[COLUMN_FULL_NAME] == 1 ||\r\n (column_counts[COLUMN_FIRST_NAME] == 1 &&\r\n column_counts[COLUMN_LAST_NAME] == 1))\r\n\r\n course_role = CourseRole.find(@course_role_id)\r\n\r\n start = @has_headers ? 1 : 0\r\n @csv[start..-1].each do |row|\r\n email = row[columns[COLUMN_EMAIL]]\r\n\r\n if columns[COLUMN_FULL_NAME]\r\n # If the full name column was provided, parse it to get the first\r\n # and last names separately (they must be comma-delimited).\r\n full_name = row[columns[COLUMN_FULL_NAME]]\r\n else\r\n # Otherwise, just pull the first and last names from their own\r\n # columns and merge them into a full name.\r\n full_name = [\r\n row[columns[COLUMN_FIRST_NAME]],\r\n row[columns[COLUMN_LAST_NAME]]\r\n ].reject { |name| name.blank? }.join(' ')\r\n end\r\n\r\n if columns[COLUMN_PASSWORD]\r\n password = row[columns[COLUMN_PASSWORD]]\r\n else\r\n # A User record cannot be saved without a password, so if none is\r\n # provided we create a random one.\r\n password = Devise.friendly_token.first(20)\r\n end\r\n\r\n if columns[COLUMN_FIRST_NAME] && columns[COLUMN_LAST_NAME]\r\n first_name = row[columns[COLUMN_FIRST_NAME]]\r\n last_name = row[columns[COLUMN_LAST_NAME]]\r\n elsif not(full_name.nil?)\r\n # needs a first and last name so extract it from full name\r\n first_name = full_name.split(\" \").first\r\n last_name = full_name.split(\" \").second\r\n else\r\n first_name = \"No\"\r\n last_name = \"Name\"\r\n end\r\n\r\n user = User.where(email: email).first\r\n\r\n if !user\r\n # The user doesn't exist yet, so create him/her and enroll in the\r\n # course.\r\n user = User.create(\r\n email: email,\r\n first_name: first_name,\r\n last_name: last_name,\r\n password: password)\r\n\r\n enrollment = CourseEnrollment.create(\r\n course_offering: @course_offering,\r\n user: user,\r\n course_role: course_role)\r\n\r\n users_created << user\r\n users_enrolled << user\r\n else\r\n # If the user already exists, only enroll him/her if not already\r\n # enrolled in the course.\r\n unless CourseEnrollment.where(\r\n course_offering_id: @course_offering.id,\r\n user_id: user.id).exists?\r\n\r\n enrollment = CourseEnrollment.create(\r\n course_offering: @course_offering,\r\n user: user,\r\n course_role: course_role)\r\n\r\n users_enrolled << user\r\n end\r\n end\r\n end\r\n\r\n true\r\n else\r\n false\r\n end\r\n end",
"def add_pending_role\n self.user.add_role :teacher\n self.user.role_pending = true\n self.user.save\n end",
"def data_for_role_new\n {}\n end",
"def check_default_role\n roles << :user if roles.empty?\n end",
"def populate_user_managers_value(role_param, city_param)\n\t@role_has_managers=true\n\t@disabled=true\n\tset_possible_roles \n\t@managers = [] \n\tif role_param=='' || city_param==''\n\t #found_role = Role.where(:id=> UserRoleMap.select(\"role_id\").where(:user_id => @user.id)).first\n\t found_roles = Role.getRolesByRoleid(UserRoleMap.getRoleidByUserid(@user.id))\n\t found_role = found_roles.to_a[0]\n\t found_city_id = @user.city_id\n\telse\n\t found_role= Role.find role_param\n\t found_city_id= city_param\n\t \n\t @disabled=false\n\tend\n\t if found_role.present?\n\t\t@selected_role = found_role.id \n\t\t@user.role_id= @selected_role \n\t\t\n\t\tselectable_manager_roles={Role.CFR_POC => Role.CITY_FINANCIAL_CONTROLLER,\n\t\t\t\t\t\t\t\t Role.VOLUNTEER => Role.CFR_POC,\n\t\t\t\t\t\t\t\t Role.EVENTS_FELLOW => Role.CITY_FINANCIAL_CONTROLLER,\n\t\t\t\t\t\t\t\t Role.CITY_PRESIDENT => Role.ADMINISTRATOR,\n\t\t\t\t\t\t\t\t Role.NATIONAL_EVENTS_HEAD => Role.ADMINISTRATOR,\n\t\t\t\t\t\t\t\t Role.NATIONAL_CFR_HEAD => Role.ADMINISTRATOR,\n\t\t\t\t\t\t\t\t Role.NATIONAL_FINANCIAL_CONTROLLER=>Role.ADMINISTRATOR}\n\t\trole = found_role\n\t\t@user_role_by_city = UserRoleMap.userRoleByCity(@selected_role,found_city_id)\n\t\t@manager_disabled=true\n\t\tif @user_role_by_city.present?\n\t\t if role == Role.CITY_PRESIDENT || role == Role.CFR_FELLOW || role == Role.EVENTS_FELLOW\n\t\t\t@is_edit_user = false \n\t\t else\n\t\t\t@is_edit_user = true \n\t\t end\n\t\tend\n\n\t\tunless found_role.has_no_selectable_managers?\n\t\t @selected_manager= []\n\t\t @manager_role_name=selectable_manager_roles[found_role.role]\n\t\t @managers=User.find_managers_by_role_name_and_city_id @manager_role_name,@user.city_id\n\t\t #@current_managers= User.where(:id=>ReportsTo.select(\"manager_id\").where(:user_id=> @user.id),:is_deleted =>0)\n\t\t @current_managers = User.getUserByID(ReportsTo.getManageridByUserid(@user.id))\n\t\t @managers.each do |manager|\n\t\t\t@current_managers.each do |curr_manager|\n\t\t\t if manager.id==curr_manager.id\n\t\t\t\t@selected_manager.push manager.id\n\t\t\t\t@user.manager_id= manager.id\n\t\t\t else\n\t\t\t\t@manager_disabled=false\n\t\t\t end\n\t\t\tend\n\t\t\t\n\t\t end\n\t\t if @managers.blank?\n\t\t\t@manager_disabled= true\n\t\t else\n\t\t\t@role_has_managers =true\n\t\t\t@manager_disabled= false\n\t\t end\n\t\tend\n\t end\n end",
"def save\n if new_record? && valid? && !self.class.exists?(name) \n RoleControls.add_role(name)\n RoleControls.save_changes\n @saved = true\n elsif !new_record? && valid?\n if name_changed? && !@previous_name.eql?(name)\n RoleControls.remove_role @previous_name\n RoleControls.add_role name\n end\n if users_changed?\n RoleControls.assign_users(users, name)\n end\n\n RoleControls.save_changes\n @saved = true\n elsif new_record? && valid? && self.class.exists?(name)\n errors.add(:name, \"Group name already exists\")\n else \n @saved = false\n end \n\n changed.clear if @saved \n @saved\n end",
"def valid_assignment\n\t\tunless role.nil? || user.nil?\n\t\t\tif is_there_a_sysadmin? && role.name.eql?(\"System Admin\")\n\t\t\t\terrors.add_to_base('There is already a '+role.name+'. You must deactivate the current '+role.name+' before assigning a new one')\n\t\t\tend\n\t\t\t\n\t\t\tif is_there_a_vp? && role.name.eql?(\"VP of Finance\")\n\t\t\t\terrors.add_to_base('There is already a '+role.name+'. You must deactivate the current '+role.name+' before assigning a new one')\n\t\t\tend\n\n\t\t\tunless (role.name.eql?(\"VP of Finance\") || role.name.eql?(\"System Admin\"))\n\t\t\t\tif(is_there_another_active(self))\n\t\t\t\t\terrors.add_to_base('There is already a '+role.name+'. You must deactivate the current '+role.name+' before assigning a new one')\n\t\t\t\tend\t\n\t\t\tend\n\t\tend\n\tend",
"def create\n @organisme = Organisme.find(params[:organisme_id])\n @employe = Employe.new(employe_params)\n if params[:add_education]\n @options = Organisme.order(\"name\").all.\n collect do |s|\n [s.name, s.id]\n end\n @employe.educations.build\n render :action => 'new'\n elsif params[:remove_education]\n @options = Organisme.order(\"name\").all.\n collect do |s|\n [s.name, s.id]\n end\n render :action => 'new'\n else\n respond_to do |format|\n if @employe.save\n #check if user exists already\n count = User.where(:email => @employe.courriel).count\n if count == 0\n User.create!({:email => @employe.courriel, :password => \"password\", :password_confirmation => \"password\", :superadmin_role => @employe.role == \"Directeur\", :supervisor_role => @employe.role == \"Coordonnateur\" || @employe.role == \"Intervenant\", :user_role => true})\n end\n @organisme = Organisme.find(params[:organisme_id])\n format.html { redirect_to @organisme, notice: 'Employe was successfully created.' }\n format.json { render :show, status: :created, location: @employe }\n else\n @options = Organisme.order(\"name\").all.\n collect do |s|\n [s.name, s.id]\n end\n format.html { render :new }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def set_roles(wanted_roles)\n current_roles = roles.map(&:name)\n\n remove = current_roles.reject { |r| wanted_roles.include?(r) }\n add = wanted_roles.reject { |r| current_roles.include?(r) }\n\n Ruolo.configuration.connection.transaction do\n remove.each do |role|\n remove_role(Ruolo::Models::Role.where(name: role).first)\n end\n\n add.each do |role|\n add_role(Ruolo::Models::Role.where(name: role).first)\n end\n end\n end",
"def handle_admin_role_ids(role)\n current_members = send(role.to_s.pluralize)\n new_members = Person.find(send(\"#{role}_ids\"))\n\n to_add = new_members - current_members\n to_remove = current_members - new_members\n to_add.each do |person|\n person.send(\"is_#{role}=\", [true, self])\n disable_authorization_checks { person.save! }\n end\n to_remove.each do |person|\n person.send(\"is_#{role}=\", [false, self])\n disable_authorization_checks { person.save! }\n end\n end",
"def handle_admin_role_ids(role)\n current_members = send(role.to_s.pluralize)\n new_members = Person.find(send(\"#{role}_ids\"))\n\n to_add = new_members - current_members\n to_remove = current_members - new_members\n to_add.each do |person|\n person.send(\"is_#{role}=\", [true, self])\n disable_authorization_checks { person.save! }\n end\n to_remove.each do |person|\n person.send(\"is_#{role}=\", [false, self])\n disable_authorization_checks { person.save! }\n end\n end",
"def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"def setup_role \n if self.role_ids.empty? \n self.role_ids = [Role.find_by_name(\"User\").id] \n end\n end",
"def get_roles(email)\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end",
"def reenviar_usuario\n @bandera = false\n if user_signed_in?\n unless current_user.employee.nil?\n @permiso_reenviar_usuario = false\n @security_role_type = Security::RoleType.find_by(name: \"Reenviar Usuario\").name\n current_user.employee.security_profile.security_role.security_role_menus.each do |security_role_menu| \n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type|\n if @security_role_type == role_type.security_role_type.name\n @permiso_reenviar_usuario = true\n break\n elsif role_type.security_role_type.name == \"Consultar\"\n @bandera = true\n end\n end\n end\n end\n if current_user.username == \"aadmin\"\n @permiso_reenviar_usuario = true\n end\n if @bandera == true\n elsif params[:action] == \"forget_username_list\" && @permiso_reenviar_usuario == false\n redirect_to root_path\n end\n return @permiso_reenviar_usuario\n end\n end\n end",
"def propagate_roles_needed(task_name) \n \n #All recipes besides server have the same name in their body; thus task_name usually is\n #Recipe.name. However, if you are executing a task that appears\n #as 'server_display' in the dropdown menu, it is actually named 'server' in the \n #recipes and in the database.\n if(task_name!=\"server_display\")\n recipe_to_run=Recipe.find_by_name(task_name) \n else \n recipe_to_run = Recipe.find_by_name(\"server\")\n if !recipe_to_run.role_needed then\n #Check if the recipe chosen to run on this deployment is a predefined recipe\n #that does not require a parameter, i.e. a specific ip_address list.\n #check to see that current_stage has all roles needed for the recipes it has,\n #otherwise propagate them.\n recipe_types = recipe_to_run.server_types #aggregating the server_types for all recipes in this stage\n recipe_types.each{|t| \n if !current_stage.roles.map{|r|r.name}.include?(t.name)then\n \n #propagate a role for every host that fits type t:\n t.hosts.each do |h|\n if(t.name==\"db\")\n @role = current_stage.roles.build({\"no_release\"=>\"0\", \"name\"=>t.name, \"primary\"=>\"1\", \"ssh_port\"=>\"\", \"no_symlink\"=>\"0\", \"host_id\"=>h.id})\n else\n @role = current_stage.roles.build({\"no_release\"=>\"0\", \"name\"=>t.name, \"primary\"=>\"0\", \"ssh_port\"=>\"\", \"no_symlink\"=>\"0\", \"host_id\"=>h.id})\n end\n if(!@role.save)\n RAILS_DEFAULT_LOGGER.error(\"could not save the given role #{t.name} on host #{h.name}\");\n end\n end\n \n end\n \n }\n end \n end\n end",
"def will_save_change_to_email?\n changed.include? 'email'\n end",
"def associations_before_validation_and_save\n collapse_associations # make obsolete ones = nil\n #\n # TODO: conflicting with 1.6.0 pre-quality. removed to check compatiblity or related errors\n # for remaining, fill login, password details only when login is empty\n [\"senior\", \"subscriber\", \"caregiver1\", \"caregiver2\", \"caregiver3\"].each {|user| autofill_user_login( user) }\n #\n # Fri Nov 12 18:12:01 IST 2010, ramonrails\n # * these are mandatory to dispatch emails in user model\n # * a user must know the role while saving itself\n # assign roles to user objects. it will auto save the roles with user record\n # TODO: use this instead of association_after_save that is assigning roles\n self.senior.lazy_roles[:halouser] = group unless senior.blank? # senior.is_halouser_of group\n self.subscriber.lazy_roles[:subscriber] = senior unless subscriber.blank?\n self.caregiver1.lazy_roles[:caregiver] = senior unless caregiver1.blank?\n self.caregiver2.lazy_roles[:caregiver] = senior unless caregiver2.blank?\n self.caregiver3.lazy_roles[:caregiver] = senior unless caregiver3.blank?\n self.caregiver1.lazy_options[ senior ] = mem_caregiver1_options\n self.caregiver2.lazy_options[ senior ] = mem_caregiver2_options\n self.caregiver3.lazy_options[ senior ] = mem_caregiver3_options\n #\n # # now collect the users for save as associations\n # self.users = [senior, subscriber, caregiver1, caregiver2, caregiver3].uniq.compact # omit nil, duplicates\n end",
"def check_user_role \t \n redirect_to root_path unless current_user.roles.first.name == \"empleado\" or current_user.roles.first.name == \"supervisor\"or current_user.roles.first.name == \"admin\" \n end",
"def create\n @role = Role.new(role_params)\n @role.save\n \n if @role.has_pool\n \n @role.default_assignee_id = 1000000 + @role.id \n @person = Person.new\n @person.id = 1000000 + @role.id\n \n if @role.pool_display_name.length() > 0\n @person.first_name = @role.pool_display_name\n else\n @person.first_name = @role.code + \" Pool\"\n end\n @person.last_name = \"\"\n @person.save\n \n @people_role = PeopleRole.new\n @people_role.role_id = @role.id\n @people_role.person_id = 1000000 + @role.id\n @people_role.save\n end\n \n respond_to do |format|\n if @role.save\n format.html { redirect_to @role, notice: 'Role was successfully created.' }\n format.json { render :show, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update?\n user.role == \"Manager\" || user.role == \"Newcomer\"\n end",
"def assign_defaults\n\t\t## WHICH OF OUR EMPLOYEES CAN RESIGN, BECOMES THE SAME AS WHO CAN VERIFY.\n\t\tself.which_of_our_employees_will_resign_outsourced_reports = self.who_can_verify_reports if self.which_of_our_employees_will_resign_outsourced_reports.blank?\n\tend",
"def create_user_as_admin(user_name,e_mail,password, roles = ['gardens preview', 'acquia engineering'], browser = @browser)\n Log.logger.info(\"Logging into #{browser.browser_url} as admin and creating new user #{user_name}\")\n browser.get(@sut_url)\n login_as_admin(browser)\n browser.get(\"#{@sut_url}/users/#{user_name}\")\n\n if (browser.find_element(:xpath => \"//body\").text.include?(\"404 error\"))\n browser.get(\"#{@sut_url}/admin/user/user/create\")\n temp = browser.find_element(:id => \"edit-name\")\n temp.clear\n temp.send_keys(user_name)\n temp = browser.find_element(:id => \"edit-mail\")\n temp.clear\n temp.send_keys(e_mail)\n temp = browser.find_element(:id => \"edit-pass-pass1\")\n temp.clear\n temp.send_keys(password)\n temp = browser.find_element(:id => \"edit-pass-pass2\")\n temp.clear\n temp.send_keys(password)\n # to get the role checkbox \"//div[contains(@id,'edit-roles')]//label[contains(text(), 'administrator')]//input\"\n unless roles.nil?\n roles.each do |role|\n rol_sel = \"//div[contains(@id,'edit-roles')]//label[contains(text(), '#{role}')]//input\"\n browser.find_element(:xpath => rol_sel).click if !(browser.find_elements(:xpath => rol_sel).empty?)\n end\n end\n agree_with_tos = 'edit-I-agree'\n browser.find_element(:id => agree_with_tos).click if !(browser.find_elements(:id => agree_with_tos).empty?)\n browser.find_element(:xpath => \"//input[@id='edit-submit' and @name='op' and @value='Create new account']\").click\n else\n Log.logger.debug(\"User \" + user_name + \" appears to already exist\");\n end\n end",
"def associations_after_save\n # # WARNING: the associations here are not using active_record, so they are not auto saved with user intake\n # # we are saving the associations manually here\n # collapse_associations # make obsolete ones = nil\n #\n # TODO: conflicting with 1.6.0 pre-quality. removed to check compatiblity or related errors\n # for remaining, fill login, password details only when login is empty\n # This is a 3 step process\n # \n # Thu Nov 11 00:14:24 IST 2010, ramonrails\n # Link per user, once only. compact.uniq ensures that\n [\"senior\", \"subscriber\", \"caregiver1\", \"caregiver2\", \"caregiver3\"].each do |_what|\n # \n # Sat Nov 20 02:03:52 IST 2010, ramonrails\n # * this logic is required when uset simply toggles the flag and saves\n _user = self.send( _what) # fetch the associated user\n unless _user.blank? || _user.nothing_assigned?\n # * default properties\n _user.autofill_login # create login and password if not already\n _user.lazy_associations[:user_intake] = self\n _user.skip_validation = true # TODO: patch for 1.6.0 release. fix later with business logic, if required\n\n case _what\n when 'senior'\n # _user.save\n # _user.is_halouser_of( group) unless _user.blank? || group.blank? # role\n _user.lazy_roles[:halouser] = group unless _user.blank? || group.blank? # role\n _user.save\n \n when 'subscriber'\n if subscribed_for_self? # senior is same as subscriber\n if was_subscribed_for_self?\n # * user and subscriber are same. not changed\n else\n # * subscriber was different. now same as senior\n self.subscriber_is_user = false # create old condition\n subscriber.is_not_subscriber_of( senior) unless subscriber.blank? || senior.blank? # remove old role first\n # subscriber.delete # remove this extra user\n self.subscriber_is_user = true # back to current situation\n end\n # _user.save\n # _user.is_subscriber_of( senior) unless _user.blank? || senior.blank? # role\n _user.lazy_roles[:subscriber] = senior unless _user.blank? || senior.blank? # role\n _user.save\n\n else # senior different from subscriber\n if was_subscribed_for_self?\n _user = senior.clone_with_profile if senior.equal?( subscriber) # same IDs, clone first\n senior.is_not_subscriber_of( senior) unless senior.blank? # senior was subscriber, not now\n else\n # all good. nothing changed\n end\n # _user.save\n # _user.is_subscriber_of( senior) unless _user.blank? || senior.blank? # role\n _user.lazy_roles[:subscriber] = senior unless _user.blank? || senior.blank? # role\n _user.save\n end\n \n when 'caregiver1'\n if caregiving_subscriber? # subscriber is caregiver\n if was_caregiving_subscriber?\n # all good. nothing changed\n else\n # was separate\n self.subscriber_is_caregiver = false # make old condition\n caregiver1.is_not_caregiver_of( senior) unless caregiver1.blank? || senior.blank?\n # caregiver1.delete # remove extra\n self.subscriber_is_caregiver = true # current condition again\n end\n \n else # subscriber different from caregiver1\n if was_caregiving_subscriber?\n _user = subscriber.clone_with_profile if subscriber.equal?( caregiver1) # same ID? clone first\n subscriber.is_not_caregiver_of( senior) unless subscriber.blank? || senior.blank? # remove caregiving role for subscriber\n else\n # all good. nothing changed\n end\n end\n if caregiving_subscriber? || (caregiver1_required? && _user.something_assigned? && !senior.blank? && !_user.equal?( senior))\n # _user.save\n # _user.is_caregiver_of( senior) unless _user.blank? || senior.blank? || _user.equal?( senior)\n # _user.options_for_senior( senior, mem_caregiver1_options)\n _user.lazy_roles[:caregiver] = senior\n _user.lazy_options[ senior] = mem_caregiver1_options\n _user.save\n # else\n # self.no_caregiver_1 = true\n # self.send(:update_without_callbacks)\n end\n \n when 'caregiver2'\n if caregiver2_required? && _user.something_assigned? && !senior.blank? && !_user.equal?( senior)\n # _user.save\n # _user.is_caregiver_of( senior) unless _user.blank? || senior.blank? || _user.equal?( senior)\n # _user.options_for_senior( senior, mem_caregiver2_options)\n _user.lazy_roles[:caregiver] = senior\n _user.lazy_options[ senior] = mem_caregiver2_options\n _user.save\n else\n self.no_caregiver_2 = true\n self.send(:update_without_callbacks)\n end\n\n when 'caregiver3'\n if caregiver3_required? && _user.something_assigned? && !senior.blank? && !_user.equal?( senior)\n # _user.save\n # _user.is_caregiver_of( senior) unless _user.blank? || senior.blank? || _user.equal?( senior)\n # _user.options_for_senior( senior, mem_caregiver3_options)\n _user.lazy_roles[:caregiver] = senior\n _user.lazy_options[ senior] = mem_caregiver3_options\n _user.save\n else\n self.no_caregiver_3 = true\n self.send(:update_without_callbacks)\n end\n end # case\n end # blank?\n end # _what\n \n # \n # Thu Jan 13 02:38:38 IST 2011, ramonrails\n # * Not required anymore\n # * lazy_associations attaches each user to this user intake\n # #\n # # * replace earlier associations. keep fresh ones\n # # * do not create duplicate associations\n # # QUESTION: what happens to orphaned users here?\n # # * reject new_record? anything not saved does not get assigned\n # # * only associate one copy of each\n # self.users = [senior, subscriber, caregiver1, caregiver2, caregiver3].reject(&:new_record?).compact.uniq\n # # # \n # # # Thu Jan 13 02:34:27 IST 2011, ramonrails\n # # # * pre_quality.feature had error dispatching emails\n # # # * This might dispatch the email more than once\n # # self.users.each(&:dispatch_emails)\n\n\n # [\"senior\", \"subscriber\", \"caregiver1\", \"caregiver2\", \"caregiver3\"].each do |_what|\n # \n # # \n # # Fri Nov 19 03:17:32 IST 2010, ramonrails\n # # * skip saving the object if already saved\n # # * happens when object is shared. subscriber == user, or, subscriber == caregiver\n # # * saving also dispatches emails. A few more triggers/callbacks. Please check model code\n # _skip = ((_what == 'subscriber') && subscribed_for_self?)\n # _skip = (_skip || (_what == 'caregiver1' && caregiving_subscriber?))\n # # \n # # Thu Nov 11 00:32:18 IST 2010, ramonrails\n # # Do not save any non-assigned data, or blank ones\n # unless _user.blank? || _user.nothing_assigned? || _skip\n # _user.skip_validation = true # TODO: patch for 1.6.0 release. fix later with business logic, if required\n # \n # # _user.autofill_login # Step 1: make them valid\n # if _user.save # Step 2: save them to database\n # # \n # # Thu Nov 11 00:13:31 IST 2010, ramonrails\n # # https://redmine.corp.halomonitor.com/issues/3696\n # # caused a bug that created multiple links to the same user\n # self.users << _user unless users.include?( _user) # Step 3: link them to user intake\n # end\n # end\n # end\n # #\n # # * add roles and options\n # # * roles are already handled by user model\n # # * this will not double write the roles\n # # senior\n # senior.is_halouser_of( group) unless senior.blank?\n # # subscriber\n # unless senior.blank? || subscriber.blank?\n # subscriber.is_subscriber_of( senior)\n # subscriber.is_caregiver_of( senior) if caregiving_subscriber?\n # end\n # # Wed Oct 27 23:55:22 IST 2010\n # # * no need to check subscriber_is_caregiver here. that is done in caregiver1 method\n # # * just call for each caregiver and assign position and other options\n # (1..3).each do |index|\n # _caregiver = self.send(\"caregiver#{index}\".to_sym)\n # _required = self.send(\"caregiver#{index}_required?\")\n # unless (_caregiver.blank? || !_required || _caregiver.nothing_assigned?)\n # _caregiver.is_caregiver_of( senior) unless _caregiver.is_caregiver_of?( senior)\n # # \n # # Thu Nov 4 05:57:16 IST 2010, ramonrails\n # # user values were stored with apply_attributes_from_hash\n # # now we persist them into database\n # _options = self.send(\"mem_caregiver#{index}_options\")\n # # \n # # Thu Nov 18 20:58:29 IST 2010, ramonrails\n # # * Do not use any other method here, cyclic dependency can occur\n # _caregiver.options_for_senior( senior, _options)\n # end\n # end\n\n end",
"def check_for_role\n self.role = ROLES[:user] if self.role.nil?\n end",
"def has_role settings, role, make_security_group=nil\n security_group role if make_security_group\n settings[:user_data][:attributes][:run_list] << \"role[#{role}]\"\nend",
"def create\n \t@site = Site.find(params[:membership][:site_id])\n \t@o = [('a'..'z'),('A'..'Z'), (0..9)].map{|i| i.to_a}.flatten\n\t\t@pw = (0...8).map{ @o[rand(@o.length)] }.join\n\n \tif current_company.users.find_by_email(params[:email]).nil?\n \t\t@user = User.new(:email => params[:email])\n \t\t@user.password = @pw\n \t\t@user.password_confirmation = @pw\n \t\t@user.company = current_company\n \t\t# This should probably have additional logic and not allow any user to become a manager...\n \t\tif params[:membership][:role] == \"manager\"\n \t\t\t@user.manager = 1\n \t\tend\n \telse\n \t\t@user = current_company.users.find_by_email!(params[:email]) \t\t\n \tend\n\n @membership.site = @site\n @membership.user = @user\n @membership.role = params[:membership][:role]\n\n respond_to do |format|\n if @membership.save\n format.html { redirect_to @membership, notice: 'Membership was successfully created.' }\n format.json { render json: @membership, status: :created, location: @membership }\n else\n format.html { render action: \"new\" }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n $party_id = params[:party_id]\n @person = Person.find(:first, :conditions => [\"party_id = ?\", $party_id], :select => \"party_id, current_last_name, current_first_name\")\n @partyrole = Partyrole.new\n \n # dropdown box should contain only not yet assigned roles\n @role_for_party = Partyrole.find(:all, :conditions => [\"party_id = ?\", $party_id], :select => \"role_id\")\n @role_id_for_party = Array.new << 0\n @length = @role_for_party.length\n \n (1..@length).each do |a|\n @role_id_for_party << @role_for_party[a-1].role_id\n end\n \n @roles = Role.find(:all, :conditions => [\"id NOT IN (?)\", @role_id_for_party] )\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partyrole }\n end\n end",
"def create\n #\n # TODO confirm privledges are not compromised\n #\n user = User.find_by_email(params[:role][:user_attributes][:email])\n params[:role].delete(:user_attributes) if user.present?\n\n @role = Role.new(params[:role])\n if user.present?\n if @vendor.users.exists?(user)\n flash.now.alert = \"User already has a role at this vendor.\"\n redirect_to dashboard_vendor_vendor_roles_path(@vendor)\n return\n end\n @role.user = user\n end\n @role.vendor = @vendor\n\n if @role.save\n redirect_to dashboard_vendor_vendor_roles_path(@vendor), notice: 'User successfully added.'\n else\n render 'new'\n end\n end",
"def create\n @user = User.where(:name => params[:user][:name]).first\n if @user.nil?\n @user = User.new\n flash[:notice] = '用户不存在!'\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n return\n end\n \n if @user.admin\n @user = User.new\n flash[:notice] = '用户已经是管理员!'\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n return\n end\n \n select_roles = params[:user_roles]\n select_roles.each do |role_id|\n @user.user_roles.create(:role_id => role_id)\n end unless select_roles.nil?\n \n @user.admin = true\n \n respond_to do |format|\n if @user.save\n @user.roles.joins(:permissions).select('permissions.controller_name,permissions.action_name,permissions.rest,roles.app_id').each do |record|\n UserVisit.create :controller_name => record.controller_name, :action_name => record.action_name, :rest => record.rest, :app_id => record.app_id, :user_id => @user.id\n end\n format.html { redirect_to admin_role_path(@user), notice: '权限新建成功.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n registered = true\n\n plan = Plan.find(role_params[:plan_id])\n @role = Role.new(plan: plan, access: role_params[:access])\n authorize @role\n\n message = ''\n if role_params[:user].present? &&\n role_params[:user].key?(:email) &&\n role_params[:user][:email].present? && plan.present?\n\n if @role.plan.owner.present? && @role.plan.owner.email == role_params[:user][:email]\n flash.now[:notice] = format(_('Cannot share plan with %{email} since that email matches\n with the owner of the plan.'),\n email: role_params[:user][:email])\n else\n user = User.where_case_insensitive('email', role_params[:user][:email]).first\n if user.present? &&\n Role.where(plan: @role.plan, user: user, active: true)\n .count\n .positive? # role already exists\n\n flash.now[:notice] = format(_('Plan is already shared with %{email}.'),\n email: role_params[:user][:email])\n else\n # rubocop:disable Metrics/BlockNesting\n if user.nil?\n registered = false\n # Attempt to determine the new Collaborator's org based on their email\n # if none is found user the is_other org or the current user's if that is not defined\n email_domain = role_params[:user][:email].split('@').last\n collaborator_org = Org.from_email_domain(email_domain: email_domain)\n collaborator_org = Org.where(is_other: true).first if collaborator_org.blank?\n\n # DMPTool customization\n User.invite!(\n inviter: current_user,\n plan: plan,\n params: { email: role_params[:user][:email], org_id: collaborator_org&.id }\n )\n # User.invite!({ email: role_params[:user][:email],\n # firstname: _(\"First Name\"),\n # surname: _(\"Surname\"),\n # org: current_user.org,\n # invitation_plan_id: @role.plan.id },\n # current_user)\n message = format(_('Invitation to %{email} issued successfully.'),\n email: role_params[:user][:email])\n user = User.where_case_insensitive('email', role_params[:user][:email]).first\n end\n\n message += format(_('Plan shared with %{email}.'), email: user.email)\n @role.user = user\n\n if @role.save\n if registered\n deliver_if(recipients: user, key: 'users.added_as_coowner') do |r|\n UserMailer.sharing_notification(@role, r, inviter: current_user)\n .deliver_now\n end\n end\n flash.now[:notice] = message\n else\n flash.now[:alert] = _('You must provide a valid email address and select a permission\n level.')\n end\n # rubocop:enable Metrics/BlockNesting\n end\n end\n else\n flash.now[:alert] = _('Please enter an email address')\n end\n redirect_to controller: 'contributors', action: 'index', plan_id: @role.plan.id\n end",
"def new\n @weeklytimetable = Weeklytimetable.new\n #@weeklytimetable.weeklytimetable_details.build\n \n #to restrict - programme & intake listing based on logged-in user --- but ALL for common lecturer subject & administrator\n @intake_list=[]\n @lecturer_programme = current_login.staff.position.unit\n current_roles = Role.find(:all, :joins=>:logins, :conditions=>['logins.id=?', Login.current_login.id]).map(&:authname)\n @is_admin=true if current_roles.include?(\"administration\") || current_roles.include?(\"weeklytimetables_module_admin\") || current_roles.include?(\"weeklytimetables_module_viewer\") || current_roles.include?(\"weeklytimetables_module_user\")\n common_subjects = [\"Sains Perubatan Asas\", \"Anatomi & Fisiologi\", \"Sains Tingkahlaku\", \"Komunikasi & Sains Pengurusan\"]\n programme_list = Programme.find(:all, :conditions =>['course_type=?',\"Diploma\"]).map(&:name)\n pengkhususan_list = Programme.find(:all, :conditions =>['course_type=? OR course_type=? OR course_type=?',\"Diploma Lanjutan\",\"Pos Basik\", \"Pengkhususan\"]).map(&:name)\n @is_common_lecturer=true if common_subjects.include?(@lecturer_programme)\n if @is_admin || @is_common_lecturer\n @intake_list += Programme.roots.map(&:id)\n end\n if programme_list.include?(@lecturer_programme)\n @is_prog_lecturer=true \n @programmeid = Programme.find(:first, :conditions => ['name=?', @lecturer_programme]).id \n @intake_list << @programmeid\n end \n if [\"Diploma Lanjutan\",\"Pos Basik\", \"Pengkhususan\"].include?(@lecturer_programme)\n pengkhususan_list.each do |khusus|\n if Position.find(:first, :conditions => ['staff_id=? and tasks_main ILIKE(?)', current_login.staff_id, \"%#{khusus}%\"])\n @is_pengkhususan_lecturer=true\n @programmeid = Programme.find(:first, :conditions => ['name=?', khusus]).id \n @intake_list << @programmeid\n end\n end\n end\n #to restrict - programme & intake listing - END\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @weeklytimetable }\n end\n end",
"def ensure_user(user_name:, email:, password:, roles:)\n user = User.where(user_name:).first\n if user.blank?\n user = User.new(user_name:, email:, roles:)\n user.password = password\n user.skip_confirmation!\n\n else\n user.email = email\n user.password = password unless user.valid_password?(password)\n user.roles = roles\n end\n user.skip_creation_email = true\n\n user.save!(validate: false)\n user\nend",
"def save_user(role, email)\n # prepare role name\n role = role.parameterize(?_).to_sym unless role.is_a?(Symbol)\n\n # make sure no user with same email is saved\n unless get_user(role).email == email\n Testing.users[role] = User.find_by_email(email)\n end\n end",
"def can_enter_mentee(name:, email:)\n click_link 'Add New Mentee'\n\n expect(body).not_to include(email)\n\n fill_in 'Email', with: email\n fill_in 'Name', with: name\n click_button('Save')\n\n visit current_path # reload\n\n expect(body).to include(email)\n end",
"def update\n roles = params[:user].delete(:roles)\n if roles.present?\n roles.map! { |r| r.downcase }\n ['admin', 'staff'].each do |type|\n role = @user.roles.find_by(type: Role.types[type])\n if role && !roles.include?(type)\n role.destroy\n elsif !role && roles.include?(type)\n @user.roles << Role.new(type: type)\n end\n end\n end\n\n respond_to do |format|\n if @user.update(user_params)\n format.html do\n if request.referer == settings_url\n redirect_to :settings, notice: 'Saved.'\n else\n redirect_to :attendees, notice: 'User was successfully updated.'\n end\n end\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { redirect_to :back, alert: @user.errors.full_messages.first }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def setup_role\n \tif self.role_ids.empty?\n \t self.role_ids = [3]\n \tend\n end",
"def update_captain_and_eligibility(*)\n reload # SQL caching causing users to be empty when creating team making all teams ineligible\n set_team_captain\n update_eligibility\n end",
"def can_modify\n\t\tself.changed_attributes.each do |attr|\n\n\t\t\tif attr.to_s == \"reports\"\n\t\t\t\tself.reports.each do |r|\n\t\t\t\t\tunless r.changed_attributes.blank?\n\t\t\t\t\t\tif r.owner_ids.include? self.created_by_user_id\n\t\t\t\t\t\telsif r.owner_ids.include? self.created_by_user.organization.id.to_s\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tself.errors.add(:reports,\"You cannot edit #{attr.name.to_s}\")\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\n\t\t\telsif attr.to_s == \"recipients\"\n\t\t\t\trecipients_changed\n\t\t\telsif attr.to_s == \"payments\"\n\t\t\t\told_payment_not_deleted\n\t\t\telse\n\t\t\t\t## only in case of \n\t\t\t\tif self.owner_ids.include? self.created_by_user.id.to_s\n\t\t\t\telsif self.owner_ids.include? self.created_by_user.organization.id.to_s\n\t\t\t\telse\n\t\t\t\t\tself.errors.add(:owner_ids,\"You cannot edit the field: #{attr.to_s}\")\n\t\t\t\tend\n\t\t\tend\n\n\t\tend\n\tend",
"def create\n @user = User.new(field_params)\n # Dont allow the field_param to set the user_role to whatever they would like, only use one of the values we allow.\n role = field_params[:role]\n if role == User.EMP_ROLE then\n @user.role = User.EMP_ROLE\n elsif role == User.ADM_ROLE then\n @user.role = User.ADM_ROLE\n else\n @user.role = User.USR_ROLE\n end\n respond_to do |format|\n if @user.save\n UserMailer.welcome_email(@user).deliver\n format.html { redirect_to :root, alert: 'User was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def setup_role\n if self.role_ids.empty?\n self.role_ids = [2]\n end\n end",
"def assign_default_role\n puts \"CREANDO USAURIO\"\n add_role(:customer) if roles.blank?\n unless self.phone.blank?\n CreateStripeCustomerJob.perform_later(self)\n puts \"ENVIANDO 2\"\n self.create_and_send_verification_code\n end\n end",
"def crear\n if user_signed_in?\n unless current_user.employee.nil?\n @permiso_crear = false\n @security_role_type = Security::RoleType.find_by(name: \"Crear\").name\n current_user.employee.security_profile.security_role.security_role_menus.each do |security_role_menu| \n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type| \n if @security_role_type == role_type.security_role_type.name\n @permiso_crear = true\n break\n end\n end\n elsif params[:controller] == \"security/role_type_menus\"\n params[:controller] = \"security/roles\"\n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type|\n if @security_role_type == role_type.security_role_type.name\n @permiso_crear = true\n break\n end\n end\n end\n end\n end\n if current_user.username == \"aadmin\"\n @permiso_crear = true\n end\n if params[:action] == \"new\" && @permiso_crear == false\n redirect_to root_path\n end\n return @permiso_crear\n end\n end\n end",
"def check_email_change\n if changed.include?('email')\n answers.destroy_all\n # Every time the email address changes, generate a new access_key\n generate_access_key\n self.email_sent_at = nil\n self.status = 'created'\n end\n end",
"def after_save(user)\n\n UserMailer.deliver_activation(user) if user.recently_activated? unless user.setup\n UserMailer.deliver_forgot_password(user) if user.recently_forgot_password?\n UserMailer.deliver_reset_password(user) if user.recently_reset_password?\n UserMailer.deliver_forgot_username(user) if user.recently_forgot_username?\n\n end",
"def make_valid_roles *roles \n roles = roles.to_symbols_uniq\n return [] if roles.empty? \n check_valid_roles? roles.map{|r| r.to_s.alpha_numeric}\n end",
"def email_required?\n super && twitter_uid.blank? || (!twitter_uid.blank? && persisted?)\n end",
"def create\n @personnel = User.new\n @personnel.first_name = params[\"first_name\"]\n @personnel.last_name = params[\"last_name\"]\n @personnel.phone_number = params[\"phone_number\"]\n @personnel.title = params[\"title\"]\n @personnel.email = params[\"email\"]\n @personnel.password = params[\"email\"]\n @personnel.admin_name = current_user.fullname\n @personnel.admin_update_time = DateTime.now\n if params[\"is_verified\"].nil?\n @personnel.is_verified = false\n else\n @personnel.is_verified = true\n end\n\n\n respond_to do |format|\n if @personnel.save\n @personnel.user_roles.create(:role_id => params[\"user_role\"][\"user_role_id\"])\n format.html { redirect_to personnel_path(@personnel), notice: 'Personnel was successfully created.' }\n format.json { render :show, status: :created, location: @personnel }\n else\n format.html { render :new }\n format.json { render json: @personnel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_email_and_password_from_account\n\n\t\t# remember i could put here @petowner = Petowner.find( params[:id] ) but because require_correct_petowner has to run before any action, we already have this line of code in that method @petowner = Petowner.find( params[:id])\n\n\t\tif params[:commit] == \"Save email changes\"\n\n\n\t\t\tif params[:personal_email].blank? || params[:confirm_personal_email].blank?\n\n\t\t\t\tflash[:alert] = \"!! Please make sure all email addresses are present before saving changes !!\" \n\n\n\t\t\telse\n\n\t\t\t\tif params[:personal_email] == params[:confirm_personal_email]\n\n\t\t\t\t\t# change in db to update the new email\n\t\t\t\t\t@petsitter.personal_email = params[:personal_email]\n\t\t\t\t\t@petsitter.save\n\n\t\t\t\t\tflash[:notice] = \"!! You have successfully updated your email address !!\"\n\t\n\t\t\t\telse\n\n\t\t\t\t\tflash[:alert] = \"!! Email and email confirmation do not match. Try again !!\"\n\n\n\t\t\t\tend\n\n\n\t\t\tend\n\n\t\t\t\n\t\t\t\n\t\telsif params[:commit] == \"Save password changes\"\n\n\t\t\tif params[:password].blank? || params[:confirm_password].blank?\n\n\t\t\t\tflash[:alert] = \"!! Please make sure both password and password confirmation are present before saving changes !!\" \n\n\n\t\t\telse\n\n\t\t\t\tif params[:password] == params[:confirm_password]\n\n\t\t\t\t\t# change in db to update the new email\n\t\t\t\t\t@petsitter.password = params[:password]\n\t\t\t\t\t@petsitter.save\n\n\t\t\t\t\tflash[:notice] = \"!! You have successfully updated your password !!\"\n\t\n\t\t\t\telse\n\n\t\t\t\t\tflash[:alert] = \"!! Password and Password confirmation do not match. Try again !!\"\n\n\n\t\t\t\tend\n\n\t\t\tend\n\n\n\n\t\tend\n\n\n\n\n\t\tredirect_to pet_sitter_dashboard_account_details_path(@petsitter.id)\n\n\tend",
"def assign_roles_manual\n\n\n\t@student_group = StudentGroup.find(params[:id])\n\t@rolelist=Role.all(:conditions=>['case_study_id=?', @student_group.case_study_id])\n\ts=\"player\"\n\n\t#perform validation\n\ttmp=0\n\t@msg=1\n\t@flag=0\n\n\t@rolelist.each do |r|\n\n\t s=\"player\"+(r.id).to_s\n\t @name=params[s.to_sym]\n\t #@name=@name[@name.size-1].to_i\n\t @name=@name.partition(\" \")[2].to_i\n\t #@name=@name.partition(\" \")[2].to_s+\" \"\n\t if (tmp==@name)\n\t\t@flag=1\n\t end\n\t tmp=@name\n\t #@user=User.find(@name)\n\tend\n\n\tif (@flag==1)\n\t @msg=1\n\t redirect_to :action => 'create_games_manual', :id=>params[:id], :msg=>@msg\n\telse\n\t #this creates the game\n\t @make_game=Game.new\n\t @make_game.case_study_id=@student_group.case_study_id\n\t @make_game.student_group_id=@student_group.id\n\t @make_game.agreement_status=FALSE\n\t @make_game.status=TRUE\n\t @make_game.save\n\n\n\t @players=Array.new\n\n\n\t @rolelist.each do |r|\n\t\ts=\"player\"+(r.id).to_s\n\t\t@name=params[s.to_sym]\n\t\t@name=@name.partition(\" \")[2].to_i\n\t\t# @name=@name.partition(\" \")[2].to_s+\" \"\n\t\t#@name=@name[@name.size-1].to_i\n\t\t@user=User.find(@name)\n\n\n\t\t#This creates a new player\n\t\t@new_player=Player.new\n\t\t@new_player.user_id=@user.id\n\t\t@new_player.game_id=@make_game.id\n\t\t@new_player.role_id=r.id\n\t\t@new_player.save\n\t\t@student_routing=StudentRouting.new\n\t\t@student_routing.player_id=@new_player.id\n\t\t@student_routing.save\n\t\t@players << @new_player\n\t\t#I am putting all allocated players(users ids of the players) in the database\n\t\t@tmp=Temp.new\n\t\t@tmp.user_id=@new_player.user_id\n\t\t@tmp.save\n\t end\n\t @x=Array.new\n\t @y=Array.new\n\n\n\t @players.each { |p| @x << p.user_id }\n\t #This stores info about unallocated users\n\t @tmps=Temp.find(:all)\n\t @leftover_students=Array.new\n\t @student_group_user=StudentGroupUser.find_all_by_student_group_id(@student_group.id)\n\t @student_group_user.each { |sgu| @y << sgu.user_id }\n\t @unallocated_students=@y-@x\n\t @tmps.each do |t|\n\t\t@unallocated_students.each do |ul|\n\n\t\t if (t.user_id==ul)\n\t\t\t@unallocated_students.delete(ul)\n\t\t end\n\t\tend\n\t end\n\n\t @unallocated_students.each do |ul|\n\t\t@u=User.find(ul)\n\t\t@leftover_students << @u\n\t end\n\t if (@leftover_students.count < @rolelist.count)\n\t\tTemp.destroy_all\n\t end\n\n\n\t # here all issues and scorecards are created\n\t @allissues=Issue.all(:conditions=>['case_study_id=?', @student_group.case_study_id])\n\t @allroles=Role.all(:conditions=>['case_study_id=?', @student_group.case_study_id])\n\t @allgames=Game.all(:conditions=>['student_group_id=?', @student_group.id])\n\t @allgames.each do |game|\n\t\t@allplayers=Player.all(:conditions=>['game_id=?', game.id])\n\t\t@allplayers.each do |player|\n\t\t @allissues.each do |issue|\n\t\t\t@player_scorecard=PlayerScorecard.new\n\t\t\t@player_scorecard.player_id=player.id\n\t\t\t@player_scorecard.issue_id=issue.id\n\t\t\t@player_scorecard.save\n\t\t end\n\t\tend\n\t end\n\n\n\tend\n\n\n end",
"def update\n # add a blank set of ids, so that we can actually remove roles\n user_hash = {:role_ids => []}\n # merge in what the user has selected\n user_hash = (params[:user].has_key?(:role_ids) ? params[:user] : params[:user].merge({:role_ids => []})) if params[:user]\n # locate the admin role id\n admin_role_id = Role.find_by_title('administrator').id\n # don't let the current user remove their administrative role\n if @object == current_user && @object.is_administrator? && !user_hash[:role_ids].include?(admin_role_id.to_s)\n user_hash[:role_ids] = user_hash[:role_ids] << admin_role_id\n flash[:warning] = 'You cannot remove the administrator role from yourself.'\n end\n # check for new email\n if !params[:user][:new_email].blank? && !params[:user][:email].eql?(params[:user][:new_email])\n params[:user][:email] = params[:user][:new_email]\n params[:user][:new_email] = nil\n end\n # execute the standard CrudController update\n super\n end",
"def uniqueness_of_roles\n ids = involved_people_ids\n doubled_ids = ids.select {|user_id| ids.index(user_id) != ids.rindex(user_id) }\n if doubled_ids.include?(scrum_master_id.to_s)\n errors[:scrum_master_id] << \"must have unique role\"\n end\n if doubled_ids.include?(self.product_owner_id.to_s)\n errors[:product_owner_id] << \"must have unique role\"\n end\n if self.team_member_ids - doubled_ids != self.team_member_ids\n errors[:team_member_ids] << \"must have unique role\"\n end\n if self.stakeholder_ids - doubled_ids != self.stakeholder_ids\n errors[:stakeholder_ids] << \"must have unique role\"\n end\n end",
"def assign_roles_manual\r\n\r\n\r\n @student_group = StudentGroup.find(params[:id])\r\n @rolelist=Role.find(:all, :conditions=>['case_study_id=?', @student_group.case_study_id])\r\n s=\"player\"\r\n\r\n #perform validation\r\n @tmp=Array.new\r\n @msg=1\r\n @flag=0\r\n\r\n @rolelist.count.times do |i|\r\n @tmp[i]=0\r\n end\r\n i=0\r\n @rolelist.each do |r|\r\n\r\n s=\"player\"+(r.id).to_s\r\n @name=params[s.to_sym]\r\n\r\n #@name=@name[@name.size-1].to_i\r\n @name=@name.partition(\" \")[2].to_i\r\n\r\n #@name=@name.partition(\" \")[2].to_s+\" \"\r\n @tmp.each do |tmp|\r\n if (tmp==@name)\r\n @flag=1\r\n end\r\n end\r\n @tmp << @name\r\n #@user=User.find(@name)\r\n end\r\n\r\n if (@flag==1)\r\n @msg=1\r\n redirect_to :action => 'create_games_manual', :id=>params[:id], :msg=>@msg\r\n else\r\n #this creates the game\r\n @make_game=Game.new\r\n @make_game.case_study_id=@student_group.case_study_id\r\n @make_game.student_group_id=@student_group.id\r\n @make_game.agreement_status=FALSE\r\n @make_game.status=TRUE\r\n @make_game.save\r\n\r\n\r\n @players=Array.new\r\n\r\n\r\n @rolelist.each do |r|\r\n s=\"player\"+(r.id).to_s\r\n @name=params[s.to_sym]\r\n @name=@name.partition(\" \")[2].to_i\r\n # @name=@name.partition(\" \")[2].to_s+\" \"\r\n #@name=@name[@name.size-1].to_i\r\n @user=User.find(@name)\r\n\r\n\r\n #This creates a new player\r\n @new_player=Player.new\r\n @new_player.user_id=@user.id\r\n @new_player.game_id=@make_game.id\r\n @new_player.role_id=r.id\r\n @new_player.save\r\n @student_routing=StudentRouting.new\r\n @student_routing.player_id=@new_player.id\r\n\r\n if @student_group.pre_questionnaire_id and @student_group.pre_questionnaire_id !=0\r\n @student_routing.pre_neg_required=true\r\n end\r\n if @student_group.post_questionnaire_id and @student_group.post_questionnaire_id !=0\r\n @student_routing.post_neg_required=true\r\n end\r\n if StudentGroupRule.first(:conditions => ['student_group_id=? and rule_id=?',@student_group.id,1])\r\n @student_routing.planning_required=true\r\n end\r\n\r\n @student_routing.save\r\n @players << @new_player\r\n #I am putting all allocated players(users ids of the players) in the database\r\n @tmp=Temp.new\r\n @tmp.user_id=@new_player.user_id\r\n @tmp.save\r\n end\r\n @x=Array.new\r\n @y=Array.new\r\n\r\n\r\n @players.each { |p| @x << p.user_id }\r\n #This stores info about unallocated users\r\n @tmps=Temp.find(:all)\r\n @leftover_students=Array.new\r\n @student_group_user=StudentGroupUser.find_all_by_student_group_id(@student_group.id)\r\n @student_group_user.each { |sgu| @y << sgu.user_id }\r\n @unallocated_students=@y-@x\r\n @tmps.each do |t|\r\n @unallocated_students.each do |ul|\r\n\r\n if (t.user_id==ul)\r\n @unallocated_students.delete(ul)\r\n end\r\n end\r\n end\r\n\r\n @unallocated_students.each do |ul|\r\n @u=User.find(ul)\r\n @leftover_students << @u\r\n end\r\n if (@leftover_students.count < @rolelist.count)\r\n Temp.destroy_all\r\n end\r\n\r\n\r\n # here all issues and scorecards are created\r\n @allissues=Issue.all(:conditions=>['case_study_id=?', @student_group.case_study_id])\r\n @allroles=Role.all(:conditions=>['case_study_id=?', @student_group.case_study_id])\r\n @allgames=Game.all(:conditions=>['student_group_id=?', @student_group.id])\r\n @allgames.each do |game|\r\n @allplayers=Player.all(:conditions=>['game_id=?', game.id])\r\n @allplayers.each do |player|\r\n @allissues.each do |issue|\r\n @player_scorecard=PlayerScorecard.new\r\n @player_scorecard.player_id=player.id\r\n @player_scorecard.issue_id=issue.id\r\n @player_scorecard.save\r\n end\r\n end\r\n end\r\n\r\n\r\n end\r\n redirect_to :action => 'create_games_manual', :id=>params[:id]\r\n\r\n end",
"def data_for_role_edit\n {}\n end",
"def profile_completed?\n first_name && last_name && specialty && address && phone && sex && min_nb_consult && duration_consult && cardnumber\n end",
"def test_should_have_missing_fields\n assert ! roles(:missing_person_id).valid?\n assert ! roles(:missing_client_id).valid?\n assert ! roles(:missing_title).valid?\n end",
"def checkrole\n if roles_mask == 4\n 'User'\n elsif roles_mask == 6\n 'Administrator'\n end\n end",
"def user_enrol_requested_email(enrol_request)\n ActsAsTenant.without_tenant do\n @course = enrol_request.course\n end\n email_enabled = @course.email_enabled(:users, :new_enrol_request)\n\n return unless email_enabled.regular || email_enabled.phantom\n\n @enrol_request = enrol_request\n @recipient = OpenStruct.new(name: t('course.mailer.user_enrol_requested_email.recipients'))\n\n if email_enabled.regular && email_enabled.phantom\n managers = @course.managers.includes(:user)\n elsif email_enabled.regular\n managers = @course.managers.without_phantom_users.includes(:user)\n elsif email_enabled.phantom\n managers = @course.managers.phantom.includes(:user)\n end\n\n managers.find_each do |manager|\n next if manager.email_unsubscriptions.where(course_settings_email_id: email_enabled.id).exists?\n\n I18n.with_locale(manager.user.locale) do\n mail(to: manager.user.email, subject: t('.subject', course: @course.title))\n end\n end\n end",
"def custom_permissions\n\n campus = \"bakersfield\" if current_user.email.include?(\"bakersfield.edu\")\n campus = \"chancellor\" if current_user.email.include?(\"calstate.edu\")\n campus = \"channel\" if current_user.email.include?(\"ci.edu\")\n campus = \"chico\" if current_user.email.include?(\"chico.edu\")\n campus = \"dominguez\" if current_user.email.include?(\"dh.edu\")\n campus = \"eastbay\" if current_user.email.include?(\"eb.edu\")\n campus = \"fresno\" if current_user.email.include?(\"fresno.edu\")\n campus = \"fullerton\" if current_user.email.include?(\"fullerton.edu\")\n campus = \"humboldt\" if current_user.email.include?(\"humboldt.edu\")\n campus = \"longbeach\" if current_user.email.include?(\"lb.edu\")\n campus = \"losangeles\" if current_user.email.include?(\"la.edu\")\n campus = \"maritime\" if current_user.email.include?(\"maritime.edu\")\n campus = \"mlml\" if current_user.email.include?(\"mlml.edu\")\n campus = \"northridge\" if current_user.email.include?(\"northridge.edu\")\n campus = \"pomona\" if current_user.email.include?(\"bronco.edu\")\n campus = \"sacramento\" if current_user.email.include?(\"sacramento.edu\")\n campus = \"sanfrancisco\" if current_user.email.include?(\"sf.edu\")\n campus = \"sanmarcos\" if current_user.email.include?(\"sanmarcos.edu\")\n campus = \"sonoma\" if current_user.email.include?(\"sonoma.edu\")\n campus = \"stanislaus\" if current_user.email.include?(\"stanislaus.edu\")\n\n user_groups.push(campus)\n\n # admin\n if current_user.admin?\n can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role\n end\n\n # Limits creating new objects to a specific group\n #\n # if user_groups.include? 'special_group'\n # can [:create], ActiveFedora::Base\n # end\n end",
"def check_for_role\n\t\tself.role = ROLES[:user] if !self.role.present?\n\tend",
"def create_mera25\n\t bad_validation = false\n\t\t@user = current_user\n\t\t\n\t\t# for existing and logged-in members\n\t if current_user\n \n\t\t # name them a MeRA member and update all details\n\t\t if @user.update_attributes(party_params.merge(:mera25 => 'member'))\n\t\t render 'mera25_welcome', layout: 'mera25' and return\n\t\t\telse\n\t\t\t bad_validation = true\n\t\t\tend\n\t\t\n\t\t# for existing non-logged-in members (possibly fake)\n\t\telsif User.where(email: params[:user][:email]).exists?\n \n\t\t # update fields if better content\n\t\t @user = User.find_by_email(params[:user][:email])\n\t\t\tif @user.update_attributes_unless_blank(party_params.merge(:mera25 => 'member'))\n\t\t\t if @user.verification_state == -1 # double registration for MeRA25 without DiEM25 registration\n\t\t\t\t flash[:notice] = I18n.t(\"register.mera_successful_now_diem25\")\n\t\t\t\t @membership_fees = {}\n\t\t [\"regular\", \"reduced\", \"none\", \"newsletter\", \"supporter\"].each do |w|\n\t\t @membership_fees[w] = I18n.t('membership_fees.' + w)\n\t \t end\n\t\t\t\t @just_registered = true\n\t\t\t\t @lang = :el\n\t\t\t\t render 'devise/registrations/new_mera25', layout: 'mera25' and return\n\t\t\t\telse\n\t\t\t flash[:notice] = I18n.t(\"register.mera_successful\")\n\t\t\t render 'mera25_welcome', layout: 'mera25' and return\n\t\t\t\tend\n\t\t\telse\n\t\t\t bad_validation = true\n\t\t\tend\n\t\t\n\t\t# for non-members\n\t\telse\n\t\t # set temporary password etc, set temp flag, and ask to join DiEM25\n\t\t\t\n\t\t\t@user = User.create_temp_user(party_params.merge(:mera25 => 'member', :email => params[:user][:email]))\n\t\t if @user.persisted?\n\t\t\t flash[:notice] = I18n.t(\"register.mera_successful_now_diem25\")\n\t\t\t\t@membership_fees = {}\n\t\t [\"regular\", \"reduced\", \"none\", \"newsletter\", \"supporter\"].each do |w|\n\t\t @membership_fees[w] = I18n.t('membership_fees.' + w)\n\t \tend\n\t\t\t\t@just_registered = true\n\t\t\t\t@lang = :el\n\t\t\t\t\n\t\t\t\trender 'devise/registrations/new_mera25', layout: 'mera25'\n\t\t\telse\n\t\t\t bad_validation = true\n\t\t\tend\n\t\t\t\n\t\tend\n\t\trender :mera25, layout: 'mera25' if bad_validation\n\tend",
"def create\n ## Duplicate email path\n @user = User.where(:invite_token => params[:id], :status => \"invitee\").first\n @user.update_attributes(:email => params[:user][:email], :name => params[:user][:name])\n\n @role = @user.roles.first\n UserMailer.ticket_invite(:user => @user, :role => @role, :inviter => current_user).deliver\n redirect_to :back\n end",
"def save_roles user\n user.add_role(params[:role_name])\n end",
"def load_values_to_allow_new_caregiver(user_id)\n @senior = User.find(user_id.to_i)\n @removed_caregivers = []\n @senior.caregivers.each do |caregiver|\n roles_user = @senior.roles_user_by_caregiver(caregiver)\n @removed_caregivers << caregiver \\\n if roles_user.roles_users_option && roles_user.roles_users_option[:removed]\n end unless @senior.blank?\n @max_position = User.get_max_caregiver_position(@senior)\n @password = random_password\n @user = User.new \n @profile = Profile.new\n end"
] | [
"0.57952803",
"0.56126213",
"0.5602745",
"0.5591891",
"0.55843586",
"0.5533017",
"0.5507958",
"0.54850715",
"0.54683775",
"0.54308635",
"0.5386315",
"0.5366523",
"0.5360715",
"0.5358581",
"0.53537655",
"0.5349893",
"0.532473",
"0.5322135",
"0.5317815",
"0.5315868",
"0.5315821",
"0.5294732",
"0.5277297",
"0.5247533",
"0.5246934",
"0.522429",
"0.5216986",
"0.5214606",
"0.5211282",
"0.52073723",
"0.52063257",
"0.5200811",
"0.51741046",
"0.51730746",
"0.5160514",
"0.51595914",
"0.51580435",
"0.5133332",
"0.51011354",
"0.5089513",
"0.5082721",
"0.5079921",
"0.50683117",
"0.50561047",
"0.50561047",
"0.5050931",
"0.5050931",
"0.5050931",
"0.50501335",
"0.5049705",
"0.5048304",
"0.50477934",
"0.5033203",
"0.502112",
"0.5019153",
"0.5012044",
"0.50042695",
"0.50006217",
"0.4991625",
"0.4976386",
"0.49759668",
"0.4974",
"0.4961866",
"0.4958859",
"0.49557814",
"0.4947585",
"0.4935579",
"0.4933479",
"0.49331295",
"0.49303135",
"0.4929584",
"0.4929572",
"0.49263045",
"0.4926129",
"0.4922779",
"0.4921519",
"0.49167925",
"0.49150172",
"0.49137065",
"0.49093467",
"0.49067545",
"0.49036247",
"0.48975816",
"0.48951098",
"0.48946574",
"0.4893311",
"0.48866108",
"0.48840353",
"0.48834056",
"0.48798436",
"0.4877366",
"0.4876915",
"0.48768812",
"0.48644778",
"0.4859594",
"0.4858889",
"0.4854984",
"0.4854856",
"0.4853049",
"0.48504022"
] | 0.75029004 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.