update activity goals
 @param period period for the goal ('weekly' or 'daily')
 @param params the POST params for the request. Refer to Fitbit documentation for accepted format
12583
def update_activity_goals(period, params)
      unless period && %w(daily weekly).include?(period)
        raise FitgemOauth2::InvalidArgumentError, "Goal period should either be 'daily' or 'weekly'"
      end
      post_call("user/#{user_id}/activities/goals/#{period}.json", params)
    end
1261330
public static ScheduledFuture<?> runWithScheduleAtFixedRateOnStartTime(
            ZonedDateTime startDateTime, long periodMillis, Runnable runnable) {
        return runWithScheduleAtFixedRate(calInitialDelayMillis(startDateTime),
                periodMillis, "runWithScheduleAtFixedRateOnStartTime",
                runnable);
    }
1060864
public function setSubscriptionPeriod(SubscriptionPeriod $period)
    {
        $this->parameters['sub_period_unit'] = $period->getUnit();
        $this->parameters['sub_period_number'] = $period->getInterval();
        $this->parameters['sub_period_moment'] = $period->getMoment();
    }
865797
public void setUpdateTargets(java.util.Collection<UpdateTarget> updateTargets) {
        if (updateTargets == null) {
            this.updateTargets = null;
            return;
        }

        this.updateTargets = new com.amazonaws.internal.SdkInternalList<UpdateTarget>(updateTargets);
    }
47370
public void setAveragingPeriod(final int PERIOD) {
        if (null == averagingPeriod) {
            _averagingPeriod = PERIOD;
            movingAverage    = new MovingAverage(PERIOD); // MAX 1000 values
            fireUpdateEvent(REDRAW_EVENT);
        } else {
            averagingPeriod.set(PERIOD);
        }
    }
1281583
private void addPostParams(final Request request) {
        if (friendlyName != null) {
            request.addPostParam("FriendlyName", friendlyName);
        }

        if (apnCredentialSid != null) {
            request.addPostParam("ApnCredentialSid", apnCredentialSid);
        }

        if (gcmCredentialSid != null) {
            request.addPostParam("GcmCredentialSid", gcmCredentialSid);
        }

        if (messagingServiceSid != null) {
            request.addPostParam("MessagingServiceSid", messagingServiceSid);
        }

        if (facebookMessengerPageId != null) {
            request.addPostParam("FacebookMessengerPageId", facebookMessengerPageId);
        }

        if (defaultApnNotificationProtocolVersion != null) {
            request.addPostParam("DefaultApnNotificationProtocolVersion", defaultApnNotificationProtocolVersion);
        }

        if (defaultGcmNotificationProtocolVersion != null) {
            request.addPostParam("DefaultGcmNotificationProtocolVersion", defaultGcmNotificationProtocolVersion);
        }

        if (fcmCredentialSid != null) {
            request.addPostParam("FcmCredentialSid", fcmCredentialSid);
        }

        if (defaultFcmNotificationProtocolVersion != null) {
            request.addPostParam("DefaultFcmNotificationProtocolVersion", defaultFcmNotificationProtocolVersion);
        }

        if (logEnabled != null) {
            request.addPostParam("LogEnabled", logEnabled.toString());
        }

        if (alexaSkillId != null) {
            request.addPostParam("AlexaSkillId", alexaSkillId);
        }

        if (defaultAlexaNotificationProtocolVersion != null) {
            request.addPostParam("DefaultAlexaNotificationProtocolVersion", defaultAlexaNotificationProtocolVersion);
        }
    }
4363
def period_for(time)
      raise ArgumentError, 'time must be specified' unless time
      timestamp = Timestamp.for(time)
      raise ArgumentError, 'time must have a specified utc_offset' unless timestamp.utc_offset
      info.period_for(timestamp)
    end
1182872
def body_goals(type)
      if type && BODY_GOALS.include?(type)
        get_call("user/#{user_id}/body/log/#{type}/goal.json")
      else
        raise FitgemOauth2::InvalidArgumentError, "invalid goal type : #{type}. must be one of #{BODY_GOALS}"
      end
    end
294143
public RuleUpdate setParameters(Map<String, String> params) {
    checkCustomRule();
    this.parameters.clear();
    this.parameters.putAll(params);
    this.changeParameters = true;
    return this;
  }
642820
public ApiResponse postUserActivity(String userId, Activity activity) {
        return apiRequest(HttpMethod.POST, null, activity,  organizationId, applicationId, "users",
                userId, "activities");
    }
60564
def _set_period(self, period):
		
		self._period = period
		if period:
			self._period_seconds = tempora.get_period_seconds(self._period)
			self._date_format = tempora.get_date_format_string(
				self._period_seconds)
		else:
			self._period_seconds = 0
			self._date_format = ''
