/*
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.microsoft.playwright.options;

public class Cookie {
  public String name;
  public String value;
  /**
   * either url or domain / path are required. Optional.
   */
  public String url;
  /**
   * either url or domain / path are required Optional.
   */
  public String domain;
  /**
   * either url or domain / path are required Optional.
   */
  public String path;
  /**
   * Unix time in seconds. Optional.
   */
  public Double expires;
  /**
   * Optional.
   */
  public Boolean httpOnly;
  /**
   * Optional.
   */
  public Boolean secure;
  /**
   * Optional.
   */
  public SameSiteAttribute sameSite;

  public Cookie(String name, String value) {
    this.name = name;
    this.value = value;
  }
  public Cookie withUrl(String url) {
    this.url = url;
    return this;
  }
  public Cookie withDomain(String domain) {
    this.domain = domain;
    return this;
  }
  public Cookie withPath(String path) {
    this.path = path;
    return this;
  }
  public Cookie withExpires(double expires) {
    this.expires = expires;
    return this;
  }
  public Cookie withHttpOnly(boolean httpOnly) {
    this.httpOnly = httpOnly;
    return this;
  }
  public Cookie withSecure(boolean secure) {
    this.secure = secure;
    return this;
  }
  public Cookie withSameSite(SameSiteAttribute sameSite) {
    this.sameSite = sameSite;
    return this;
  }
}