1217871
public void setTargetDateRange(com.google.api.ads.admanager.axis.v201902.DateRange targetDateRange) {
        this.targetDateRange = targetDateRange;
    }
795448
public static Interval plus(final Interval interval, final Period period) {
    return new Interval(interval.getStart().plus(period),
        interval.getEnd().plus(period));
  }
1061595
public static Period moreThan(float count, TimeUnit unit) {
    checkCount(count);
    return new Period(ETimeLimit.MT, false, count, unit);
  }
237565
public void tick(long duration, TimeUnit unit) {
        this.date = new Date(date.getTime() + unit.toMillis(duration));
    }
1141669
private void addPostParams(final Request request) {
        if (friendlyName != null) {
            request.addPostParam("FriendlyName", friendlyName);
        }

        if (defaultServiceRoleSid != null) {
            request.addPostParam("DefaultServiceRoleSid", defaultServiceRoleSid);
        }

        if (defaultChannelRoleSid != null) {
            request.addPostParam("DefaultChannelRoleSid", defaultChannelRoleSid);
        }

        if (defaultChannelCreatorRoleSid != null) {
            request.addPostParam("DefaultChannelCreatorRoleSid", defaultChannelCreatorRoleSid);
        }

        if (readStatusEnabled != null) {
            request.addPostParam("ReadStatusEnabled", readStatusEnabled.toString());
        }

        if (reachabilityEnabled != null) {
            request.addPostParam("ReachabilityEnabled", reachabilityEnabled.toString());
        }

        if (typingIndicatorTimeout != null) {
            request.addPostParam("TypingIndicatorTimeout", typingIndicatorTimeout.toString());
        }

        if (consumptionReportInterval != null) {
            request.addPostParam("ConsumptionReportInterval", consumptionReportInterval.toString());
        }

        if (notificationsNewMessageEnabled != null) {
            request.addPostParam("Notifications.NewMessage.Enabled", notificationsNewMessageEnabled.toString());
        }

        if (notificationsNewMessageTemplate != null) {
            request.addPostParam("Notifications.NewMessage.Template", notificationsNewMessageTemplate);
        }

        if (notificationsAddedToChannelEnabled != null) {
            request.addPostParam("Notifications.AddedToChannel.Enabled", notificationsAddedToChannelEnabled.toString());
        }

        if (notificationsAddedToChannelTemplate != null) {
            request.addPostParam("Notifications.AddedToChannel.Template", notificationsAddedToChannelTemplate);
        }

        if (notificationsRemovedFromChannelEnabled != null) {
            request.addPostParam("Notifications.RemovedFromChannel.Enabled", notificationsRemovedFromChannelEnabled.toString());
        }

        if (notificationsRemovedFromChannelTemplate != null) {
            request.addPostParam("Notifications.RemovedFromChannel.Template", notificationsRemovedFromChannelTemplate);
        }

        if (notificationsInvitedToChannelEnabled != null) {
            request.addPostParam("Notifications.InvitedToChannel.Enabled", notificationsInvitedToChannelEnabled.toString());
        }

        if (notificationsInvitedToChannelTemplate != null) {
            request.addPostParam("Notifications.InvitedToChannel.Template", notificationsInvitedToChannelTemplate);
        }

        if (preWebhookUrl != null) {
            request.addPostParam("PreWebhookUrl", preWebhookUrl.toString());
        }

        if (postWebhookUrl != null) {
            request.addPostParam("PostWebhookUrl", postWebhookUrl.toString());
        }

        if (webhookMethod != null) {
            request.addPostParam("WebhookMethod", webhookMethod.toString());
        }

        if (webhookFilters != null) {
            for (String prop : webhookFilters) {
                request.addPostParam("WebhookFilters", prop);
            }
        }

        if (webhooksOnMessageSendUrl != null) {
            request.addPostParam("Webhooks.OnMessageSend.Url", webhooksOnMessageSendUrl.toString());
        }

        if (webhooksOnMessageSendMethod != null) {
            request.addPostParam("Webhooks.OnMessageSend.Method", webhooksOnMessageSendMethod.toString());
        }

        if (webhooksOnMessageSendFormat != null) {
            request.addPostParam("Webhooks.OnMessageSend.Format", webhooksOnMessageSendFormat);
        }

        if (webhooksOnMessageUpdateUrl != null) {
            request.addPostParam("Webhooks.OnMessageUpdate.Url", webhooksOnMessageUpdateUrl.toString());
        }

        if (webhooksOnMessageUpdateMethod != null) {
            request.addPostParam("Webhooks.OnMessageUpdate.Method", webhooksOnMessageUpdateMethod.toString());
        }

        if (webhooksOnMessageUpdateFormat != null) {
            request.addPostParam("Webhooks.OnMessageUpdate.Format", webhooksOnMessageUpdateFormat);
        }

        if (webhooksOnMessageRemoveUrl != null) {
            request.addPostParam("Webhooks.OnMessageRemove.Url", webhooksOnMessageRemoveUrl.toString());
        }

        if (webhooksOnMessageRemoveMethod != null) {
            request.addPostParam("Webhooks.OnMessageRemove.Method", webhooksOnMessageRemoveMethod.toString());
        }

        if (webhooksOnMessageRemoveFormat != null) {
            request.addPostParam("Webhooks.OnMessageRemove.Format", webhooksOnMessageRemoveFormat);
        }

        if (webhooksOnChannelAddUrl != null) {
            request.addPostParam("Webhooks.OnChannelAdd.Url", webhooksOnChannelAddUrl.toString());
        }

        if (webhooksOnChannelAddMethod != null) {
            request.addPostParam("Webhooks.OnChannelAdd.Method", webhooksOnChannelAddMethod.toString());
        }

        if (webhooksOnChannelAddFormat != null) {
            request.addPostParam("Webhooks.OnChannelAdd.Format", webhooksOnChannelAddFormat);
        }

        if (webhooksOnChannelDestroyUrl != null) {
            request.addPostParam("Webhooks.OnChannelDestroy.Url", webhooksOnChannelDestroyUrl.toString());
        }

        if (webhooksOnChannelDestroyMethod != null) {
            request.addPostParam("Webhooks.OnChannelDestroy.Method", webhooksOnChannelDestroyMethod.toString());
        }

        if (webhooksOnChannelDestroyFormat != null) {
            request.addPostParam("Webhooks.OnChannelDestroy.Format", webhooksOnChannelDestroyFormat);
        }

        if (webhooksOnChannelUpdateUrl != null) {
            request.addPostParam("Webhooks.OnChannelUpdate.Url", webhooksOnChannelUpdateUrl.toString());
        }

        if (webhooksOnChannelUpdateMethod != null) {
            request.addPostParam("Webhooks.OnChannelUpdate.Method", webhooksOnChannelUpdateMethod.toString());
        }

        if (webhooksOnChannelUpdateFormat != null) {
            request.addPostParam("Webhooks.OnChannelUpdate.Format", webhooksOnChannelUpdateFormat);
        }

        if (webhooksOnMemberAddUrl != null) {
            request.addPostParam("Webhooks.OnMemberAdd.Url", webhooksOnMemberAddUrl.toString());
        }

        if (webhooksOnMemberAddMethod != null) {
            request.addPostParam("Webhooks.OnMemberAdd.Method", webhooksOnMemberAddMethod.toString());
        }

        if (webhooksOnMemberAddFormat != null) {
            request.addPostParam("Webhooks.OnMemberAdd.Format", webhooksOnMemberAddFormat);
        }

        if (webhooksOnMemberRemoveUrl != null) {
            request.addPostParam("Webhooks.OnMemberRemove.Url", webhooksOnMemberRemoveUrl.toString());
        }

        if (webhooksOnMemberRemoveMethod != null) {
            request.addPostParam("Webhooks.OnMemberRemove.Method", webhooksOnMemberRemoveMethod.toString());
        }

        if (webhooksOnMemberRemoveFormat != null) {
            request.addPostParam("Webhooks.OnMemberRemove.Format", webhooksOnMemberRemoveFormat);
        }

        if (webhooksOnMessageSentUrl != null) {
            request.addPostParam("Webhooks.OnMessageSent.Url", webhooksOnMessageSentUrl.toString());
        }

        if (webhooksOnMessageSentMethod != null) {
            request.addPostParam("Webhooks.OnMessageSent.Method", webhooksOnMessageSentMethod.toString());
        }

        if (webhooksOnMessageSentFormat != null) {
            request.addPostParam("Webhooks.OnMessageSent.Format", webhooksOnMessageSentFormat);
        }

        if (webhooksOnMessageUpdatedUrl != null) {
            request.addPostParam("Webhooks.OnMessageUpdated.Url", webhooksOnMessageUpdatedUrl.toString());
        }

        if (webhooksOnMessageUpdatedMethod != null) {
            request.addPostParam("Webhooks.OnMessageUpdated.Method", webhooksOnMessageUpdatedMethod.toString());
        }

        if (webhooksOnMessageUpdatedFormat != null) {
            request.addPostParam("Webhooks.OnMessageUpdated.Format", webhooksOnMessageUpdatedFormat);
        }

        if (webhooksOnMessageRemovedUrl != null) {
            request.addPostParam("Webhooks.OnMessageRemoved.Url", webhooksOnMessageRemovedUrl.toString());
        }

        if (webhooksOnMessageRemovedMethod != null) {
            request.addPostParam("Webhooks.OnMessageRemoved.Method", webhooksOnMessageRemovedMethod.toString());
        }

        if (webhooksOnMessageRemovedFormat != null) {
            request.addPostParam("Webhooks.OnMessageRemoved.Format", webhooksOnMessageRemovedFormat);
        }

        if (webhooksOnChannelAddedUrl != null) {
            request.addPostParam("Webhooks.OnChannelAdded.Url", webhooksOnChannelAddedUrl.toString());
        }

        if (webhooksOnChannelAddedMethod != null) {
            request.addPostParam("Webhooks.OnChannelAdded.Method", webhooksOnChannelAddedMethod.toString());
        }

        if (webhooksOnChannelAddedFormat != null) {
            request.addPostParam("Webhooks.OnChannelAdded.Format", webhooksOnChannelAddedFormat);
        }

        if (webhooksOnChannelDestroyedUrl != null) {
            request.addPostParam("Webhooks.OnChannelDestroyed.Url", webhooksOnChannelDestroyedUrl.toString());
        }

        if (webhooksOnChannelDestroyedMethod != null) {
            request.addPostParam("Webhooks.OnChannelDestroyed.Method", webhooksOnChannelDestroyedMethod.toString());
        }

        if (webhooksOnChannelDestroyedFormat != null) {
            request.addPostParam("Webhooks.OnChannelDestroyed.Format", webhooksOnChannelDestroyedFormat);
        }

        if (webhooksOnChannelUpdatedUrl != null) {
            request.addPostParam("Webhooks.OnChannelUpdated.Url", webhooksOnChannelUpdatedUrl.toString());
        }

        if (webhooksOnChannelUpdatedMethod != null) {
            request.addPostParam("Webhooks.OnChannelUpdated.Method", webhooksOnChannelUpdatedMethod.toString());
        }

        if (webhooksOnChannelUpdatedFormat != null) {
            request.addPostParam("Webhooks.OnChannelUpdated.Format", webhooksOnChannelUpdatedFormat);
        }

        if (webhooksOnMemberAddedUrl != null) {
            request.addPostParam("Webhooks.OnMemberAdded.Url", webhooksOnMemberAddedUrl.toString());
        }

        if (webhooksOnMemberAddedMethod != null) {
            request.addPostParam("Webhooks.OnMemberAdded.Method", webhooksOnMemberAddedMethod.toString());
        }

        if (webhooksOnMemberAddedFormat != null) {
            request.addPostParam("Webhooks.OnMemberAdded.Format", webhooksOnMemberAddedFormat);
        }

        if (webhooksOnMemberRemovedUrl != null) {
            request.addPostParam("Webhooks.OnMemberRemoved.Url", webhooksOnMemberRemovedUrl.toString());
        }

        if (webhooksOnMemberRemovedMethod != null) {
            request.addPostParam("Webhooks.OnMemberRemoved.Method", webhooksOnMemberRemovedMethod.toString());
        }

        if (webhooksOnMemberRemovedFormat != null) {
            request.addPostParam("Webhooks.OnMemberRemoved.Format", webhooksOnMemberRemovedFormat);
        }

        if (limitsChannelMembers != null) {
            request.addPostParam("Limits.ChannelMembers", limitsChannelMembers.toString());
        }

        if (limitsUserChannels != null) {
            request.addPostParam("Limits.UserChannels", limitsUserChannels.toString());
        }
    }
1229416
private void addPostParams(final Request request) {
        if (defaultActivitySid != null) {
            request.addPostParam("DefaultActivitySid", defaultActivitySid);
        }

        if (eventCallbackUrl != null) {
            request.addPostParam("EventCallbackUrl", eventCallbackUrl.toString());
        }

        if (eventsFilter != null) {
            request.addPostParam("EventsFilter", eventsFilter);
        }

        if (friendlyName != null) {
            request.addPostParam("FriendlyName", friendlyName);
        }

        if (multiTaskEnabled != null) {
            request.addPostParam("MultiTaskEnabled", multiTaskEnabled.toString());
        }

        if (timeoutActivitySid != null) {
            request.addPostParam("TimeoutActivitySid", timeoutActivitySid);
        }

        if (prioritizeQueueOrder != null) {
            request.addPostParam("PrioritizeQueueOrder", prioritizeQueueOrder.toString());
        }
    }