file_name
stringlengths 3
137
| prefix
stringlengths 0
918k
| suffix
stringlengths 0
962k
| middle
stringlengths 0
812k
|
---|---|---|---|
beta.py | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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.
# ============================================================================
"""The Beta distribution class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Dependency imports
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.distributions import distribution
from tensorflow_probability.python.distributions import kullback_leibler
from tensorflow_probability.python.internal import assert_util
from tensorflow_probability.python.internal import distribution_util
from tensorflow_probability.python.internal import dtype_util
from tensorflow_probability.python.internal import prefer_static
from tensorflow_probability.python.internal import reparameterization
from tensorflow_probability.python.internal import tensor_util
from tensorflow_probability.python.util.seed_stream import SeedStream
from tensorflow.python.util import deprecation # pylint: disable=g-direct-tensorflow-import
__all__ = [
"Beta",
]
_beta_sample_note = """Note: `x` must have dtype `self.dtype` and be in
`[0, 1].` It must have a shape compatible with `self.batch_shape()`."""
class Beta(distribution.Distribution):
"""Beta distribution.
The Beta distribution is defined over the `(0, 1)` interval using parameters
`concentration1` (aka "alpha") and `concentration0` (aka "beta").
#### Mathematical Details
The probability density function (pdf) is,
```none
pdf(x; alpha, beta) = x**(alpha - 1) (1 - x)**(beta - 1) / Z
Z = Gamma(alpha) Gamma(beta) / Gamma(alpha + beta)
```
where:
* `concentration1 = alpha`,
* `concentration0 = beta`,
* `Z` is the normalization constant, and,
* `Gamma` is the [gamma function](
https://en.wikipedia.org/wiki/Gamma_function).
The concentration parameters represent mean total counts of a `1` or a `0`,
i.e.,
```none
concentration1 = alpha = mean * total_concentration
concentration0 = beta = (1. - mean) * total_concentration
```
where `mean` in `(0, 1)` and `total_concentration` is a positive real number
representing a mean `total_count = concentration1 + concentration0`.
Distribution parameters are automatically broadcast in all functions; see
examples for details.
Warning: The samples can be zero due to finite precision.
This happens more often when some of the concentrations are very small.
Make sure to round the samples to `np.finfo(dtype).tiny` before computing the
density.
Samples of this distribution are reparameterized (pathwise differentiable).
The derivatives are computed using the approach described in the paper
[Michael Figurnov, Shakir Mohamed, Andriy Mnih.
Implicit Reparameterization Gradients, 2018](https://arxiv.org/abs/1805.08498)
#### Examples
```python
import tensorflow_probability as tfp
tfd = tfp.distributions
# Create a batch of three Beta distributions.
alpha = [1, 2, 3]
beta = [1, 2, 3]
dist = tfd.Beta(alpha, beta)
dist.sample([4, 5]) # Shape [4, 5, 3]
# `x` has three batch entries, each with two samples.
x = [[.1, .4, .5],
[.2, .3, .5]]
# Calculate the probability of each pair of samples under the corresponding
# distribution in `dist`.
dist.prob(x) # Shape [2, 3]
```
```python
# Create batch_shape=[2, 3] via parameter broadcast:
alpha = [[1.], [2]] # Shape [2, 1]
beta = [3., 4, 5] # Shape [3]
dist = tfd.Beta(alpha, beta)
# alpha broadcast as: [[1., 1, 1,],
# [2, 2, 2]]
# beta broadcast as: [[3., 4, 5],
# [3, 4, 5]]
# batch_Shape [2, 3]
dist.sample([4, 5]) # Shape [4, 5, 2, 3]
x = [.2, .3, .5]
# x will be broadcast as [[.2, .3, .5],
# [.2, .3, .5]],
# thus matching batch_shape [2, 3].
dist.prob(x) # Shape [2, 3]
```
Compute the gradients of samples w.r.t. the parameters:
```python
alpha = tf.constant(1.0)
beta = tf.constant(2.0)
dist = tfd.Beta(alpha, beta)
samples = dist.sample(5) # Shape [5]
loss = tf.reduce_mean(tf.square(samples)) # Arbitrary loss function
# Unbiased stochastic gradients of the loss function
grads = tf.gradients(loss, [alpha, beta])
```
"""
def __init__(self,
concentration1,
concentration0,
validate_args=False,
allow_nan_stats=True,
name="Beta"):
"""Initialize a batch of Beta distributions.
Args:
concentration1: Positive floating-point `Tensor` indicating mean
number of successes; aka "alpha". Implies `self.dtype` and
`self.batch_shape`, i.e.,
`concentration1.shape = [N1, N2, ..., Nm] = self.batch_shape`.
concentration0: Positive floating-point `Tensor` indicating mean
number of failures; aka "beta". Otherwise has same semantics as
`concentration1`.
validate_args: Python `bool`, default `False`. When `True` distribution
parameters are checked for validity despite possibly degrading runtime
performance. When `False` invalid inputs may silently render incorrect
outputs.
allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
(e.g., mean, mode, variance) use the value "`NaN`" to indicate the
result is undefined. When `False`, an exception is raised if one or
more of the statistic's batch members are undefined.
name: Python `str` name prefixed to Ops created by this class.
"""
parameters = dict(locals())
with tf.name_scope(name) as name:
dtype = dtype_util.common_dtype([concentration1, concentration0],
dtype_hint=tf.float32)
self._concentration1 = tensor_util.convert_nonref_to_tensor(
concentration1, dtype=dtype, name="concentration1")
self._concentration0 = tensor_util.convert_nonref_to_tensor(
concentration0, dtype=dtype, name="concentration0")
super(Beta, self).__init__(
dtype=dtype,
validate_args=validate_args,
allow_nan_stats=allow_nan_stats,
reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,
parameters=parameters,
name=name)
@staticmethod
def _param_shapes(sample_shape):
s = tf.convert_to_tensor(sample_shape, dtype=tf.int32)
return dict(concentration1=s, concentration0=s)
@classmethod
def _params_event_ndims(cls):
return dict(concentration1=0, concentration0=0)
@property
def concentration1(self):
"""Concentration parameter associated with a `1` outcome."""
return self._concentration1
@property
def concentration0(self):
"""Concentration parameter associated with a `0` outcome."""
return self._concentration0
@property
@deprecation.deprecated(
"2019-10-01",
("The `total_concentration` property is deprecated; instead use "
"`dist.concentration1 + dist.concentration0`."),
warn_once=True)
def total_concentration(self):
"""Sum of concentration parameters."""
with self._name_and_control_scope("total_concentration"):
return self.concentration1 + self.concentration0
def _batch_shape_tensor(self, concentration1=None, concentration0=None):
return prefer_static.broadcast_shape(
prefer_static.shape(
self.concentration1 if concentration1 is None else concentration1),
prefer_static.shape(
self.concentration0 if concentration0 is None else concentration0))
def _batch_shape(self):
return tf.broadcast_static_shape(
self.concentration1.shape, self.concentration0.shape)
def _event_shape_tensor(self):
return tf.constant([], dtype=tf.int32)
def _event_shape(self):
return tf.TensorShape([])
def _sample_n(self, n, seed=None):
seed = SeedStream(seed, "beta")
concentration1 = tf.convert_to_tensor(self.concentration1)
concentration0 = tf.convert_to_tensor(self.concentration0)
shape = self._batch_shape_tensor(concentration1, concentration0)
expanded_concentration1 = tf.broadcast_to(concentration1, shape)
expanded_concentration0 = tf.broadcast_to(concentration0, shape)
gamma1_sample = tf.random.gamma(
shape=[n], alpha=expanded_concentration1, dtype=self.dtype, seed=seed())
gamma2_sample = tf.random.gamma(
shape=[n], alpha=expanded_concentration0, dtype=self.dtype, seed=seed())
beta_sample = gamma1_sample / (gamma1_sample + gamma2_sample)
return beta_sample
@distribution_util.AppendDocstring(_beta_sample_note)
def _log_prob(self, x):
concentration0 = tf.convert_to_tensor(self.concentration0)
concentration1 = tf.convert_to_tensor(self.concentration1)
return (self._log_unnormalized_prob(x, concentration1, concentration0) -
self._log_normalization(concentration1, concentration0))
@distribution_util.AppendDocstring(_beta_sample_note)
def _prob(self, x):
return tf.exp(self._log_prob(x))
@distribution_util.AppendDocstring(_beta_sample_note)
def _log_cdf(self, x):
return tf.math.log(self._cdf(x))
@distribution_util.AppendDocstring(_beta_sample_note)
def _cdf(self, x):
with tf.control_dependencies(self._maybe_assert_valid_sample(x)):
concentration1 = tf.convert_to_tensor(self.concentration1)
concentration0 = tf.convert_to_tensor(self.concentration0)
shape = self._batch_shape_tensor(concentration1, concentration0)
concentration1 = tf.broadcast_to(concentration1, shape)
concentration0 = tf.broadcast_to(concentration0, shape)
return tf.math.betainc(concentration1, concentration0, x)
def _log_unnormalized_prob(self, x, concentration1, concentration0):
with tf.control_dependencies(self._maybe_assert_valid_sample(x)):
return (tf.math.xlogy(concentration1 - 1., x) +
(concentration0 - 1.) * tf.math.log1p(-x))
def _log_normalization(self, concentration1, concentration0):
return (tf.math.lgamma(concentration1) + tf.math.lgamma(concentration0) -
tf.math.lgamma(concentration1 + concentration0))
def _entropy(self):
concentration1 = tf.convert_to_tensor(self.concentration1)
concentration0 = tf.convert_to_tensor(self.concentration0)
total_concentration = concentration1 + concentration0
return (self._log_normalization(concentration1, concentration0) -
(concentration1 - 1.) * tf.math.digamma(concentration1) -
(concentration0 - 1.) * tf.math.digamma(concentration0) +
(total_concentration - 2.) * tf.math.digamma(total_concentration))
def _mean(self):
concentration1 = tf.convert_to_tensor(self.concentration1)
return concentration1 / (concentration1 + self.concentration0)
def _variance(self):
|
@distribution_util.AppendDocstring(
"""Note: The mode is undefined when `concentration1 <= 1` or
`concentration0 <= 1`. If `self.allow_nan_stats` is `True`, `NaN`
is used for undefined modes. If `self.allow_nan_stats` is `False` an
exception is raised when one or more modes are undefined.""")
def _mode(self):
concentration1 = tf.convert_to_tensor(self.concentration1)
concentration0 = tf.convert_to_tensor(self.concentration0)
mode = (concentration1 - 1.) / (concentration1 + concentration0 - 2.)
with tf.control_dependencies([] if self.allow_nan_stats else [ # pylint: disable=g-long-ternary
assert_util.assert_less(
tf.ones([], dtype=self.dtype),
concentration1,
message="Mode undefined for concentration1 <= 1."),
assert_util.assert_less(
tf.ones([], dtype=self.dtype),
concentration0,
message="Mode undefined for concentration0 <= 1.")
]):
return tf.where(
(concentration1 > 1.) & (concentration0 > 1.),
mode,
dtype_util.as_numpy_dtype(self.dtype)(np.nan))
def _maybe_assert_valid_sample(self, x):
"""Checks the validity of a sample."""
if not self.validate_args:
return []
return [
assert_util.assert_positive(x, message="Sample must be positive."),
assert_util.assert_less(
x, tf.ones([], x.dtype), message="Sample must be less than `1`.")
]
def _parameter_control_dependencies(self, is_init):
if not self.validate_args:
return []
assertions = []
for concentration in [self.concentration0, self.concentration1]:
if is_init != tensor_util.is_ref(concentration):
assertions.append(assert_util.assert_positive(
concentration,
message="Concentration parameter must be positive."))
return assertions
@kullback_leibler.RegisterKL(Beta, Beta)
def _kl_beta_beta(d1, d2, name=None):
"""Calculate the batchwise KL divergence KL(d1 || d2) with d1 and d2 Beta.
Args:
d1: instance of a Beta distribution object.
d2: instance of a Beta distribution object.
name: (optional) Name to use for created operations.
default is "kl_beta_beta".
Returns:
Batchwise KL(d1 || d2)
"""
with tf.name_scope(name or "kl_beta_beta"):
d1_concentration1 = tf.convert_to_tensor(d1.concentration1)
d1_concentration0 = tf.convert_to_tensor(d1.concentration0)
d2_concentration1 = tf.convert_to_tensor(d2.concentration1)
d2_concentration0 = tf.convert_to_tensor(d2.concentration0)
d1_total_concentration = d1_concentration1 + d1_concentration0
d2_total_concentration = d2_concentration1 + d2_concentration0
d1_log_normalization = d1._log_normalization( # pylint: disable=protected-access
d1_concentration1, d1_concentration0)
d2_log_normalization = d2._log_normalization( # pylint: disable=protected-access
d2_concentration1, d2_concentration0)
return ((d2_log_normalization - d1_log_normalization) -
(tf.math.digamma(d1_concentration1) *
(d2_concentration1 - d1_concentration1)) -
(tf.math.digamma(d1_concentration0) *
(d2_concentration0 - d1_concentration0)) +
(tf.math.digamma(d1_total_concentration) *
(d2_total_concentration - d1_total_concentration)))
| concentration1 = tf.convert_to_tensor(self.concentration1)
concentration0 = tf.convert_to_tensor(self.concentration0)
total_concentration = concentration1 + concentration0
return (concentration1 * concentration0 /
((total_concentration)**2 * (total_concentration + 1.))) |
weather.py | """
Augmenters that create wheather effects.
Do not import directly from this file, as the categorization is not final.
Use instead::
from imgaug import augmenters as iaa
and then e.g.::
seq = iaa.Sequential([iaa.Snowflakes()])
List of augmenters:
* FastSnowyLandscape
* Clouds
* Fog
* CloudLayer
* Snowflakes
* SnowflakesLayer
"""
from __future__ import print_function, division, absolute_import
import numpy as np
import cv2
from . import meta, arithmetic, blur, contrast
from .. import imgaug as ia
from .. import parameters as iap
class FastSnowyLandscape(meta.Augmenter):
"""
Augmenter to convert non-snowy landscapes to snowy ones.
This expects to get an image that roughly shows a landscape.
This is based on the method proposed by
https://medium.freecodecamp.org/image-augmentation-make-it-rain-make-it-snow-how-to-modify-a-photo-with-machine-learning-163c0cb3843f?gi=bca4a13e634c
Parameters
----------
lightness_threshold : number or tuple of number or list of number\
or imgaug.parameters.StochasticParameter, optional
All pixels with lightness in HLS colorspace below this value will have their lightness increased by
`lightness_multiplier`.
* If an int, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the discrete range ``[a .. b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
lightness_multiplier : number or tuple of number or list of number\
or imgaug.parameters.StochasticParameter, optional
Multiplier for pixel's lightness value in HLS colorspace. Affects all pixels selected via `lightness_threshold`.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
name : None or str, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
random_state : None or int or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
Examples
--------
>>> aug = iaa.FastSnowyLandscape(lightness_threshold=140, lightness_multiplier=2.5)
Search for all pixels in the image with a lightness value in HLS colorspace of less than 140 and increase their
lightness by a factor of 2.5. This is the configuration proposed in the original article (see link above).
>>> aug = iaa.FastSnowyLandscape(lightness_threshold=[128, 200], lightness_multiplier=(1.5, 3.5))
Search for all pixels in the image with a lightness value in HLS colorspace of less than 128 or less than 200
(one of these values is picked per image) and multiply their lightness by a factor of ``x`` with ``x`` being
sampled from ``uniform(1.5, 3.5)`` (once per image).
>>> aug = iaa.FastSnowyLandscape(lightness_threshold=(100, 255), lightness_multiplier=(1.0, 4.0))
Similar to above, but the lightness threshold is sampled from ``uniform(100, 255)`` (per image) and the multiplier
from ``uniform(1.0, 4.0)`` (per image). This seems to produce good and varied results.
"""
def __init__(self, lightness_threshold=(100, 255), lightness_multiplier=(1.0, 4.0), name=None, deterministic=False,
random_state=None):
super(FastSnowyLandscape, self).__init__(name=name, deterministic=deterministic, random_state=random_state)
self.lightness_threshold = iap.handle_continuous_param(lightness_threshold, "lightness_threshold",
value_range=(0, 255),
tuple_to_uniform=True,
list_to_choice=True)
self.lightness_multiplier = iap.handle_continuous_param(lightness_multiplier, "lightness_multiplier",
value_range=(0, None), tuple_to_uniform=True,
list_to_choice=True)
def _draw_samples(self, augmentables, random_state):
nb_augmentables = len(augmentables)
rss = ia.derive_random_states(random_state, 2)
thresh_samples = self.lightness_threshold.draw_samples((nb_augmentables,), rss[1])
lmul_samples = self.lightness_multiplier.draw_samples((nb_augmentables,), rss[0])
return thresh_samples, lmul_samples
def _augment_images(self, images, random_state, parents, hooks):
input_dtypes = meta.copy_dtypes_for_restore(images, force_list=True)
thresh_samples, lmul_samples = self._draw_samples(images, random_state)
result = images
for i, (image, input_dtype, thresh, lmul) in enumerate(zip(images, input_dtypes, thresh_samples, lmul_samples)):
image_hls = cv2.cvtColor(image, cv2.COLOR_RGB2HLS).astype(np.float64)
lightness = image_hls[..., 1]
lightness[lightness < thresh] *= lmul
image_hls = meta.clip_augmented_image_(image_hls, 0, 255) # TODO make value range more flexible
image_hls = meta.restore_augmented_image_dtype_(image_hls, input_dtype)
image_rgb = cv2.cvtColor(image_hls, cv2.COLOR_HLS2RGB)
result[i] = image_rgb
return result
def _augment_heatmaps(self, heatmaps, random_state, parents, hooks):
return heatmaps
def _augment_keypoints(self, keypoints_on_images, random_state, parents, hooks):
return keypoints_on_images
def get_parameters(self):
return [self.lightness_threshold, self.lightness_multiplier]
# TODO add vertical gradient alpha to have clouds only at skylevel/groundlevel
# TODO add configurable parameters
def Clouds(name=None, deterministic=False, random_state=None):
"""
Augmenter to draw clouds in images.
This is a wrapper around ``CloudLayer``. It executes 1 to 2 layers per image, leading to varying densities
and frequency patterns of clouds.
This augmenter seems to be fairly robust w.r.t. the image size. Tested with ``96x128``, ``192x256``
and ``960x1280``.
Parameters
----------
name : None or str, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
random_state : None or int or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
Examples
--------
>>> aug = iaa.Clouds()
Creates an augmenter that adds clouds to images.
"""
if name is None:
name = "Unnamed%s" % (ia.caller_name(),)
return meta.SomeOf((1, 2), children=[
CloudLayer(
intensity_mean=(196, 255), intensity_freq_exponent=(-2.5, -2.0), intensity_coarse_scale=10,
alpha_min=0, alpha_multiplier=(0.25, 0.75), alpha_size_px_max=(2, 8), alpha_freq_exponent=(-2.5, -2.0),
sparsity=(0.8, 1.0), density_multiplier=(0.5, 1.0)
),
CloudLayer(
intensity_mean=(196, 255), intensity_freq_exponent=(-2.0, -1.0), intensity_coarse_scale=10,
alpha_min=0, alpha_multiplier=(0.5, 1.0), alpha_size_px_max=(64, 128), alpha_freq_exponent=(-2.0, -1.0),
sparsity=(1.0, 1.4), density_multiplier=(0.8, 1.5)
)
], random_order=False, name=name, deterministic=deterministic, random_state=random_state)
# TODO add vertical gradient alpha to have fog only at skylevel/groundlevel
# TODO add configurable parameters
def Fog(name=None, deterministic=False, random_state=None):
"""
Augmenter to draw fog in images.
This is a wrapper around ``CloudLayer``. It executes a single layer per image with a configuration leading
to fairly dense clouds with low-frequency patterns.
This augmenter seems to be fairly robust w.r.t. the image size. Tested with ``96x128``, ``192x256``
and ``960x1280``.
Parameters
----------
name : None or str, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
random_state : None or int or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
Examples
--------
>>> aug = iaa.Fog()
Creates an augmenter that adds fog to images.
"""
if name is None:
name = "Unnamed%s" % (ia.caller_name(),)
return CloudLayer(
intensity_mean=(220, 255), intensity_freq_exponent=(-2.0, -1.5), intensity_coarse_scale=2,
alpha_min=(0.7, 0.9), alpha_multiplier=0.3, alpha_size_px_max=(2, 8), alpha_freq_exponent=(-4.0, -2.0),
sparsity=0.9, density_multiplier=(0.4, 0.9),
name=name, deterministic=deterministic, random_state=random_state
)
# TODO add perspective transform to each cloud layer to make them look more distant?
# TODO alpha_mean and density overlap - remove one of them
class CloudLayer(meta.Augmenter):
"""
Augmenter to add a single layer of clouds to an image.
Parameters
----------
intensity_mean : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Mean intensity of the clouds (i.e. mean color). Recommended to be around ``(190, 255)``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
intensity_freq_exponent : number or tuple of number or list of number\
or imgaug.parameters.StochasticParameter
Exponent of the frequency noise used to add fine intensity to the mean intensity.
Recommended to be somewhere around ``(-2.5, -1.5)``.
See :func:`imgaug.parameters.FrequencyNoise.__init__` for details.
intensity_coarse_scale : number or tuple of number or list of number\
or imgaug.parameters.StochasticParameter
Standard deviation of the gaussian distribution used to add more localized intensity to the mean intensity.
Sampled in low resolution space, i.e. affects final intensity on a coarse level. Recommended to be
around ``(0, 10)``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
alpha_min : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Minimum alpha when blending cloud noise with the image. High values will lead to clouds being "everywhere".
Recommended to usually be at around ``0.0`` for clouds and ``>0`` for fog.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
alpha_multiplier : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Multiplier for the sampled alpha values. High values will lead to denser clouds wherever they are visible.
Recommended to be at around ``(0.3, 1.0)``. Note that this parameter currently overlaps with
`density_multiplier`, which is applied a bit later to the alpha mask.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
alpha_size_px_max : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Controls the image size at which the alpha mask is sampled. Lower values will lead to coarser alpha masks
and hence larger clouds (and empty areas).
See :func:`imgaug.parameters.FrequencyNoise.__init__` for details.
alpha_freq_exponent : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Exponent of the frequency noise used to sample the alpha mask. Similarly to `alpha_size_max_px`, lower values
will lead to coarser alpha patterns. Recommended to be somewhere around ``(-4.0, -1.5)``.
See :func:`imgaug.parameters.FrequencyNoise.__init__` for details.
sparsity : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Exponent applied late to the alpha mask. Lower values will lead to coarser cloud patterns, higher values
to finer patterns. Recommended to be somewhere around ``1.0``. Do not deviate far from that values, otherwise
the alpha mask might get weird patterns with sudden fall-offs to zero that look very unnatural.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
density_multiplier : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Late multiplier for the alpha mask, similar to `alpha_multiplier`. Set this higher to get "denser" clouds
wherever they are visible. Recommended to be around ``(0.5, 1.5)``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
name : None or str, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
random_state : None or int or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
"""
def __init__(self, intensity_mean, intensity_freq_exponent, intensity_coarse_scale,
alpha_min, alpha_multiplier, alpha_size_px_max, alpha_freq_exponent,
sparsity, density_multiplier,
name=None, deterministic=False, random_state=None):
super(CloudLayer, self).__init__(name=name, deterministic=deterministic, random_state=random_state)
self.intensity_mean = iap.handle_continuous_param(intensity_mean, "intensity_mean")
self.intensity_freq_exponent = intensity_freq_exponent
self.intensity_coarse_scale = intensity_coarse_scale
self.alpha_min = iap.handle_continuous_param(alpha_min, "alpha_min")
self.alpha_multiplier = iap.handle_continuous_param(alpha_multiplier, "alpha_multiplier")
self.alpha_size_px_max = alpha_size_px_max
self.alpha_freq_exponent = alpha_freq_exponent
self.sparsity = iap.handle_continuous_param(sparsity, "sparsity")
self.density_multiplier = iap.handle_continuous_param(density_multiplier, "density_multiplier")
def _augment_images(self, images, random_state, parents, hooks):
rss = ia.derive_random_states(random_state, len(images))
result = images
for i, (image, rs) in enumerate(zip(images, rss)):
result[i] = self.draw_on_image(image, rs)
return result
def _augment_heatmaps(self, heatmaps, random_state, parents, hooks):
return heatmaps
def _augment_keypoints(self, keypoints_on_images, random_state, parents, hooks):
return keypoints_on_images
def get_parameters(self):
return [self.intensity_mean, self.alpha_min, self.alpha_multiplier, self.alpha_size_px_max,
self.alpha_freq_exponent, self.intensity_freq_exponent, self.sparsity, self.density_min,
self.density_multiplier,
self.intensity_coarse_scale]
def draw_on_image(self, image, random_state):
alpha, intensity = self.generate_maps(image, random_state)
alpha = alpha[..., np.newaxis]
intensity = intensity[..., np.newaxis]
return np.clip(
(1 - alpha) * image.astype(np.float64) + alpha * intensity.astype(np.float64),
0,
255
).astype(np.uint8)
def generate_maps(self, image, random_state):
intensity_mean_sample = self.intensity_mean.draw_sample(random_state)
alpha_min_sample = self.alpha_min.draw_sample(random_state)
alpha_multiplier_sample = self.alpha_multiplier.draw_sample(random_state)
alpha_size_px_max = self.alpha_size_px_max
intensity_freq_exponent = self.intensity_freq_exponent
alpha_freq_exponent = self.alpha_freq_exponent
sparsity_sample = self.sparsity.draw_sample(random_state)
density_multiplier_sample = self.density_multiplier.draw_sample(random_state)
height, width = image.shape[0:2]
rss_alpha, rss_intensity = ia.derive_random_states(random_state, 2)
intensity_coarse = self._generate_intensity_map_coarse(
height, width, intensity_mean_sample,
iap.Normal(0, scale=self.intensity_coarse_scale),
rss_intensity
)
intensity_fine = self._generate_intensity_map_fine(height, width, intensity_mean_sample,
intensity_freq_exponent, rss_intensity)
intensity = np.clip(intensity_coarse + intensity_fine, 0, 255)
alpha = self._generate_alpha_mask(height, width, alpha_min_sample, alpha_multiplier_sample,
alpha_freq_exponent, alpha_size_px_max,
sparsity_sample, density_multiplier_sample, rss_alpha)
return alpha, intensity
@classmethod
def _generate_intensity_map_coarse(cls, height, width, intensity_mean, intensity_local_offset, random_state):
height_intensity, width_intensity = (8, 8) # TODO this might be too simplistic for some image sizes
intensity = intensity_mean\
+ intensity_local_offset.draw_samples((height_intensity, width_intensity), random_state)
intensity = ia.imresize_single_image(np.clip(intensity, 0, 255).astype(np.uint8), (height, width),
interpolation="cubic")
return intensity
@classmethod
def _generate_intensity_map_fine(cls, height, width, intensity_mean, exponent, random_state):
intensity_details_generator = iap.FrequencyNoise(
exponent=exponent,
size_px_max=max(height, width),
upscale_method="cubic"
)
intensity_details = intensity_details_generator.draw_samples((height, width), random_state)
return intensity_mean * ((2*intensity_details - 1.0)/5.0)
@classmethod
def _generate_alpha_mask(cls, height, width, alpha_min, alpha_multiplier, exponent, alpha_size_px_max, sparsity,
density_multiplier, random_state):
alpha_generator = iap.FrequencyNoise(
exponent=exponent,
size_px_max=alpha_size_px_max,
upscale_method="cubic"
)
alpha_local = alpha_generator.draw_samples((height, width), random_state)
alpha = alpha_min + (alpha_multiplier * alpha_local)
alpha = (alpha ** sparsity) * density_multiplier
alpha = np.clip(alpha, 0.0, 1.0)
return alpha
def Snowflakes(density=(0.005, 0.075), density_uniformity=(0.3, 0.9), flake_size=(0.2, 0.7),
flake_size_uniformity=(0.4, 0.8), angle=(-30, 30), speed=(0.007, 0.03),
name=None, deterministic=False, random_state=None):
"""
Augmenter to add falling snowflakes to images.
This is a wrapper around ``SnowflakesLayer``. It executes 1 to 3 layers per image.
Parameters
----------
density : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Density of the snowflake layer, as a probability of each pixel in low resolution space to be a snowflake.
Valid value range is ``(0.0, 1.0)``. Recommended to be around ``(0.01, 0.075)``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
density_uniformity : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Size uniformity of the snowflakes. Higher values denote more similarly sized snowflakes.
Valid value range is ``(0.0, 1.0)``. Recommended to be around ``0.5``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
flake_size : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Size of the snowflakes. This parameter controls the resolution at which snowflakes are sampled.
Higher values mean that the resolution is closer to the input image's resolution and hence each sampled
snowflake will be smaller (because of the smaller pixel size).
Valid value range is ``[0.0, 1.0)``. Recommended values:
* On ``96x128`` a value of ``(0.1, 0.4)`` worked well.
* On ``192x256`` a value of ``(0.2, 0.7)`` worked well.
* On ``960x1280`` a value of ``(0.7, 0.95)`` worked well.
Allowed datatypes:
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
flake_size_uniformity : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Controls the size uniformity of the snowflakes. Higher values mean that the snowflakes are more similarly
sized. Valid value range is ``(0.0, 1.0)``. Recommended to be around ``0.5``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
angle : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Angle in degrees of motion blur applied to the snowflakes, where ``0.0`` is motion blur that points straight
upwards. Recommended to be around ``(-30, 30)``.
See also :func:`imgaug.augmenters.blur.MotionBlur.__init__`.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
speed : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Perceived falling speed of the snowflakes. This parameter controls the motion blur's kernel size.
It follows roughly the form ``kernel_size = image_size * speed``. Hence,
Values around ``1.0`` denote that the motion blur should "stretch" each snowflake over the whole image.
Valid value range is ``(0.0, 1.0)``. Recommended values:
* On ``96x128`` a value of ``(0.01, 0.05)`` worked well.
* On ``192x256`` a value of ``(0.007, 0.03)`` worked well.
* On ``960x1280`` a value of ``(0.001, 0.03)`` worked well.
Allowed datatypes:
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
name : None or str, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
random_state : None or int or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
Examples
--------
>>> aug = iaa.Snowflakes(flake_size=(0.1, 0.4), speed=(0.01, 0.05))
Adds snowflakes to small images (around ``96x128``).
>>> aug = iaa.Snowflakes(flake_size=(0.2, 0.7), speed=(0.007, 0.03))
Adds snowflakes to medium-sized images (around ``192x256``).
>>> aug = iaa.Snowflakes(flake_size=(0.7, 0.95), speed=(0.001, 0.03))
Adds snowflakes to large images (around ``960x1280``).
"""
if name is None:
name = "Unnamed%s" % (ia.caller_name(),)
layer = SnowflakesLayer(
density=density, density_uniformity=density_uniformity,
flake_size=flake_size, flake_size_uniformity=flake_size_uniformity,
angle=angle, speed=speed,
blur_sigma_fraction=(0.0001, 0.001)
)
return meta.SomeOf(
(1, 3), children=[layer.deepcopy() for _ in range(3)],
random_order=False, name=name, deterministic=deterministic, random_state=random_state
)
# TODO snowflakes are all almost 100% white, add some grayish tones and maybe color to them
class SnowflakesLayer(meta.Augmenter):
"""
Augmenter to add a single layer of falling snowflakes to images.
Parameters
----------
density : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Density of the snowflake layer, as a probability of each pixel in low resolution space to be a snowflake.
Valid value range is ``(0.0, 1.0)``. Recommended to be around ``(0.01, 0.075)``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
density_uniformity : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Size uniformity of the snowflakes. Higher values denote more similarly sized snowflakes.
Valid value range is ``(0.0, 1.0)``. Recommended to be around ``0.5``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
flake_size : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Size of the snowflakes. This parameter controls the resolution at which snowflakes are sampled.
Higher values mean that the resolution is closer to the input image's resolution and hence each sampled
snowflake will be smaller (because of the smaller pixel size).
Valid value range is ``[0.0, 1.0)``. Recommended values:
* On 96x128 a value of ``(0.1, 0.4)`` worked well.
* On 192x256 a value of ``(0.2, 0.7)`` worked well.
* On 960x1280 a value of ``(0.7, 0.95)`` worked well.
Allowed datatypes:
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
flake_size_uniformity : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Controls the size uniformity of the snowflakes. Higher values mean that the snowflakes are more similarly
sized. Valid value range is ``(0.0, 1.0)``. Recommended to be around ``0.5``.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
angle : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Angle in degrees of motion blur applied to the snowflakes, where ``0.0`` is motion blur that points straight
upwards. Recommended to be around ``(-30, 30)``.
See also :func:`imgaug.augmenters.blur.MotionBlur.__init__`.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
speed : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Perceived falling speed of the snowflakes. This parameter controls the motion blur's kernel size.
It follows roughly the form ``kernel_size = image_size * speed``. Hence,
Values around ``1.0`` denote that the motion blur should "stretch" each snowflake over the whole image.
Valid value range is ``(0.0, 1.0)``. Recommended values:
* On 96x128 a value of ``(0.01, 0.05)`` worked well.
* On 192x256 a value of ``(0.007, 0.03)`` worked well.
* On 960x1280 a value of ``(0.001, 0.03)`` worked well.
Allowed datatypes:
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
blur_sigma_fraction : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Standard deviation (as a fraction of the image size) of gaussian blur applied to the snowflakes.
Valid value range is ``(0.0, 1.0)``. Recommended to be around ``(0.0001, 0.001)``. May still require tinkering
based on image size.
* If a number, then that value will be used for all images.
* If a tuple ``(a, b)``, then a value from the continuous range ``[a, b]`` will be used.
* If a list, then a random value will be sampled from that list per image.
* If a StochasticParameter, then a value will be sampled per image from that parameter.
blur_sigma_limits : tuple of float, optional
Controls allows min and max values of `blur_sigma_fraction` after(!) multiplication with the image size.
First value is the minimum, second value is the maximum. Values outside of that range will be clipped to be
within that range. This prevents extreme values for very small or large images.
name : None or str, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
deterministic : bool, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
random_state : None or int or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
"""
def __init__(self, density, density_uniformity, flake_size, flake_size_uniformity, angle, speed, blur_sigma_fraction,
blur_sigma_limits=(0.5, 3.75), name=None, deterministic=False,
random_state=None):
super(SnowflakesLayer, self).__init__(name=name, deterministic=deterministic, random_state=random_state)
self.density = density
self.density_uniformity = iap.handle_continuous_param(density_uniformity, "density_uniformity",
value_range=(0.0, 1.0))
self.flake_size = iap.handle_continuous_param(flake_size, "flake_size", value_range=(0.0+1e-4, 1.0))
self.flake_size_uniformity = iap.handle_continuous_param(flake_size_uniformity, "flake_size_uniformity",
value_range=(0.0, 1.0))
self.angle = iap.handle_continuous_param(angle, "angle")
self.speed = iap.handle_continuous_param(speed, "speed", value_range=(0.0, 1.0))
self.blur_sigma_fraction = iap.handle_continuous_param(blur_sigma_fraction, "blur_sigma_fraction",
value_range=(0.0, 1.0))
self.blur_sigma_limits = blur_sigma_limits # (min, max), same for all images
self.gate_noise_size = (8, 8) # (height, width), same for all images
def _augment_images(self, images, random_state, parents, hooks):
rss = ia.derive_random_states(random_state, len(images))
result = images
for i, (image, rs) in enumerate(zip(images, rss)):
result[i] = self.draw_on_image(image, rs)
return result
def _augment_heatmaps(self, heatmaps, random_state, parents, hooks):
return heatmaps
def _augment_keypoints(self, keypoints_on_images, random_state, parents, hooks):
return keypoints_on_images
def get_parameters(self):
return [self.density, self.density_uniformity, self.flake_size, self.flake_size_uniformity, self.angle,
self.speed, self.blur_sigma_fraction, self.blur_sigma_limits, self.gate_noise_size]
def draw_on_image(self, image, random_state):
flake_size_sample = self.flake_size.draw_sample(random_state)
flake_size_uniformity_sample = self.flake_size_uniformity.draw_sample(random_state)
angle_sample = self.angle.draw_sample(random_state)
speed_sample = self.speed.draw_sample(random_state)
blur_sigma_fraction_sample = self.blur_sigma_fraction.draw_sample(random_state)
height, width = image.shape[0:2]
downscale_factor = np.clip(1.0 - flake_size_sample, 0.001, 1.0)
height_down, width_down = int(height*downscale_factor), int(width*downscale_factor),
noise = self._generate_noise(
height_down,
width_down,
self.density,
ia.derive_random_state(random_state)
)
# gate the sampled noise via noise in range [0.0, 1.0]
# this leads to less flakes in some areas of the image and more in other areas
gate_noise = iap.Beta(1.0, 1.0 - self.density_uniformity)
noise = self._gate(noise, gate_noise, self.gate_noise_size, ia.derive_random_state(random_state))
noise = ia.imresize_single_image(noise, (height, width), interpolation="cubic")
# apply a bit of gaussian blur and then motion blur according to angle and speed
sigma = max(height, width) * blur_sigma_fraction_sample
sigma = np.clip(sigma, self.blur_sigma_limits[0], self.blur_sigma_limits[1])
noise_small_blur = self._blur(noise, sigma, random_state)
noise_small_blur = self._motion_blur(noise_small_blur, angle=angle_sample, speed=speed_sample,
random_state=random_state)
# use contrast adjustment of noise to make the flake size a bit less uniform
# then readjust the noise values to make them more visible again
gain = 1.0 + 2*(1 - flake_size_uniformity_sample)
gain_adj = 1.0 + 5*(1 - flake_size_uniformity_sample)
noise_small_blur = contrast.GammaContrast(gain).augment_image(noise_small_blur)
noise_small_blur = noise_small_blur.astype(np.float32) * gain_adj
noise_small_blur_rgb = np.tile(noise_small_blur[..., np.newaxis], (1, 1, 3))
# blend:
# sum for a bit of glowy, hardly visible flakes
# max for the main flakes
image_f32 = image.astype(np.float32)
image_f32 = self._blend_by_sum(image_f32, (0.1 + 20*speed_sample) * noise_small_blur_rgb)
image_f32 = self._blend_by_max(image_f32, (1.0 + 20*speed_sample) * noise_small_blur_rgb)
return image_f32
@classmethod
def _generate_noise(cls, height, width, density, random_state):
noise = arithmetic.Salt(p=density, random_state=random_state)
return noise.augment_image(np.zeros((height, width), dtype=np.uint8))
@classmethod
def _gate(cls, noise, gate_noise, gate_size, random_state):
# the beta distribution here has most of its weight around 1.0 and will only rarely sample values around 0.0
# the average of the sampled values seems to be at around 0.6-0.75
gate_noise = gate_noise.draw_samples(gate_size, random_state)
gate_noise_up = ia.imresize_single_image(gate_noise, noise.shape[0:2], interpolation="cubic")
gate_noise_up = np.clip(gate_noise_up, 0.0, 1.0)
return np.clip(noise.astype(np.float32) * gate_noise_up, 0, 255).astype(np.uint8)
@classmethod
def _blur(cls, noise, sigma, random_state):
blurer = blur.GaussianBlur(sigma, random_state=random_state)
return blurer.augment_image(noise)
@classmethod
def | (cls, noise, angle, speed, random_state):
size = max(noise.shape[0:2])
k = int(speed * size)
if k <= 1:
return noise
# we use max(k, 3) here because MotionBlur errors for anything less than 3
blurer = blur.MotionBlur(k=max(k, 3), angle=angle, direction=1.0, random_state=random_state)
return blurer.augment_image(noise)
@classmethod
def _blend_by_sum(cls, image_f32, noise_small_blur_rgb):
image_f32 = image_f32 + noise_small_blur_rgb
return np.clip(image_f32, 0, 255).astype(np.uint8)
@classmethod
def _blend_by_max(cls, image_f32, noise_small_blur_rgb):
image_f32 = np.maximum(image_f32, noise_small_blur_rgb)
return np.clip(image_f32, 0, 255).astype(np.uint8)
| _motion_blur |
util.go | // Copyright 2019 PingCAP, Inc.
//
// 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,
// See the License for the specific language governing permissions and
// limitations under the License.
package streamer
import (
"io"
"strings"
"github.com/pingcap/errors"
"github.com/pingcap/dm/pkg/terror"
"github.com/pingcap/dm/pkg/utils"
)
// getNextUUID gets (the nextUUID and its suffix) after the current UUID.
func | (currUUID string, UUIDs []string) (string, string, error) {
for i := len(UUIDs) - 2; i >= 0; i-- {
if UUIDs[i] == currUUID {
nextUUID := UUIDs[i+1]
_, suffixInt, err := utils.ParseSuffixForUUID(nextUUID)
if err != nil {
return "", "", terror.Annotatef(err, "UUID %s", nextUUID)
}
return nextUUID, utils.SuffixIntToStr(suffixInt), nil
}
}
return "", "", nil
}
// isIgnorableParseError checks whether is a ignorable error for `BinlogParser.ParseFile`.
func isIgnorableParseError(err error) bool {
if err == nil {
return false
}
if strings.Contains(err.Error(), "err EOF") {
// NOTE: go-mysql returned err not includes caused err, but as message, ref: parser.go `parseSingleEvent`
return true
} else if errors.Cause(err) == io.EOF {
return true
}
return false
}
| getNextUUID |
create_identity_docs.py | # coding=utf-8
import time
import os
class CreateID:
def | (self, rpapp):
self.rpapp = rpapp
def create_docs(self):
driver = self.rpapp.driver
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='ti'])[1]/following::button[6]").click()
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='RUS'])[1]/following::td[1]").click()
time.sleep(1)
driver.find_element_by_xpath('//button[text()="Create Identity Document"]').click()
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='Document Type'])[1]/following::div[3]").click()
driver.implicitly_wait(20)
driver.find_element_by_id("react-select-7-option-2").click()
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='File'])[1]/following::div[1]").click()
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='File'])[1]/preceding::input[1]").\
send_keys(os.getcwd() + "/111.png")
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='File'])[1]/following::button[1]").click()
driver.find_element_by_xpath(
"(.//*[normalize-space(text()) and normalize-space(.)='Create Identity Document'])[1]/preceding::a[1]").\
click()
driver.find_element_by_xpath(
"//a[contains(@href, '/client')]").click()
| __init__ |
anagram_together.go | package main
import (
"fmt"
"sort"
)
func main() {
strs := []string{"art", "tap", "rat", "pat", "tar", "arm"}
output := groupAnagrams(strs)
fmt.Println(output)
strs = []string{""}
output = groupAnagrams(strs)
fmt.Println(output)
strs = []string{"a"}
output = groupAnagrams(strs)
fmt.Println(output)
}
type sortRune []rune
func (s sortRune) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
func (s sortRune) Less(i, j int) bool {
return s[i] < s[j]
}
func (s sortRune) Len() int {
return len(s)
}
func | (strs []string) [][]string {
anagramMap := make(map[string][]int)
var anagrams [][]string
trie := &trie{root: &trieNode{}}
lenStrs := len(strs)
var strsDup []string
for i := 0; i < lenStrs; i++ {
runeCurrent := []rune(strs[i])
sort.Sort(sortRune(runeCurrent))
strsDup = append(strsDup, string(runeCurrent))
}
for i := 0; i < lenStrs; i++ {
anagramMap = trie.insert(strsDup[i], i, anagramMap)
}
for _, value := range anagramMap {
var combinedTemp []string
for i := 0; i < len(value); i++ {
combinedTemp = append(combinedTemp, strs[value[i]])
}
anagrams = append(anagrams, combinedTemp)
}
return anagrams
}
type trieNode struct {
isWord bool
childrens [26]*trieNode
}
type trie struct {
root *trieNode
}
func (t *trie) insert(input string, wordIndex int, anagramMap map[string][]int) map[string][]int {
inputLen := len(input)
current := t.root
for i := 0; i < inputLen; i++ {
index := input[i] - 'a'
if current.childrens[index] == nil {
current.childrens[index] = &trieNode{}
}
current = current.childrens[index]
}
current.isWord = true
if anagramMap[input] == nil {
anagramMap[input] = []int{wordIndex}
} else {
anagramMap[input] = append(anagramMap[input], wordIndex)
}
return anagramMap
}
| groupAnagrams |
data_save.py | # -- coding: utf-8 --
import os
import csv
def go_though(open_file):
for root, dirs, files in os.walk(r''+str(open_file)):
for file in files:
# # 获取文件所属目录
# print(root)
# 获取文件路径
print(os.path.join(root, file))
def re_hour(hour):
if len(str(hour))<2:return '0'+str(hour)
else:return str(hour)
def re_month(month):
if len(str(month))<2:return '0'+str(month)
else:return str(month)
def re_day(day):
if len(str(day))<2:return '0'+str(day)
else:return str(day)
from datetime import datetime
def re_time(time_list): #[year,month,day,hour]
time =''.join([time_list[i]+'-' for i in range(len(time_list))]).strip('-')
time = datetime.strptime(time, '%Y-%m-%d-%H')
return time
import numpy as np
def witer_(open_file,day,month,y | rmat,writer):
for d in range(day, 32):
if os.path.exists(open_file + year + re_month(month) + re_day(d) + format):
read = pd.read_csv(open_file + year + re_month(month) + re_day(d) + format)
print(list(np.reshape(sites[:,0],newshape=(-1))))
data=read[list(sites[:,0])]
# return read.loc[read['城市'] == '上海'].values
# print(open_file + year + re_month(month) + re_day(d) + format)
def go_though(open_file,day,month,year,format,write_file,write_name):
file = open(write_file+write_name, 'w', encoding='utf-8')
writer=csv.writer(file)
writer.writerow(data_colum)
for m in range(month,13):
if day!=1:
witer_(open_file, day, m, year, format, writer)
day=1
else:
witer_(open_file, day, m, year, format, writer)
file.close()
return
import pandas as pd
def read_site(file):
read=pd.read_excel(file)
print(list(read.keys()))
return read.loc[read['城市']=='上海'].values
data_colum=['time','site','AQI','PM2.5','PM2.5_24h','PM10','PM10_24h','SO2','SO2_24h','NO2','NO2_24h','O3','O3_24h','O3_8h','O3_8h_24h','CO','CO_24h']
open_file='/Users/guojianzou/Downloads/站点_20200101-20201231/china_sites_'
open_site='/Users/guojianzou/Downloads/站点列表-2021.01.01起.xlsx'
write_file='/Users/guojianzou/Downloads/'
write_name='2020.csv'
day=5
month=1
year='2020'
#读取站点信息,包括:['监测点编码', '监测点名称', '城市', '经度', '纬度', '对照点']
sites=read_site(open_site)
print(sites)
# 遍历数据源,并开始存储
go_though(open_file,day,month,year,'.csv',write_file,write_name)
| ear,fo |
main.py | import webapp2
class MainHandler(webapp2.RequestHandler):
|
class CountHandler(webapp2.RequestHandler):
def get(self):
for i in range(1, 21):
self.response.write('Hello %d <br>' % i)
app = webapp2.WSGIApplication([
('/', MainHandler),
('/count', CountHandler)
], debug=True)
| def get(self):
self.response.write('Hello world!') |
client_type.py | """
Fatture in Cloud API v2 - API Reference
Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. # noqa: E501
The version of the OpenAPI document: 2.0.15
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fattureincloud_python_sdk.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiModel
)
from fattureincloud_python_sdk.exceptions import ApiAttributeError
class ClientType(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
('value',): {
'None': None,
'COMPANY': "company",
'PERSON': "person",
'PA': "pa",
'CONDO': "condo",
},
}
validations = {
}
additional_properties_type = None
_nullable = True
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'value': (str,),
}
@cached_property
def discriminator():
return None
attribute_map = {}
read_only_vars = set()
_composed_schemas = None
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs):
|
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, *args, **kwargs):
"""ClientType - a model defined in OpenAPI
Note that value can be passed either in args or in kwargs, but not in both.
Args:
args[0] (str): Client type.., must be one of ["company", "person", "pa", "condo", ] # noqa: E501
Keyword Args:
value (str): Client type.., must be one of ["company", "person", "pa", "condo", ] # noqa: E501
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
# required up here when default value is not given
_path_to_item = kwargs.pop('_path_to_item', ())
self = super(OpenApiModel, cls).__new__(cls)
if 'value' in kwargs:
value = kwargs.pop('value')
elif args:
args = list(args)
value = args.pop(0)
else:
raise ApiTypeError(
"value is required, but not passed in args or kwargs and doesn't have default",
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.value = value
if kwargs:
raise ApiTypeError(
"Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % (
kwargs,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
return self
| """ClientType - a model defined in OpenAPI
Note that value can be passed either in args or in kwargs, but not in both.
Args:
args[0] (str): Client type.., must be one of ["company", "person", "pa", "condo", ] # noqa: E501
Keyword Args:
value (str): Client type.., must be one of ["company", "person", "pa", "condo", ] # noqa: E501
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
# required up here when default value is not given
_path_to_item = kwargs.pop('_path_to_item', ())
if 'value' in kwargs:
value = kwargs.pop('value')
elif args:
args = list(args)
value = args.pop(0)
else:
raise ApiTypeError(
"value is required, but not passed in args or kwargs and doesn't have default",
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.value = value
if kwargs:
raise ApiTypeError(
"Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % (
kwargs,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
) |
validate.rs | use std::collections::BTreeSet;
use abstutil::Timer;
use map_gui::tools::PopupMsg;
use map_model::{connectivity, EditCmd, PathConstraints};
use widgetry::{EventCtx, State};
use crate::app::App;
// All of these take a candidate EditCmd to do, then see if it's valid. If they return None, it's
// fine. They always leave the map in the original state without the new EditCmd.
// Could be caused by closing intersections
pub fn | (
ctx: &mut EventCtx,
app: &mut App,
cmd: EditCmd,
) -> Option<Box<dyn State<App>>> {
let orig_edits = app.primary.map.get_edits().clone();
let (_, disconnected_before) =
connectivity::find_scc(&app.primary.map, PathConstraints::Pedestrian);
let mut edits = orig_edits.clone();
edits.commands.push(cmd);
app.primary
.map
.try_apply_edits(edits, &mut Timer::throwaway());
let (_, disconnected_after) =
connectivity::find_scc(&app.primary.map, PathConstraints::Pedestrian);
app.primary
.map
.must_apply_edits(orig_edits, &mut Timer::throwaway());
let newly_disconnected = disconnected_after
.difference(&disconnected_before)
.collect::<Vec<_>>();
if newly_disconnected.is_empty() {
return None;
}
// TODO Think through a proper UI for showing editing errors to the user and letting them
// understand the problem. We used to just draw problems in red and mostly cover it up with the
// popup.
Some(PopupMsg::new_state(
ctx,
"Error",
vec![format!(
"Can't close this intersection; {} sidewalks disconnected",
newly_disconnected.len()
)],
))
}
#[allow(unused)]
// Could be caused by closing intersections, changing lane types, or reversing lanes
pub fn check_blackholes(
ctx: &mut EventCtx,
app: &mut App,
cmd: EditCmd,
) -> Option<Box<dyn State<App>>> {
let orig_edits = app.primary.map.get_edits().clone();
let mut driving_ok_originally = BTreeSet::new();
let mut biking_ok_originally = BTreeSet::new();
for l in app.primary.map.all_lanes() {
if !l.driving_blackhole {
driving_ok_originally.insert(l.id);
}
if !l.biking_blackhole {
biking_ok_originally.insert(l.id);
}
}
let mut edits = orig_edits.clone();
edits.commands.push(cmd);
app.primary
.map
.try_apply_edits(edits, &mut Timer::throwaway());
let mut newly_disconnected = BTreeSet::new();
for l in connectivity::find_scc(&app.primary.map, PathConstraints::Car).1 {
if driving_ok_originally.contains(&l) {
newly_disconnected.insert(l);
}
}
for l in connectivity::find_scc(&app.primary.map, PathConstraints::Bike).1 {
if biking_ok_originally.contains(&l) {
newly_disconnected.insert(l);
}
}
app.primary
.map
.must_apply_edits(orig_edits, &mut Timer::throwaway());
if newly_disconnected.is_empty() {
return None;
}
Some(PopupMsg::new_state(
ctx,
"Error",
vec![format!(
"{} lanes have been disconnected",
newly_disconnected.len()
)],
))
}
| check_sidewalk_connectivity |
tx_filter_test.go | package state_test
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
cmn "github.com/romakingwolf/patriot/core/libs/common"
sm "github.com/romakingwolf/patriot/core/state"
"github.com/romakingwolf/patriot/core/types"
dbm "github.com/tendermint/tm-db"
)
func TestTxFilter(t *testing.T) {
genDoc := randomGenesisDoc()
genDoc.ConsensusParams.Block.MaxBytes = 3000
// Max size of Txs is much smaller than size of block,
// since we need to account for commits and evidence.
testCases := []struct {
tx types.Tx
isErr bool
}{
{types.Tx(cmn.RandBytes(250)), false},
{types.Tx(cmn.RandBytes(1809)), false},
{types.Tx(cmn.RandBytes(1810)), false},
{types.Tx(cmn.RandBytes(1811)), true},
{types.Tx(cmn.RandBytes(1812)), true},
{types.Tx(cmn.RandBytes(3000)), true},
}
for i, tc := range testCases {
stateDB := dbm.NewDB("state", "memdb", os.TempDir())
state, err := sm.LoadStateFromDBOrGenesisDoc(stateDB, genDoc)
require.NoError(t, err)
f := sm.TxPreCheck(state)
if tc.isErr {
assert.NotNil(t, f(tc.tx), "#%v", i)
} else {
assert.Nil(t, f(tc.tx), "#%v", i)
} | }
} | |
aggregates_incidents_global_counts_responses.go | // Code generated by go-swagger; DO NOT EDIT.
package overwatch_dashboard
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/crowdstrike/gofalcon/falcon/models"
)
// AggregatesIncidentsGlobalCountsReader is a Reader for the AggregatesIncidentsGlobalCounts structure.
type AggregatesIncidentsGlobalCountsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AggregatesIncidentsGlobalCountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAggregatesIncidentsGlobalCountsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewAggregatesIncidentsGlobalCountsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 429:
result := NewAggregatesIncidentsGlobalCountsTooManyRequests()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
result := NewAggregatesIncidentsGlobalCountsDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 {
return result, nil
}
return nil, result
}
}
// NewAggregatesIncidentsGlobalCountsOK creates a AggregatesIncidentsGlobalCountsOK with default headers values
func NewAggregatesIncidentsGlobalCountsOK() *AggregatesIncidentsGlobalCountsOK {
return &AggregatesIncidentsGlobalCountsOK{}
}
/* AggregatesIncidentsGlobalCountsOK describes a response with status code 200, with default header values.
OK
*/
type AggregatesIncidentsGlobalCountsOK struct {
/* Request limit per minute.
*/
XRateLimitLimit int64
/* The number of requests remaining for the sliding one minute window.
*/
XRateLimitRemaining int64
Payload *models.MsaFacetsResponse
}
func (o *AggregatesIncidentsGlobalCountsOK) Error() string {
return fmt.Sprintf("[GET /overwatch-dashboards/aggregates/incidents-global-counts/v1][%d] aggregatesIncidentsGlobalCountsOK %+v", 200, o.Payload)
}
func (o *AggregatesIncidentsGlobalCountsOK) GetPayload() *models.MsaFacetsResponse {
return o.Payload
}
func (o *AggregatesIncidentsGlobalCountsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header X-RateLimit-Limit
hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit")
if hdrXRateLimitLimit != "" {
valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit)
if err != nil {
return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit)
}
o.XRateLimitLimit = valxRateLimitLimit
}
// hydrates response header X-RateLimit-Remaining
hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining")
if hdrXRateLimitRemaining != "" {
valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining)
if err != nil {
return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining)
}
o.XRateLimitRemaining = valxRateLimitRemaining
}
o.Payload = new(models.MsaFacetsResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAggregatesIncidentsGlobalCountsForbidden creates a AggregatesIncidentsGlobalCountsForbidden with default headers values
func NewAggregatesIncidentsGlobalCountsForbidden() *AggregatesIncidentsGlobalCountsForbidden {
return &AggregatesIncidentsGlobalCountsForbidden{}
}
/* AggregatesIncidentsGlobalCountsForbidden describes a response with status code 403, with default header values.
Forbidden
*/
type AggregatesIncidentsGlobalCountsForbidden struct {
/* Request limit per minute.
*/
XRateLimitLimit int64
/* The number of requests remaining for the sliding one minute window.
*/
XRateLimitRemaining int64
Payload *models.MsaReplyMetaOnly
}
func (o *AggregatesIncidentsGlobalCountsForbidden) Error() string {
return fmt.Sprintf("[GET /overwatch-dashboards/aggregates/incidents-global-counts/v1][%d] aggregatesIncidentsGlobalCountsForbidden %+v", 403, o.Payload)
}
func (o *AggregatesIncidentsGlobalCountsForbidden) GetPayload() *models.MsaReplyMetaOnly {
return o.Payload
}
func (o *AggregatesIncidentsGlobalCountsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header X-RateLimit-Limit
hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit")
if hdrXRateLimitLimit != "" {
valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit)
if err != nil {
return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit)
}
o.XRateLimitLimit = valxRateLimitLimit
}
// hydrates response header X-RateLimit-Remaining
hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining")
if hdrXRateLimitRemaining != "" {
valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining)
if err != nil {
return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining)
}
o.XRateLimitRemaining = valxRateLimitRemaining
}
o.Payload = new(models.MsaReplyMetaOnly)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAggregatesIncidentsGlobalCountsTooManyRequests creates a AggregatesIncidentsGlobalCountsTooManyRequests with default headers values
func NewAggregatesIncidentsGlobalCountsTooManyRequests() *AggregatesIncidentsGlobalCountsTooManyRequests {
return &AggregatesIncidentsGlobalCountsTooManyRequests{}
}
/* AggregatesIncidentsGlobalCountsTooManyRequests describes a response with status code 429, with default header values.
Too Many Requests
*/
type AggregatesIncidentsGlobalCountsTooManyRequests struct {
/* Request limit per minute.
*/
XRateLimitLimit int64
/* The number of requests remaining for the sliding one minute window.
*/
XRateLimitRemaining int64
/* Too many requests, retry after this time (as milliseconds since epoch)
*/
XRateLimitRetryAfter int64
Payload *models.MsaReplyMetaOnly
}
func (o *AggregatesIncidentsGlobalCountsTooManyRequests) Error() string {
return fmt.Sprintf("[GET /overwatch-dashboards/aggregates/incidents-global-counts/v1][%d] aggregatesIncidentsGlobalCountsTooManyRequests %+v", 429, o.Payload)
}
func (o *AggregatesIncidentsGlobalCountsTooManyRequests) GetPayload() *models.MsaReplyMetaOnly {
return o.Payload
}
func (o *AggregatesIncidentsGlobalCountsTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header X-RateLimit-Limit
hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit")
if hdrXRateLimitLimit != "" {
valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit)
if err != nil {
return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit)
}
o.XRateLimitLimit = valxRateLimitLimit
}
// hydrates response header X-RateLimit-Remaining
hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining")
if hdrXRateLimitRemaining != "" {
valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining)
if err != nil |
o.XRateLimitRemaining = valxRateLimitRemaining
}
// hydrates response header X-RateLimit-RetryAfter
hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter")
if hdrXRateLimitRetryAfter != "" {
valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter)
if err != nil {
return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter)
}
o.XRateLimitRetryAfter = valxRateLimitRetryAfter
}
o.Payload = new(models.MsaReplyMetaOnly)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAggregatesIncidentsGlobalCountsDefault creates a AggregatesIncidentsGlobalCountsDefault with default headers values
func NewAggregatesIncidentsGlobalCountsDefault(code int) *AggregatesIncidentsGlobalCountsDefault {
return &AggregatesIncidentsGlobalCountsDefault{
_statusCode: code,
}
}
/* AggregatesIncidentsGlobalCountsDefault describes a response with status code -1, with default header values.
OK
*/
type AggregatesIncidentsGlobalCountsDefault struct {
_statusCode int
Payload *models.MsaFacetsResponse
}
// Code gets the status code for the aggregates incidents global counts default response
func (o *AggregatesIncidentsGlobalCountsDefault) Code() int {
return o._statusCode
}
func (o *AggregatesIncidentsGlobalCountsDefault) Error() string {
return fmt.Sprintf("[GET /overwatch-dashboards/aggregates/incidents-global-counts/v1][%d] AggregatesIncidentsGlobalCounts default %+v", o._statusCode, o.Payload)
}
func (o *AggregatesIncidentsGlobalCountsDefault) GetPayload() *models.MsaFacetsResponse {
return o.Payload
}
func (o *AggregatesIncidentsGlobalCountsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.MsaFacetsResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
| {
return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining)
} |
build_test.go | // Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package build
import (
"internal/testenv"
"io"
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"testing"
)
func TestMatch(t *testing.T) {
ctxt := Default
what := "default"
match := func(tag string, want map[string]bool) {
m := make(map[string]bool)
if !ctxt.match(tag, m) {
t.Errorf("%s context should match %s, does not", what, tag)
}
if !reflect.DeepEqual(m, want) {
t.Errorf("%s tags = %v, want %v", tag, m, want)
}
}
nomatch := func(tag string, want map[string]bool) {
m := make(map[string]bool)
if ctxt.match(tag, m) {
t.Errorf("%s context should NOT match %s, does", what, tag)
}
if !reflect.DeepEqual(m, want) {
t.Errorf("%s tags = %v, want %v", tag, m, want)
}
}
match(runtime.GOOS+","+runtime.GOARCH, map[string]bool{runtime.GOOS: true, runtime.GOARCH: true})
match(runtime.GOOS+","+runtime.GOARCH+",!foo", map[string]bool{runtime.GOOS: true, runtime.GOARCH: true, "foo": true})
nomatch(runtime.GOOS+","+runtime.GOARCH+",foo", map[string]bool{runtime.GOOS: true, runtime.GOARCH: true, "foo": true})
what = "modified"
ctxt.BuildTags = []string{"foo"}
match(runtime.GOOS+","+runtime.GOARCH, map[string]bool{runtime.GOOS: true, runtime.GOARCH: true})
match(runtime.GOOS+","+runtime.GOARCH+",foo", map[string]bool{runtime.GOOS: true, runtime.GOARCH: true, "foo": true})
nomatch(runtime.GOOS+","+runtime.GOARCH+",!foo", map[string]bool{runtime.GOOS: true, runtime.GOARCH: true, "foo": true})
match(runtime.GOOS+","+runtime.GOARCH+",!bar", map[string]bool{runtime.GOOS: true, runtime.GOARCH: true, "bar": true})
nomatch(runtime.GOOS+","+runtime.GOARCH+",bar", map[string]bool{runtime.GOOS: true, runtime.GOARCH: true, "bar": true})
nomatch("!", map[string]bool{})
}
func TestDotSlashImport(t *testing.T) {
p, err := ImportDir("testdata/other", 0)
if err != nil {
t.Fatal(err)
}
if len(p.Imports) != 1 || p.Imports[0] != "./file" {
t.Fatalf("testdata/other: Imports=%v, want [./file]", p.Imports)
}
p1, err := Import("./file", "testdata/other", 0)
if err != nil {
t.Fatal(err)
}
if p1.Name != "file" {
t.Fatalf("./file: Name=%q, want %q", p1.Name, "file")
}
dir := filepath.Clean("testdata/other/file") // Clean to use \ on Windows
if p1.Dir != dir {
t.Fatalf("./file: Dir=%q, want %q", p1.Name, dir)
}
}
func TestEmptyImport(t *testing.T) {
p, err := Import("", Default.GOROOT, FindOnly)
if err == nil {
t.Fatal(`Import("") returned nil error.`)
}
if p == nil {
t.Fatal(`Import("") returned nil package.`)
}
if p.ImportPath != "" {
t.Fatalf("ImportPath=%q, want %q.", p.ImportPath, "")
}
}
func TestEmptyFolderImport(t *testing.T) {
_, err := Import(".", "testdata/empty", 0)
if _, ok := err.(*NoGoError); !ok {
t.Fatal(`Import("testdata/empty") did not return NoGoError.`)
}
}
func TestMultiplePackageImport(t *testing.T) {
_, err := Import(".", "testdata/multi", 0)
mpe, ok := err.(*MultiplePackageError)
if !ok {
t.Fatal(`Import("testdata/multi") did not return MultiplePackageError.`)
}
want := &MultiplePackageError{
Dir: filepath.FromSlash("testdata/multi"),
Packages: []string{"main", "test_package"},
Files: []string{"file.go", "file_appengine.go"},
}
if !reflect.DeepEqual(mpe, want) {
t.Errorf("got %#v; want %#v", mpe, want)
}
}
func TestLocalDirectory(t *testing.T) {
if runtime.GOOS == "darwin" {
switch runtime.GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
}
}
cwd, err := os.Getwd()
if err != nil {
t.Fatal(err)
}
p, err := ImportDir(cwd, 0)
if err != nil {
t.Fatal(err)
}
if p.ImportPath != "go/build" {
t.Fatalf("ImportPath=%q, want %q", p.ImportPath, "go/build")
}
}
func TestShouldBuild(t *testing.T) {
const file1 = "// +build tag1\n\n" +
"package main\n"
want1 := map[string]bool{"tag1": true}
const file2 = "// +build cgo\n\n" +
"// This package implements parsing of tags like\n" +
"// +build tag1\n" +
"package build"
want2 := map[string]bool{"cgo": true}
const file3 = "// Copyright The Go Authors.\n\n" +
"package build\n\n" +
"// shouldBuild checks tags given by lines of the form\n" +
"// +build tag\n" +
"func shouldBuild(content []byte)\n"
want3 := map[string]bool{}
ctx := &Context{BuildTags: []string{"tag1"}}
m := map[string]bool{}
if !ctx.shouldBuild([]byte(file1), m) {
t.Errorf("shouldBuild(file1) = false, want true")
}
if !reflect.DeepEqual(m, want1) {
t.Errorf("shoudBuild(file1) tags = %v, want %v", m, want1)
}
m = map[string]bool{}
if ctx.shouldBuild([]byte(file2), m) {
t.Errorf("shouldBuild(file2) = true, want fakse")
}
if !reflect.DeepEqual(m, want2) {
t.Errorf("shoudBuild(file2) tags = %v, want %v", m, want2)
}
m = map[string]bool{}
ctx = &Context{BuildTags: nil}
if !ctx.shouldBuild([]byte(file3), m) {
t.Errorf("shouldBuild(file3) = false, want true")
}
if !reflect.DeepEqual(m, want3) {
t.Errorf("shoudBuild(file3) tags = %v, want %v", m, want3)
}
}
type readNopCloser struct {
io.Reader
}
func (r readNopCloser) Close() error {
return nil
}
var (
ctxtP9 = Context{GOARCH: "arm", GOOS: "plan9"}
ctxtAndroid = Context{GOARCH: "arm", GOOS: "android"}
)
var matchFileTests = []struct {
ctxt Context
name string
data string
match bool
}{
{ctxtP9, "foo_arm.go", "", true},
{ctxtP9, "foo1_arm.go", "// +build linux\n\npackage main\n", false},
{ctxtP9, "foo_darwin.go", "", false},
{ctxtP9, "foo.go", "", true},
{ctxtP9, "foo1.go", "// +build linux\n\npackage main\n", false},
{ctxtP9, "foo.badsuffix", "", false},
{ctxtAndroid, "foo_linux.go", "", true},
{ctxtAndroid, "foo_android.go", "", true},
{ctxtAndroid, "foo_plan9.go", "", false},
{ctxtAndroid, "android.go", "", true},
{ctxtAndroid, "plan9.go", "", true},
{ctxtAndroid, "plan9_test.go", "", true},
{ctxtAndroid, "arm.s", "", true},
{ctxtAndroid, "amd64.s", "", true},
}
func TestMatchFile(t *testing.T) {
for _, tt := range matchFileTests {
ctxt := tt.ctxt
ctxt.OpenFile = func(path string) (r io.ReadCloser, err error) {
if path != "x+"+tt.name {
t.Fatalf("OpenFile asked for %q, expected %q", path, "x+"+tt.name)
}
return &readNopCloser{strings.NewReader(tt.data)}, nil
}
ctxt.JoinPath = func(elem ...string) string {
return strings.Join(elem, "+")
}
match, err := ctxt.MatchFile("x", tt.name)
if match != tt.match || err != nil {
t.Fatalf("MatchFile(%q) = %v, %v, want %v, nil", tt.name, match, err, tt.match)
}
}
}
func TestImportCmd(t *testing.T) {
if runtime.GOOS == "darwin" {
switch runtime.GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
}
}
p, err := Import("cmd/internal/objfile", "", 0)
if err != nil {
t.Fatal(err)
}
if !strings.HasSuffix(filepath.ToSlash(p.Dir), "src/cmd/internal/objfile") {
t.Fatalf("Import cmd/internal/objfile returned Dir=%q, want %q", filepath.ToSlash(p.Dir), ".../src/cmd/internal/objfile")
}
}
var (
expandSrcDirPath = filepath.Join(string(filepath.Separator)+"projects", "src", "add")
)
var expandSrcDirTests = []struct {
input, expected string
}{
{"-L ${SRCDIR}/libs -ladd", "-L /projects/src/add/libs -ladd"},
{"${SRCDIR}/add_linux_386.a -pthread -lstdc++", "/projects/src/add/add_linux_386.a -pthread -lstdc++"},
{"Nothing to expand here!", "Nothing to expand here!"},
{"$", "$"},
{"$$", "$$"},
{"${", "${"},
{"$}", "$}"},
{"$FOO ${BAR}", "$FOO ${BAR}"},
{"Find me the $SRCDIRECTORY.", "Find me the $SRCDIRECTORY."},
{"$SRCDIR is missing braces", "$SRCDIR is missing braces"},
}
func TestExpandSrcDir(t *testing.T) {
for _, test := range expandSrcDirTests {
output, _ := expandSrcDir(test.input, expandSrcDirPath)
if output != test.expected {
t.Errorf("%q expands to %q with SRCDIR=%q when %q is expected", test.input, output, expandSrcDirPath, test.expected)
} else {
t.Logf("%q expands to %q with SRCDIR=%q", test.input, output, expandSrcDirPath)
}
}
}
func TestShellSafety(t *testing.T) {
tests := []struct {
input, srcdir, expected string
result bool
}{
{"-I${SRCDIR}/../include", "/projects/src/issue 11868", "-I/projects/src/issue 11868/../include", true},
{"-X${SRCDIR}/1,${SRCDIR}/2", "/projects/src/issue 11868", "-X/projects/src/issue 11868/1,/projects/src/issue 11868/2", true},
{"-I/tmp -I/tmp", "/tmp2", "-I/tmp -I/tmp", false},
{"-I/tmp", "/tmp/[0]", "-I/tmp", true},
{"-I${SRCDIR}/dir", "/tmp/[0]", "-I/tmp/[0]/dir", false},
}
for _, test := range tests {
output, ok := expandSrcDir(test.input, test.srcdir)
if ok != test.result {
t.Errorf("Expected %t while %q expands to %q with SRCDIR=%q; got %t", test.result, test.input, output, test.srcdir, ok)
}
if output != test.expected {
t.Errorf("Expected %q while %q expands with SRCDIR=%q; got %q", test.expected, test.input, test.srcdir, output)
}
}
}
func TestImportVendor(t *testing.T) |
func TestImportVendorFailure(t *testing.T) {
testenv.MustHaveGoBuild(t) // really must just have source
ctxt := Default
ctxt.GOPATH = ""
p, err := ctxt.Import("x.com/y/z", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
if err == nil {
t.Fatalf("found made-up package x.com/y/z in %s", p.Dir)
}
e := err.Error()
if !strings.Contains(e, " (vendor tree)") {
t.Fatalf("error on failed import does not mention GOROOT/src/vendor directory:\n%s", e)
}
}
| {
testenv.MustHaveGoBuild(t) // really must just have source
ctxt := Default
ctxt.GOPATH = ""
p, err := ctxt.Import("golang.org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0)
if err != nil {
t.Fatalf("cannot find vendored golang.org/x/net/http2/hpack from net/http directory: %v", err)
}
want := "vendor/golang.org/x/net/http2/hpack"
if p.ImportPath != want {
t.Fatalf("Import succeeded but found %q, want %q", p.ImportPath, want)
}
} |
bucket_iterator.py | import logging
import random
from collections import deque
from typing import List, Tuple, Iterable, cast, Dict, Deque
from overrides import overrides
from allennlp.common.checks import ConfigurationError
from allennlp.common.util import lazy_groups_of, add_noise_to_dict_values
from allennlp.data.dataset import Batch
from allennlp.data.instance import Instance
from allennlp.data.iterators.data_iterator import DataIterator
from allennlp.data.vocabulary import Vocabulary
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
def sort_by_padding(instances: List[Instance],
sorting_keys: List[Tuple[str, str]], # pylint: disable=invalid-sequence-index
vocab: Vocabulary,
padding_noise: float = 0.0) -> List[Instance]:
"""
Sorts the instances by their padding lengths, using the keys in
``sorting_keys`` (in the order in which they are provided). ``sorting_keys`` is a list of
``(field_name, padding_key)`` tuples.
"""
instances_with_lengths = []
for instance in instances:
# Make sure instance is indexed before calling .get_padding
instance.index_fields(vocab)
padding_lengths = cast(Dict[str, Dict[str, float]], instance.get_padding_lengths())
if padding_noise > 0.0:
noisy_lengths = {}
for field_name, field_lengths in padding_lengths.items():
noisy_lengths[field_name] = add_noise_to_dict_values(field_lengths, padding_noise)
padding_lengths = noisy_lengths
instance_with_lengths = ([padding_lengths[field_name][padding_key]
for (field_name, padding_key) in sorting_keys],
instance)
instances_with_lengths.append(instance_with_lengths) |
@DataIterator.register("bucket")
class BucketIterator(DataIterator):
"""
An iterator which by default, pads batches with respect to the maximum input lengths `per
batch`. Additionally, you can provide a list of field names and padding keys which the dataset
will be sorted by before doing this batching, causing inputs with similar length to be batched
together, making computation more efficient (as less time is wasted on padded elements of the
batch).
Parameters
----------
sorting_keys : List[Tuple[str, str]]
To bucket inputs into batches, we want to group the instances by padding length, so that we
minimize the amount of padding necessary per batch. In order to do this, we need to know
which fields need what type of padding, and in what order.
For example, ``[("sentence1", "num_tokens"), ("sentence2", "num_tokens"), ("sentence1",
"num_token_characters")]`` would sort a dataset first by the "num_tokens" of the
"sentence1" field, then by the "num_tokens" of the "sentence2" field, and finally by the
"num_token_characters" of the "sentence1" field. TODO(mattg): we should have some
documentation somewhere that gives the standard padding keys used by different fields.
padding_noise : float, optional (default=.1)
When sorting by padding length, we add a bit of noise to the lengths, so that the sorting
isn't deterministic. This parameter determines how much noise we add, as a percentage of
the actual padding value for each instance.
biggest_batch_first : bool, optional (default=False)
This is largely for testing, to see how large of a batch you can safely use with your GPU.
This will let you try out the largest batch that you have in the data `first`, so that if
you're going to run out of memory, you know it early, instead of waiting through the whole
epoch to find out at the end that you're going to crash.
Note that if you specify ``max_instances_in_memory``, the first batch will only be the
biggest from among the first "max instances in memory" instances.
batch_size : int, optional, (default = 32)
The size of each batch of instances yielded when calling the iterator.
instances_per_epoch : int, optional, (default = None)
See :class:`BasicIterator`.
max_instances_in_memory : int, optional, (default = None)
See :class:`BasicIterator`.
maximum_samples_per_batch : ``Tuple[str, int]``, (default = None)
See :class:`BasicIterator`.
skip_smaller_batches : bool, optional, (default = False)
When the number of data samples is not dividable by `batch_size`,
some batches might be smaller than `batch_size`.
If set to `True`, those smaller batches will be discarded.
"""
def __init__(self,
sorting_keys: List[Tuple[str, str]],
padding_noise: float = 0.1,
biggest_batch_first: bool = False,
batch_size: int = 32,
instances_per_epoch: int = None,
max_instances_in_memory: int = None,
cache_instances: bool = False,
track_epoch: bool = False,
maximum_samples_per_batch: Tuple[str, int] = None,
skip_smaller_batches: bool = False) -> None:
if not sorting_keys:
raise ConfigurationError("BucketIterator requires sorting_keys to be specified")
super().__init__(cache_instances=cache_instances,
track_epoch=track_epoch,
batch_size=batch_size,
instances_per_epoch=instances_per_epoch,
max_instances_in_memory=max_instances_in_memory,
maximum_samples_per_batch=maximum_samples_per_batch)
self._sorting_keys = sorting_keys
self._padding_noise = padding_noise
self._biggest_batch_first = biggest_batch_first
self._skip_smaller_batches = skip_smaller_batches
@overrides
def _create_batches(self, instances: Iterable[Instance], shuffle: bool) -> Iterable[Batch]:
for instance_list in self._memory_sized_lists(instances):
batches = []
excess: Deque[Instance] = deque()
for batch_instances in lazy_groups_of(iter(instance_list), self._batch_size):
for possibly_smaller_batches in self._ensure_batch_is_sufficiently_small(batch_instances, excess):
if self._skip_smaller_batches and len(possibly_smaller_batches) < self._batch_size:
continue
batches.append(Batch(possibly_smaller_batches))
if excess and (not self._skip_smaller_batches or len(excess) == self._batch_size):
batches.append(Batch(excess))
# TODO(brendanr): Add multi-GPU friendly grouping, i.e. group
# num_gpu batches together, shuffle and then expand the groups.
# This guards against imbalanced batches across GPUs.
move_to_front = self._biggest_batch_first and len(batches) > 1
if move_to_front:
# We'll actually pop the last _two_ batches, because the last one might not be full.
last_batch = batches.pop()
penultimate_batch = batches.pop()
if move_to_front:
batches.insert(0, penultimate_batch)
batches.insert(0, last_batch)
yield from batches | instances_with_lengths.sort(key=lambda x: x[0])
return [instance_with_lengths[-1] for instance_with_lengths in instances_with_lengths]
|
expression-syntax-tree.service.spec.ts | // Copyright 2014 The Oppia Authors. All Rights Reserved.
//
// 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.
/**
* @fileoverview Unit tests for expression-syntax-tree.service.ts
*/
import { TestBed } from '@angular/core/testing';
import { ExpressionSyntaxTreeService, ExpressionError,
ExprUndefinedVarError, ExprWrongArgTypeError,
ExprWrongNumArgsError } from
'expressions/expression-syntax-tree.service.ts';
describe('Expression syntax tree service', () => {
describe('expression syntax tree service', () => {
let expressionSyntaxTreeService: ExpressionSyntaxTreeService;
beforeEach(() => {
expressionSyntaxTreeService = TestBed.get(ExpressionSyntaxTreeService);
});
it('should throw if environment is not found', () => {
expect(() => expressionSyntaxTreeService.lookupEnvs('test', [{}]))
.toThrowMatching(
// Jasmine has no built-in matcher for classes derived from Error.
e => e.toString() === 'ExprUndefinedVarError: test not found in [{}]'
);
});
it('should return the correct environment if exists', () => {
const expected = 'bar';
const actual = <string> expressionSyntaxTreeService.lookupEnvs('foo', [
{foo: 'bar'}
]);
expect(expected).toBe(actual);
});
});
describe('ExpressionError', () => {
let expressionError: ExpressionError;
it('should extend Error object', () => {
expressionError = new ExpressionError();
expect(expressionError.name).toBe('ExpressionError');
expect(expressionError instanceof Error).toBe(true);
});
});
describe('ExprUndefinedVarError', () => {
let exprUndefinedVarError: ExprUndefinedVarError;
it('should extend ExpressionError class', () => {
const exampleVar = undefined;
exprUndefinedVarError = new ExprUndefinedVarError(exampleVar, []);
expect(exprUndefinedVarError.name).toBe('ExprUndefinedVarError');
expect(exprUndefinedVarError instanceof ExpressionError).toBe(true);
});
});
describe('ExprWrongNumArgsError', () => {
let exprWrongNumArgsError: ExprWrongNumArgsError;
it('should extend ExpressionError class', () => { | });
});
describe('ExprWrongArgTypeError', () => {
let exprWrongArgTypeError: ExprWrongArgTypeError;
it('should extend ExpressionError class', () => {
exprWrongArgTypeError = new ExprWrongArgTypeError(undefined, '0', '1');
expect(exprWrongArgTypeError.name).toBe('ExprWrongArgTypeError');
expect(exprWrongArgTypeError instanceof ExpressionError).toBe(true);
});
});
}); | exprWrongNumArgsError = new ExprWrongNumArgsError([], 0, 1);
expect(exprWrongNumArgsError.name).toBe('ExprWrongNumArgsError');
expect(exprWrongNumArgsError instanceof ExpressionError).toBe(true); |
conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Imports ---------------------------------------------------------------------------
import os
from datetime import datetime
from distutils.util import strtobool
from importlib_metadata import metadata
from os import path
# -- Run config ------------------------------------------------------------------------
def get_bool_env_var(name, default=False):
|
run_by_github_actions = get_bool_env_var("GITHUB_ACTIONS")
run_by_rtd = get_bool_env_var("READTHEDOCS")
run_by_ci = run_by_github_actions or run_by_rtd or get_bool_env_var("CI")
# -- Path setup ------------------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
PROJECT_ROOT = path.abspath(path.join(path.abspath(path.dirname(__file__)), "..", ".."))
# -- Project information ---------------------------------------------------------------
meta = metadata("pystiche_papers")
project = meta["name"]
author = meta["author"]
copyright = f"{datetime.now().year}, {author}"
release = meta["version"]
version = ".".join(release.split(".")[:2])
# -- General configuration -------------------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx_autodoc_typehints",
"sphinxcontrib.bibtex",
"sphinx.ext.doctest",
]
# Add any paths that contain templates here, relative to this directory.
# templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
# exclude_patterns = []
# -- Config for intersphinx -----------------------------------------------------------
intersphinx_mapping = {
"python": ("https://docs.python.org/3.6", None),
"torch": ("https://pytorch.org/docs/stable/", None),
"torchvision": ("https://pytorch.org/docs/stable/", None),
"pystiche": ("https://pystiche.readthedocs.io/en/stable/", None),
}
# -- Options for Latex / MathJax ------------------------------------------------------
with open("custom_cmds.tex", "r") as fh:
custom_cmds = fh.read()
latex_elements = {"preamble": custom_cmds}
mathjax_inline = [r"\(" + custom_cmds, r"\)"]
mathjax_display = [r"\[" + custom_cmds, r"\]"]
# -- Options for HTML output -----------------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ["_static"]
| try:
return bool(strtobool(os.environ[name]))
except KeyError:
return default |
0002_auto_20200914_2108.py | # Generated by Django 3.1.1 on 2020-09-14 18:08
from django.db import migrations
import wagtail.core.fields
class | (migrations.Migration):
dependencies = [
('contact', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='contactpage',
name='body',
),
migrations.AddField(
model_name='contactpage',
name='headline_message',
field=wagtail.core.fields.RichTextField(blank=True),
),
migrations.AddField(
model_name='contactpage',
name='headline_title',
field=wagtail.core.fields.RichTextField(blank=True),
),
]
| Migration |
ListItem.js | import React, { Component } from 'react';
import { Text, TouchableWithoutFeedback, View } from 'react-native';
import { Actions } from 'react-native-router-flux';
import { CardSection } from './common';
export default class ListItem extends Component {
onRowPress(){
Actions.employeeEdit({ employee: this.props.employee });
}
render(){
const { name } = this.props.employee;
return (
<TouchableWithoutFeedback onPress={this.onRowPress.bind(this)}>
<View>
<CardSection>
<Text style={styles.titleStyle}>
{name}
</Text>
</CardSection>
</View>
</TouchableWithoutFeedback>
);
}
}
const styles = {
titleStyle: {
fontSize: 18,
paddingLeft: 15
} | }; |
|
parallel-processes.py | #!/usr/bin/python
import sys, os
import math, time
import threading
import getopt # comand line argument handling
from low import *
# =============================================================================
def show_help():
""" displays the program parameter list and usage information """
stdout( "usage: " + sys.argv[0] + " -f <path> -n " )
stdout( " " )
stdout( " option description" )
stdout( " -h help (this text here)" )
stdout( " -f file that contains all system calls, one per line" )
stdout( " -n number of processes to be run in parallel" )
stdout( " " )
sys.exit(1)
# =============================================================================
def handle_arguments():
""" verifies the presence of all necessary arguments and returns the data dir """
if len ( sys.argv ) == 1:
stderr( "no arguments provided." )
show_help()
try: # check for the right arguments
keys, values = getopt.getopt( sys.argv[1:], "hf:n:" )
except getopt.GetoptError:
stderr( "invalid arguments provided." ) | args = {}
for key, value in keys:
if key == '-f': args['file'] = value
if key == '-n': args['ncpu'] = int(value)
if not args.has_key('file'):
stderr( "process file missing." )
show_help()
if not file_exists( args.get('file') ):
stderr( "process file does not exist." )
show_help()
if not args.has_key('ncpu'):
stderr( "number of CPUs to use is missing." )
show_help()
return args
# =============================================================================
def get_jobs( file ):
jobs = []
fo = open( file )
for line in fo:
if not line.startswith("#"): jobs.append(line.rstrip())
fo.close()
return jobs
# =============================================================================
class MyThread( threading.Thread ):
def set_command(self, command):
self.command = command
def run(self):
os.system(self.command)
# =============================================================================
# =============================================================================
def main( args ):
jobs = get_jobs( args.get('file') )
totaljobs = len(jobs)
infomsg( "Collected %s jobs queued | will distribute them among %s CPUs" %(len(jobs), args.get('ncpu')) )
start_time = time.time()
while threading.activeCount() > 1 or len(jobs) > 0:
# check existing threads: still running?
# fill up all remaining slots
elapsed = time.time() - start_time
while threading.activeCount() <= args.get('ncpu') and len(jobs) > 0:
# start new thread
cmd = jobs.pop(0)
t = MyThread()
t.set_command( cmd )
t.start()
remain = elapsed / (totaljobs - len(jobs) + (threading.activeCount() -1)) * len(jobs)
info( "\telapsed: %s\tremaining: %s\t[ jobs done: %s | remain: %s | active: %s ] " % (humanize_time(elapsed), humanize_time(remain), totaljobs - len(jobs) - (threading.activeCount() -1), len(jobs), threading.activeCount() -1) )
time.sleep(0.2)
info( "\n" )
infomsg( "DONE." )
# =============================================================================
# === MAIN ====================================================================
# =============================================================================
args = handle_arguments( )
main( args ) | show_help()
|
insert_form_field_request.go | /*
* --------------------------------------------------------------------------------
* <copyright company="Aspose" file="insert_form_field_request.go">
* Copyright (c) 2020 Aspose.Words for Cloud
* </copyright>
* <summary>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* </summary>
* --------------------------------------------------------------------------------
*/
package models
import (
"fmt"
"net/url"
"strings"
"io"
"encoding/json"
)
// InsertFormFieldRequest contains request data for WordsApiService.InsertFormField method.
type InsertFormFieldRequest struct {
// The filename of the input document.
Name *string
// The properties of the form field.
FormField IFormField
/* optional (nil or map[string]interface{}) with one or more of key / value pairs:
key: "nodePath" value: (string) The path to the node in the document tree.
key: "folder" value: (string) Original document folder.
key: "storage" value: (string) Original document storage.
key: "loadEncoding" value: (string) Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
key: "password" value: (string) Password for opening an encrypted document.
key: "destFileName" value: (string) Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
key: "revisionAuthor" value: (string) Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
key: "revisionDateTime" value: (string) The date and time to use for revisions.
key: "insertBeforeNode" value: (string) The index of the node. A new form field will be inserted before the node with the specified node Id. */
Optionals map[string]interface{}
}
func (data *InsertFormFieldRequest) CreateRequestData() (RequestData, error) {
var result RequestData
result.Method = strings.ToUpper("post")
// create path and map variables
result.Path = "/words/{name}/{nodePath}/formfields"
result.Path = strings.Replace(result.Path, "{"+"name"+"}", fmt.Sprintf("%v", *data.Name), -1)
result.Path = strings.Replace(result.Path, "{"+"nodePath"+"}", fmt.Sprintf("%v", data.Optionals["nodePath"]), -1)
result.Path = strings.Replace(result.Path, "/<nil>", "", -1)
result.Path = strings.Replace(result.Path, "//", "/", -1)
result.HeaderParams = make(map[string]string)
result.QueryParams = url.Values{}
result.FormParams = make([]FormParamContainer, 0)
if err := typeCheckParameter(data.Optionals["nodePath"], "string", "data.Optionals[nodePath]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["folder"], "string", "data.Optionals[folder]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["storage"], "string", "data.Optionals[storage]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["loadEncoding"], "string", "data.Optionals[loadEncoding]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["password"], "string", "data.Optionals[password]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["destFileName"], "string", "data.Optionals[destFileName]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["revisionAuthor"], "string", "data.Optionals[revisionAuthor]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["revisionDateTime"], "string", "data.Optionals[revisionDateTime]"); err != nil {
return result, err
}
if err := typeCheckParameter(data.Optionals["insertBeforeNode"], "string", "data.Optionals[insertBeforeNode]"); err != nil {
return result, err
}
if localVarTempParam, localVarOk := data.Optionals["folder"].(string); localVarOk {
result.QueryParams.Add("Folder", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := data.Optionals["storage"].(string); localVarOk {
result.QueryParams.Add("Storage", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := data.Optionals["loadEncoding"].(string); localVarOk {
result.QueryParams.Add("LoadEncoding", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := data.Optionals["password"].(string); localVarOk |
if localVarTempParam, localVarOk := data.Optionals["destFileName"].(string); localVarOk {
result.QueryParams.Add("DestFileName", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := data.Optionals["revisionAuthor"].(string); localVarOk {
result.QueryParams.Add("RevisionAuthor", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := data.Optionals["revisionDateTime"].(string); localVarOk {
result.QueryParams.Add("RevisionDateTime", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := data.Optionals["insertBeforeNode"].(string); localVarOk {
result.QueryParams.Add("InsertBeforeNode", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/xml", "application/json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
result.HeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml",
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
result.HeaderParams["Accept"] = localVarHttpHeaderAccept
}
result.PostBody = &data.FormField
return result, nil
}
func (data *InsertFormFieldRequest) CreateResponse(reader io.Reader) (response interface{}, err error) {
var successPayload FormFieldResponse
if err = json.NewDecoder(reader).Decode(&successPayload); err != nil {
return nil, err
}
return successPayload, err
} | {
result.QueryParams.Add("Password", parameterToString(localVarTempParam, ""))
} |
style.js | import styled from "styled-components"
| const BackgroundImage = styled.img`
width: 90%;
display: block;
margin-left: auto;
margin-right: auto;
`
export default BackgroundImage | |
memutils.rs | use crate::utils::*;
use botan_sys::*;
/// Const time comparison
///
/// Compare two arrays without leaking side channel information
#[must_use]
pub fn | <T: Copy>(a: &[T], b: &[T]) -> bool {
if a.len() != b.len() {
return false;
}
let bytes = mem::size_of::<T>() * a.len();
let rc = unsafe {
botan_constant_time_compare(a.as_ptr() as *const u8, b.as_ptr() as *const u8, bytes)
};
rc == 0
}
/// Securely zeroize memory
///
/// Write zeros to the array (eg to clear out a key) in a way that is
/// unlikely to be removed by the compiler.
pub fn scrub_mem<T: Copy>(a: &mut [T]) {
let bytes = mem::size_of::<T>() * a.len();
unsafe { botan_scrub_mem(a.as_mut_ptr() as *mut c_void, bytes) };
}
/// Hex encode some data
pub fn hex_encode(x: &[u8]) -> Result<String> {
let flags = 0u32;
let mut output = vec![0u8; x.len() * 2];
call_botan! { botan_hex_encode(x.as_ptr(), x.len(), output.as_mut_ptr() as *mut c_char, flags) };
String::from_utf8(output).map_err(|_| Error::ConversionError)
}
/// Hex decode some data
pub fn hex_decode(x: &str) -> Result<Vec<u8>> {
let mut output = vec![0u8; x.len() / 2];
let mut output_len = output.len();
let input = make_cstr(x)?;
call_botan! { botan_hex_decode(input.as_ptr(), x.len(), output.as_mut_ptr(), &mut output_len) }
output.resize(output_len, 0);
Ok(output)
}
/// Base64 encode some data
///
/// # Examples
///
/// ```
/// assert_eq!(botan::base64_encode(&[97,98,99,100,101,102]).unwrap(), "YWJjZGVm");
/// assert_eq!(botan::base64_encode(&[0x5A, 0x16, 0xAD, 0x4E, 0x17, 0x87, 0x79, 0xC9]).unwrap(), "WhatTheHeck=");
/// ```
pub fn base64_encode(x: &[u8]) -> Result<String> {
let b64_len = 1 + ((x.len() + 2) / 3) * 4;
call_botan_ffi_returning_string(b64_len, &|out_buf, out_len| unsafe {
botan_base64_encode(x.as_ptr(), x.len(), out_buf as *mut c_char, out_len)
})
}
/// Base64 decode some data
///
/// # Examples
///
/// ```
/// assert!(botan::base64_decode("ThisIsInvalid!").is_err());
/// assert_eq!(botan::base64_decode("YWJjZGVm").unwrap(), b"abcdef");
/// ```
pub fn base64_decode(x: &str) -> Result<Vec<u8>> {
// Hard to provide a decent lower bound as it is possible x includes
// lots of spaces or trailing = padding chars
let bin_len = x.len();
let input = make_cstr(x)?;
call_botan_ffi_returning_vec_u8(bin_len, &|out_buf, out_len| unsafe {
botan_base64_decode(input.as_ptr(), x.len(), out_buf, out_len)
})
}
| const_time_compare |
object-const-named.result.js | export default {
"type": "Program",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 17
}
},
"range": [
0,
17
],
"body": [
{
"type": "VariableDeclaration",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 17
}
},
"range": [
0,
17
],
"declarations": [
{
"type": "VariableDeclarator",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 16
}
},
"range": [
6,
16
],
"id": {
"type": "ObjectPattern",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 11
}
},
"range": [
6,
11
],
"properties": [
{
"type": "Property",
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 10
}
},
"range": [
7,
10
],
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 8
}
},
"range": [
7,
8
],
"name": "a"
},
"value": {
"type": "Identifier",
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
}
},
"range": [
9,
10
],
"name": "b"
},
"kind": "init"
}
]
},
"init": {
"type": "ObjectExpression",
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 16
}
},
"range": [
14,
16
],
"properties": []
}
}
],
"kind": "const"
}
],
"sourceType": "script",
"tokens": [
{
"type": "Keyword",
"value": "const",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"range": [
0,
5
]
},
{
"type": "Punctuator",
"value": "{",
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"range": [
6,
7
]
},
{
"type": "Identifier",
"value": "a",
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 8
}
},
"range": [
7,
8
]
},
{
"type": "Punctuator",
"value": ":",
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
8,
9
]
},
{
"type": "Identifier",
"value": "b",
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
}
},
"range": [
9,
10
]
},
{
"type": "Punctuator",
"value": "}",
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
},
"range": [
10,
11
]
},
{
"type": "Punctuator",
"value": "=",
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 13
}
},
"range": [
12,
13
]
},
{
"type": "Punctuator", | "loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 15
}
},
"range": [
14,
15
]
},
{
"type": "Punctuator",
"value": "}",
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 16
}
},
"range": [
15,
16
]
},
{
"type": "Punctuator",
"value": ";",
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 17
}
},
"range": [
16,
17
]
}
]
}; | "value": "{", |
error-after-response.any.js | // META: title=Fetch: network timeout after receiving the HTTP response headers
// META: global=window,worker
// META: timeout=long
// META: script=../resources/utils.js
function | (test, reader, promiseToTest)
{
return reader.read().then((value) => {
validateBufferFromString(value.value, "TEST_CHUNK", "Should receive first chunk");
return promise_rejects_js(test, TypeError, promiseToTest(reader));
});
}
promise_test((test) => {
return fetch("../resources/bad-chunk-encoding.py?count=1").then((response) => {
return checkReader(test, response.body.getReader(), reader => reader.read());
});
}, "Response reader read() promise should reject after a network error happening after resolving fetch promise");
promise_test((test) => {
return fetch("../resources/bad-chunk-encoding.py?count=1").then((response) => {
return checkReader(test, response.body.getReader(), reader => reader.closed);
});
}, "Response reader closed promise should reject after a network error happening after resolving fetch promise");
| checkReader |
signal_viewbox.py | # Copyright 2019 Jetperch LLC
#
# 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.
import pyqtgraph as pg
from PySide2 import QtCore
from .scrollbar import WHEEL_TICK
import logging
class SignalViewBox(pg.ViewBox):
sigWheelZoomXEvent = QtCore.Signal(float, float)
"""A scroll wheel zoom event.
:param x: The x-axis location in axis coordinates.
:param delta: The scroll wheel delta.
"""
sigPanXEvent = QtCore.Signal(object, float)
"""A pan x event.
:param command: One of ['start', 'drag', 'finish', 'abort']
:param x: The x-axis delta from the start in axis coordinates.
"""
def __init__(self, name):
pg.ViewBox.__init__(self, enableMenu=False, enableMouse=False, name=name)
self._pan = None # [total_x_delta in axis coordinates, last_x_scene_pos]
self.log = logging.getLogger(__name__ + '.' + name)
def mouseDragEvent(self, ev, axis=None):
self.log.debug('mouse drag: %s' % (ev, ))
ev.accept()
[x_min, x_max], [y_min, y_max] = self.viewRange()
pmin = self.mapViewToScene(pg.Point(x_min, y_min))
pmax = self.mapViewToScene(pg.Point(x_max, y_max))
xview_range = x_max - x_min
xscene_range = pmax.x() - pmin.x()
pnow_x = ev.scenePos().x()
if self._pan is not None:
dx = (self._pan[1] - pnow_x) * xview_range / xscene_range
self._pan[0] += dx
self._pan[1] = pnow_x
if ev.button() & QtCore.Qt.LeftButton:
if ev.isFinish():
if self._pan is not None:
pan_x, self._pan = self._pan[0], None
self.sigPanXEvent.emit('finish', pan_x)
elif self._pan is None:
self._pan = [0.0, pnow_x]
self.sigPanXEvent.emit('start', 0.0)
else:
self.sigPanXEvent.emit('drag', self._pan[0])
def process_wheel_event(self, ev):
self.log.info('mouse wheel: %s' % (ev,))
ev.accept()
p = self.mapSceneToView(ev.scenePos())
if QtCore.Qt.ShiftModifier & ev.modifiers():
delta = ev.delta() / WHEEL_TICK
(x_min, x_max), _ = self.viewRange()
pan_x = (x_max - x_min) * 0.1 * delta
self.sigPanXEvent.emit('start', 0.0)
self.sigPanXEvent.emit('drag', pan_x)
self.sigPanXEvent.emit('finish', pan_x)
else:
self.sigWheelZoomXEvent.emit(p.x(), ev.delta())
def wheelEvent(self, ev, axis=None):
| pos = ev.scenePos()
if self.geometry().contains(pos):
self.process_wheel_event(ev) |
|
related_15.js | var searchData=
[
['zeroorderhold',['ZeroOrderHold',['../classdrake_1_1systems_1_1_zero_order_hold.html#a0d112baac097caa5fed5378a07d423ce',1,'drake::systems::ZeroOrderHold']]] | ]; |
|
event-pattern.d.ts | /**
* Events in Amazon CloudWatch Events are represented as JSON objects. For more information about JSON objects, see RFC 7159.
*
* Rules use event patterns to select events and route them to targets. A
* pattern either matches an event or it doesn't. Event patterns are represented
* as JSON objects with a structure that is similar to that of events, for
* example:
*
* It is important to remember the following about event pattern matching:
*
* - For a pattern to match an event, the event must contain all the field names
* listed in the pattern. The field names must appear in the event with the
* same nesting structure.
*
* - Other fields of the event not mentioned in the pattern are ignored;
* effectively, there is a ``"*": "*"`` wildcard for fields not mentioned.
*
* - The matching is exact (character-by-character), without case-folding or any
* other string normalization.
*
* - The values being matched follow JSON rules: Strings enclosed in quotes,
* numbers, and the unquoted keywords true, false, and null.
*
* - Number matching is at the string representation level. For example, 300,
* 300.0, and 3.0e2 are not considered equal.
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html
* @stability stable
*/
export interface EventPattern {
/**
* By default, this is set to 0 (zero) in all events.
*
* @default - No filtering on version
* @stability stable | */
readonly version?: string[];
/**
* A unique value is generated for every event.
*
* This can be helpful in
* tracing events as they move through rules to targets, and are processed.
*
* @default - No filtering on id
* @stability stable
*/
readonly id?: string[];
/**
* Identifies, in combination with the source field, the fields and values that appear in the detail field.
*
* Represents the "detail-type" event field.
*
* @default - No filtering on detail type
* @stability stable
*/
readonly detailType?: string[];
/**
* Identifies the service that sourced the event.
*
* All events sourced from
* within AWS begin with "aws." Customer-generated events can have any value
* here, as long as it doesn't begin with "aws." We recommend the use of
* Java package-name style reverse domain-name strings.
*
* To find the correct value for source for an AWS service, see the table in
* AWS Service Namespaces. For example, the source value for Amazon
* CloudFront is aws.cloudfront.
*
* @default - No filtering on source
* @see http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces
* @stability stable
*/
readonly source?: string[];
/**
* The 12-digit number identifying an AWS account.
*
* @default - No filtering on account
* @stability stable
*/
readonly account?: string[];
/**
* The event timestamp, which can be specified by the service originating the event.
*
* If the event spans a time interval, the service might choose
* to report the start time, so this value can be noticeably before the time
* the event is actually received.
*
* @default - No filtering on time
* @stability stable
*/
readonly time?: string[];
/**
* Identifies the AWS region where the event originated.
*
* @default - No filtering on region
* @stability stable
*/
readonly region?: string[];
/**
* This JSON array contains ARNs that identify resources that are involved in the event.
*
* Inclusion of these ARNs is at the discretion of the
* service.
*
* For example, Amazon EC2 instance state-changes include Amazon EC2
* instance ARNs, Auto Scaling events include ARNs for both instances and
* Auto Scaling groups, but API calls with AWS CloudTrail do not include
* resource ARNs.
*
* @default - No filtering on resource
* @stability stable
*/
readonly resources?: string[];
/**
* A JSON object, whose content is at the discretion of the service originating the event.
*
* @default - No filtering on detail
* @stability stable
*/
readonly detail?: {
[key: string]: any;
};
} | |
ViewsContext.ts | import { createContext } from 'react';
import { ViewStateType } from '../types';
const ViewsContext = createContext<{ viewsState: ViewStateType }>({
viewsState: {
views: [],
},
}); | export default ViewsContext; | |
App.js | import React from 'react';
const App = () => {
return (
);
}
| export default App; |
|
bitcoin_fi.ts | <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fi">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Bitlectrum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="75"/>
<source><html><head/><body><p><span style=" font-weight:600;">Bitlectrum</span></p></body></html></source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="113"/>
<source>Copyright © 2014 Bitlectrum Developers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="120"/>
<source>Copyright © 2011-2014 Bitlectrum Developers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="133"/>
<source>Copyright © 2009-2014 Bitcoin Developers
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="14"/>
<source>Address Book</source>
<translation>Osoitekirja</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="20"/>
<source>These are your Bitlectrum addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="33"/>
<source>Double-click to edit address or label</source>
<translation>Kaksoisnapauta muokataksesi osoitetta tai nimeä</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="57"/>
<source>Create a new address</source>
<translation>Luo uusi osoite</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="60"/>
<source>&New Address...</source>
<translation>&Uusi osoite</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="71"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopioi valittu osoite leikepöydälle</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="74"/>
<source>&Copy to Clipboard</source>
<translation>&Kopioi leikepöydälle</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="85"/>
<source>Show &QR Code</source>
<translation>Näytä &QR-koodi</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="96"/>
<source>Sign a message to prove you own this address</source>
<translation>Allekirjoita viesti millä todistat omistavasi tämän osoitteen</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="99"/>
<source>&Sign Message</source>
<translation>&Allekirjoita viesti</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="110"/>
<source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source>
<translation>Poista valittuna oleva osoite listasta. Vain lähettämiseen käytettäviä osoitteita voi poistaa.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="113"/>
<source>&Delete</source>
<translation>&Poista</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="65"/>
<source>Copy address</source>
<translation>Kopioi osoite</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="66"/>
<source>Copy label</source>
<translation>Kopioi nimi</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="67"/>
<source>Edit</source>
<translation>Muokkaa</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="68"/>
<source>Delete</source>
<translation>Poista</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="273"/>
<source>Export Address Book Data</source>
<translation>Vie osoitekirja</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="274"/>
<source>Comma separated file (*.csv)</source>
<translation>Comma separated file (*.csv)</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="287"/>
<source>Error exporting</source>
<translation>Virhe tietojen viennissä</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="287"/>
<source>Could not write to file %1.</source>
<translation>Ei voida kirjoittaa tiedostoon %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="79"/>
<source>Label</source>
<translation>Nimi</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="79"/>
<source>Address</source>
<translation>Osoite</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="115"/>
<source>(no label)</source>
<translation>(ei nimeä)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="26"/>
<source>Dialog</source>
<translation>Dialogi</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="94"/>
<source>TextLabel</source>
<translation>TekstiMerkki</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="47"/>
<source>Enter passphrase</source>
<translation>Anna tunnuslause</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="61"/>
<source>New passphrase</source>
<translation>Uusi tunnuslause</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="75"/>
<source>Repeat new passphrase</source>
<translation>Toista uusi tunnuslause</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="114"/>
<source>Toggle Keyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="37"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Anna lompakolle uusi tunnuslause.<br/>Käytä tunnuslausetta, jossa on ainakin <b>10 satunnaista mekkiä</b> tai <b>kahdeksan sanaa</b>.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="38"/>
<source>Encrypt wallet</source>
<translation>Salaa lompakko</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="41"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Tätä toimintoa varten sinun täytyy antaa lompakon tunnuslause sen avaamiseksi.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="46"/>
<source>Unlock wallet</source>
<translation>Avaa lompakko</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="49"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Tätä toimintoa varten sinun täytyy antaa lompakon tunnuslause salauksen purkuun.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="54"/>
<source>Decrypt wallet</source>
<translation>Pura lompakon salaus</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="57"/>
<source>Change passphrase</source>
<translation>Vaihda tunnuslause</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="58"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Anna vanha ja uusi tunnuslause.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="106"/>
<source>Confirm wallet encryption</source>
<translation>Hyväksy lompakon salaus</translation> | <location filename="../askpassphrasedialog.cpp" line="116"/>
<location filename="../askpassphrasedialog.cpp" line="165"/>
<source>Wallet encrypted</source>
<translation>Lompakko salattu</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="213"/>
<location filename="../askpassphrasedialog.cpp" line="237"/>
<source>Warning: The Caps Lock key is on.</source>
<translation>Varoitus: Caps Lock on päällä.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="122"/>
<location filename="../askpassphrasedialog.cpp" line="129"/>
<location filename="../askpassphrasedialog.cpp" line="171"/>
<location filename="../askpassphrasedialog.cpp" line="177"/>
<source>Wallet encryption failed</source>
<translation>Lompakon salaus epäonnistui</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="107"/>
<source>WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITLECTRUMS</b>!
Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="117"/>
<source>Bitlectrum will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Bitlectrums from being stolen by malware infecting your computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="123"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Lompakon salaaminen epäonnistui sisäisen virheen vuoksi. Lompakkoa ei salattu.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="130"/>
<location filename="../askpassphrasedialog.cpp" line="178"/>
<source>The supplied passphrases do not match.</source>
<translation>Annetut tunnuslauseet eivät täsmää.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="141"/>
<source>Wallet unlock failed</source>
<translation>Lompakon avaaminen epäonnistui.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="142"/>
<location filename="../askpassphrasedialog.cpp" line="153"/>
<location filename="../askpassphrasedialog.cpp" line="172"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Annettu tunnuslause oli väärä.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="152"/>
<source>Wallet decryption failed</source>
<translation>Lompakon salauksen purku epäonnistui.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="166"/>
<source>Wallet passphrase was succesfully changed.</source>
<translation>Lompakon tunnuslause on vaihdettu.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="191"/>
<source>&Overview</source>
<translation>&Yleisnäkymä</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="192"/>
<source>Show general overview of wallet</source>
<translation>Näyttää kokonaiskatsauksen lompakon tilanteesta</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="197"/>
<source>&Transactions</source>
<translation>&Rahansiirrot</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="198"/>
<source>Browse transaction history</source>
<translation>Selaa rahansiirtohistoriaa</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="203"/>
<source>&Minting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="204"/>
<source>Show your minting capacity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="209"/>
<source>&Address Book</source>
<translation>&Osoitekirja</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="210"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Muokkaa tallennettujen nimien ja osoitteiden listaa</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="215"/>
<source>&Receive coins</source>
<translation>&Bitlectrumien vastaanottaminen</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="216"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Näytä Bitlectrumien vastaanottamiseen käytetyt osoitteet</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="221"/>
<source>&Send coins</source>
<translation>&Lähetä Bitlectrumeja</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="227"/>
<source>Sign/Verify &message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="228"/>
<source>Prove you control an address</source>
<translation>Todista että hallitset osoitetta</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="249"/>
<source>E&xit</source>
<translation>L&opeta</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="250"/>
<source>Quit application</source>
<translation>Lopeta ohjelma</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="254"/>
<source>Show information about Bitlectrum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="256"/>
<source>About &Qt</source>
<translation>Tietoja &Qt</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="257"/>
<source>Show information about Qt</source>
<translation>Näytä tietoja QT:ta</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="259"/>
<source>&Options...</source>
<translation>&Asetukset...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="264"/>
<source>&Export...</source>
<translation>&Vie...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="265"/>
<source>Export the data in the current tab to a file</source>
<translation>Vie aukiolevan välilehden tiedot tiedostoon</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="266"/>
<source>&Encrypt Wallet</source>
<translation>&Salaa lompakko</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="267"/>
<source>Encrypt or decrypt wallet</source>
<translation>Kryptaa tai dekryptaa lompakko</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="269"/>
<source>&Unlock Wallet for Minting Only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="270"/>
<source>Unlock wallet only for minting. Sending coins will still require the passphrase.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="272"/>
<source>&Backup Wallet</source>
<translation>&Varmuuskopioi lompakko</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="273"/>
<source>Backup wallet to another location</source>
<translation>Varmuuskopioi lompakko toiseen sijaintiin</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="274"/>
<source>&Change Passphrase</source>
<translation>&Vaihda tunnuslause</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="275"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Vaihda lompakon salaukseen käytettävä tunnuslause</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="276"/>
<source>&Debug window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="277"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="301"/>
<source>&File</source>
<translation>&Tiedosto</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="310"/>
<source>&Settings</source>
<translation>&Asetukset</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="317"/>
<source>&Help</source>
<translation>&Apua</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="326"/>
<source>Tabs toolbar</source>
<translation>Välilehtipalkki</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="338"/>
<source>Actions toolbar</source>
<translation>Toimintopalkki</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="350"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="658"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1. Do you want to pay the fee?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="76"/>
<source>Bitlectrum Wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="222"/>
<source>Send coins to a Bitlectrum address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="253"/>
<source>&About Bitlectrum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="260"/>
<source>Modify configuration options for Bitlectrum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="262"/>
<source>Show/Hide &Bitlectrum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="263"/>
<source>Show or hide the Bitlectrum window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="415"/>
<source>Bitlectrum client</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="443"/>
<source>p-qt</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="507"/>
<source>%n active connection(s) to Bitlectrum network</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="531"/>
<source>Synchronizing with network...</source>
<translation>Synkronoidaan verkon kanssa...</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="533"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished">
<numerusform>~%n block remaining</numerusform>
<numerusform>~%n blocks remaining</numerusform>
</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="544"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="556"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation>Ladattu %1 lohkoa rahansiirron historiasta.</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="571"/>
<source>%n second(s) ago</source>
<translation type="unfinished">
<numerusform>%n sekunti sitten</numerusform>
<numerusform>%n sekuntia sitten</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="575"/>
<source>%n minute(s) ago</source>
<translation type="unfinished">
<numerusform>%n minuutti sitten</numerusform>
<numerusform>%n minuuttia sitten</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="579"/>
<source>%n hour(s) ago</source>
<translation type="unfinished">
<numerusform>%n tunti sitten</numerusform>
<numerusform>%n tuntia sitten</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="583"/>
<source>%n day(s) ago</source>
<translation type="unfinished">
<numerusform>%n päivä sitten</numerusform>
<numerusform>%n päivää sitten</numerusform>
</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="589"/>
<source>Up to date</source>
<translation>Ohjelmisto on ajan tasalla</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="594"/>
<source>Catching up...</source>
<translation>Kurotaan kiinni...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="602"/>
<source>Last received block was generated %1.</source>
<translation>Viimeisin vastaanotettu lohko tuotettu %1.</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="661"/>
<source>Sending...</source>
<translation>Lähetetään...</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="688"/>
<source>Sent transaction</source>
<translation>Lähetetyt rahansiirrot</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="689"/>
<source>Incoming transaction</source>
<translation>Saapuva rahansiirto</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="690"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Päivä: %1
Määrä: %2
Tyyppi: %3
Osoite: %4</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="821"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked for block minting only</b></source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="821"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Lompakko on <b>salattu</b> ja tällä hetkellä <b>avoinna</b></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="831"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Lompakko on <b>salattu</b> ja tällä hetkellä <b>lukittuna</b></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="888"/>
<source>Backup Wallet</source>
<translation>Varmuuskopioi lompakko</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="888"/>
<source>Wallet Data (*.dat)</source>
<translation>Lompakkodata (*.dat)</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="891"/>
<source>Backup Failed</source>
<translation>Varmuuskopio epäonnistui</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="891"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Virhe tallennettaessa lompakkodataa uuteen sijaintiin.</translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="128"/>
<source>A fatal error occured. Bitlectrum can no longer continue safely and will quit.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="14"/>
<source>Coin Control</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="45"/>
<source>Quantity:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="64"/>
<location filename="../forms/coincontroldialog.ui" line="96"/>
<source>0</source>
<translation>0</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="77"/>
<source>Bytes:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="125"/>
<source>Amount:</source>
<translation>Määrä:</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="144"/>
<location filename="../forms/coincontroldialog.ui" line="224"/>
<location filename="../forms/coincontroldialog.ui" line="310"/>
<location filename="../forms/coincontroldialog.ui" line="348"/>
<source>0.00 BTC</source>
<translation>123,456 BTC {0.00 ?}</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="157"/>
<source>Priority:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="205"/>
<source>Fee:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="240"/>
<source>Low Output:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="262"/>
<location filename="../coincontroldialog.cpp" line="572"/>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="291"/>
<source>After Fee:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="326"/>
<source>Change:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="395"/>
<source>(un)select all</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="408"/>
<source>Tree mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="424"/>
<source>List mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="469"/>
<source>Amount</source>
<translation>Määrä</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="479"/>
<source>Address</source>
<translation>Osoite</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="484"/>
<source>Date</source>
<translation>Aika</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="489"/>
<source>Confirmations</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="492"/>
<source>Confirmed</source>
<translation>Vahvistettu</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="497"/>
<source>Coin days</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="502"/>
<source>Priority</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="36"/>
<source>Copy address</source>
<translation>Kopioi osoite</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="37"/>
<source>Copy label</source>
<translation>Kopioi nimi</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="38"/>
<location filename="../coincontroldialog.cpp" line="64"/>
<source>Copy amount</source>
<translation>Kopioi määrä</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="39"/>
<source>Copy transaction ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="63"/>
<source>Copy quantity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="65"/>
<source>Copy fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="66"/>
<source>Copy after fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="67"/>
<source>Copy bytes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="68"/>
<source>Copy priority</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="69"/>
<source>Copy low output</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="70"/>
<source>Copy change</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="388"/>
<source>highest</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="389"/>
<source>high</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="390"/>
<source>medium-high</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="391"/>
<source>medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="395"/>
<source>low-medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="396"/>
<source>low</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="397"/>
<source>lowest</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="572"/>
<source>DUST</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="572"/>
<source>yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="582"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="583"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="584"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="585"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="622"/>
<location filename="../coincontroldialog.cpp" line="688"/>
<source>(no label)</source>
<translation>(ei nimeä)</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="679"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="680"/>
<source>(change)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DisplayOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="275"/>
<source>&Unit to show amounts in: </source>
<translation>&Yksikkö, jossa määrät näytetään: </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="279"/>
<source>Choose the default subdivision unit to show in the interface, and when sending coins</source>
<translation>Valitse oletus lisämääre mikä näkyy käyttöliittymässä ja kun lähetät kolikoita</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="286"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="287"/>
<source>Whether to show Bitlectrum addresses in the transaction list</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="290"/>
<source>Display coin control features (experts only!)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="291"/>
<source>Whether to show coin control features or not</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="14"/>
<source>Edit Address</source>
<translation>Muokkaa osoitetta</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="25"/>
<source>&Label</source>
<translation>&Nimi</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="35"/>
<source>The label associated with this address book entry</source>
<translation>Tähän osoitteeseen liitetty nimi</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="42"/>
<source>&Address</source>
<translation>&Osoite</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="52"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Osoite, joka liittyy tämän osoitekirjan merkintään. Tätä voidaan muuttaa vain lähtevissä osoitteissa.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="20"/>
<source>New receiving address</source>
<translation>Uusi vastaanottava osoite</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="24"/>
<source>New sending address</source>
<translation>Uusi lähettävä osoite</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="27"/>
<source>Edit receiving address</source>
<translation>Muokkaa vastaanottajan osoitetta</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="31"/>
<source>Edit sending address</source>
<translation>Muokkaa lähtevää osoitetta</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="91"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Osoite "%1" on jo osoitekirjassa.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="96"/>
<source>The entered address "%1" is not a valid Bitlectrum address.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="101"/>
<source>Could not unlock wallet.</source>
<translation>Lompakkoa ei voitu avata.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="106"/>
<source>New key generation failed.</source>
<translation>Uuden avaimen luonti epäonnistui.</translation>
</message>
</context>
<context>
<name>MainOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="177"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Pienennä ilmaisinalueelle työkalurivin sijasta</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="178"/>
<source>Show only a tray icon after minimizing the window</source>
<translation>Näytä ainoastaan pikkukuvake ikkunan pienentämisen jälkeen</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="186"/>
<source>Map port using &UPnP</source>
<translation>Portin uudelleenohjaus &UPnP:llä</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="181"/>
<source>M&inimize on close</source>
<translation>P&ienennä ikkuna suljettaessa</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="182"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Ikkunaa suljettaessa vain pienentää Bitlectrum-ohjelman ikkunan lopettamatta itse ohjelmaa. Kun tämä asetus on valittuna, ohjelman voi sulkea vain valitsemalla Lopeta ohjelman valikosta.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="187"/>
<source>Automatically open the Bitlectrum client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="190"/>
<source>&Connect through SOCKS4 proxy:</source>
<translation>&Yhdistä SOCKS4-välityspalvelimen kautta:</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="191"/>
<source>Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)</source>
<translation>Yhdistä Bitlectrum-verkkoon SOCKS4-välityspalvelimen kautta (esimerkiksi käyttäessä Tor:ia)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="196"/>
<source>Proxy &IP: </source>
<translation>Palvelimen &IP: </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="202"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Välityspalvelimen IP-osoite (esim. 127.0.0.1)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="205"/>
<source>&Port: </source>
<translation>&Portti: </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="211"/>
<source>Port of the proxy (e.g. 1234)</source>
<translation>Portti, johon Bitlectrum-asiakasohjelma yhdistää (esim. 1234)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Mandatory network transaction fee per kB transferred. Most transactions are 1 kB and incur a 0.01 BITLECTRUM fee. Note: transfer size may increase depending on the number of input transactions required to be added together to fund the payment.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
<source>Additional network &fee:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="234"/>
<source>Detach databases at shutdown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="235"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="172"/>
<source>&Start Bitlectrum on window system startup</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="173"/>
<source>Automatically start Bitlectrum after the computer is turned on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MintingTableModel</name>
<message>
<location filename="../mintingtablemodel.cpp" line="203"/>
<source>Transaction</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="203"/>
<source>Address</source>
<translation>Osoite</translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="203"/>
<source>Age</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="203"/>
<source>Balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="203"/>
<source>CoinDay</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="203"/>
<source>MintProbability</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="284"/>
<source>minutes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="291"/>
<source>hours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="295"/>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="298"/>
<source>You have %1 chance to find a POS block if you mint %2 %3 at current difficulty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="418"/>
<source>Destination address of the output.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="420"/>
<source>Original transaction id.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="422"/>
<source>Age of the transaction in days.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="424"/>
<source>Balance of the output.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="426"/>
<source>Coin age in the output.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingtablemodel.cpp" line="428"/>
<source>Chance to mint a block within given time interval.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MintingView</name>
<message>
<location filename="../mintingview.cpp" line="33"/>
<source>transaction is too young</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="40"/>
<source>transaction is mature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="47"/>
<source>transaction has reached maximum probability</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="60"/>
<source>Display minting probability within : </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="62"/>
<source>10 min</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="63"/>
<source>24 hours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="64"/>
<source>30 days</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="65"/>
<source>90 days</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="162"/>
<source>Export Minting Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="163"/>
<source>Comma separated file (*.csv)</source>
<translation>Comma separated file (*.csv)</translation>
</message>
<message>
<location filename="../mintingview.cpp" line="171"/>
<source>Address</source>
<translation>Osoite</translation>
</message>
<message>
<location filename="../mintingview.cpp" line="172"/>
<source>Transaction</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="173"/>
<source>Age</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="174"/>
<source>CoinDay</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="175"/>
<source>Balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="176"/>
<source>MintingProbability</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mintingview.cpp" line="180"/>
<source>Error exporting</source>
<translation>Virhe tietojen viennissä</translation>
</message>
<message>
<location filename="../mintingview.cpp" line="180"/>
<source>Could not write to file %1.</source>
<translation>Ei voida kirjoittaa tiedostoon %1.</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../optionsdialog.cpp" line="81"/>
<source>Main</source>
<translation>Yleiset</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="86"/>
<source>Display</source>
<translation>Näyttö</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="106"/>
<source>Options</source>
<translation>Asetukset</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="14"/>
<source>Form</source>
<translation>Lomake</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="40"/>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="54"/>
<source>Number of transactions:</source>
<translation>Rahansiirtojen lukumäärä:</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="61"/>
<source>0</source>
<translation>0</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="68"/>
<source>Unconfirmed:</source>
<translation>Vahvistamatta:</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="82"/>
<source>Stake:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="102"/>
<source>Wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="138"/>
<source><b>Recent transactions</b></source>
<translation><b>Viimeisimmät rahansiirrot</b></translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="104"/>
<source>Your current balance</source>
<translation>Tililläsi tällä hetkellä olevien Bitlectrumien määrä</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="109"/>
<source>Your current stake</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="114"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Niiden saapuvien rahansiirtojen määrä, joita Bitlectrum-verkko ei vielä ole ehtinyt vahvistaa ja siten eivät vielä näy saldossa.</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="117"/>
<source>Total number of transactions in wallet</source>
<translation>Lompakolla tehtyjen rahansiirtojen yhteismäärä</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="14"/>
<source>Dialog</source>
<translation>Dialogi</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="32"/>
<source>QR Code</source>
<translation>QR-koodi</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="55"/>
<source>Request Payment</source>
<translation>Vastaanota maksu</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="70"/>
<source>Amount:</source>
<translation>Määrä:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="105"/>
<source>BITLECTRUM</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="121"/>
<source>Label:</source>
<translation>Tunniste:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="144"/>
<source>Message:</source>
<translation>Viesti:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="186"/>
<source>&Save As...</source>
<translation>&Tallenna nimellä...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="46"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="64"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="121"/>
<source>Save Image...</source>
<translation>Tallenna kuva...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="121"/>
<source>PNG Images (*.png)</source>
<translation>PNG kuvat (*png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="14"/>
<source>Bitlectrum (Bitlectrum) debug window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="24"/>
<source>Information</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="33"/>
<source>Client name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="40"/>
<location filename="../forms/rpcconsole.ui" line="60"/>
<location filename="../forms/rpcconsole.ui" line="106"/>
<location filename="../forms/rpcconsole.ui" line="156"/>
<location filename="../forms/rpcconsole.ui" line="176"/>
<location filename="../forms/rpcconsole.ui" line="196"/>
<location filename="../forms/rpcconsole.ui" line="229"/>
<location filename="../rpcconsole.cpp" line="338"/>
<source>N/A</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="53"/>
<source>Client version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="79"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="92"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="99"/>
<source>Number of connections</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="119"/>
<source>On testnet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="142"/>
<source>Block chain</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="149"/>
<source>Current number of blocks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="169"/>
<source>Estimated total blocks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="189"/>
<source>Last block time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="222"/>
<source>Build date</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="237"/>
<source>Console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="270"/>
<source>></source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="286"/>
<source>Clear console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="306"/>
<source>Welcome to the Bitlectrum RPC console.<br>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.<br>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="14"/>
<location filename="../sendcoinsdialog.cpp" line="176"/>
<location filename="../sendcoinsdialog.cpp" line="181"/>
<location filename="../sendcoinsdialog.cpp" line="186"/>
<location filename="../sendcoinsdialog.cpp" line="191"/>
<location filename="../sendcoinsdialog.cpp" line="197"/>
<location filename="../sendcoinsdialog.cpp" line="202"/>
<location filename="../sendcoinsdialog.cpp" line="207"/>
<source>Send Coins</source>
<translation>Lähetä Bitlectrumeja</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="90"/>
<source>Coin Control Features</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="110"/>
<source>Inputs...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="117"/>
<source>automatically selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="136"/>
<source>Insufficient funds!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="213"/>
<source>Quantity:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="235"/>
<location filename="../forms/sendcoinsdialog.ui" line="270"/>
<source>0</source>
<translation>0</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="251"/>
<source>Bytes:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="302"/>
<source>Amount:</source>
<translation>Määrä:</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="324"/>
<location filename="../forms/sendcoinsdialog.ui" line="410"/>
<location filename="../forms/sendcoinsdialog.ui" line="496"/>
<location filename="../forms/sendcoinsdialog.ui" line="528"/>
<source>0.00 BTC</source>
<translation>123,456 BTC {0.00 ?}</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="337"/>
<source>Priority:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="356"/>
<source>medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="388"/>
<source>Fee:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="423"/>
<source>Low Output:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="442"/>
<source>no</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="474"/>
<source>After Fee:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="509"/>
<source>Change</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="559"/>
<source>custom change address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="665"/>
<source>Send to multiple recipients at once</source>
<translation>Lähetä monelle vastaanottajalle</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="668"/>
<source>&Add recipient...</source>
<translation>&Lisää vastaanottaja...</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="685"/>
<source>Remove all transaction fields</source>
<translation>Poista kaikki rahansiiron kentät</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="688"/>
<source>Clear all</source>
<translation>Tyhjennä lista</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="707"/>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="714"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="745"/>
<source>Confirm the send action</source>
<translation>Vahvista lähetys</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="748"/>
<source>&Send</source>
<translation>&Lähetä</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="51"/>
<source>Copy quantity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="52"/>
<source>Copy amount</source>
<translation>Kopioi määrä</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="53"/>
<source>Copy fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="54"/>
<source>Copy after fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="55"/>
<source>Copy bytes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="56"/>
<source>Copy priority</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="57"/>
<source>Copy low output</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="58"/>
<source>Copy change</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="144"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> to %2 (%3)</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="149"/>
<source>Confirm send coins</source>
<translation>Hyväksy Bitlectrumien lähettäminen</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="150"/>
<source>Are you sure you want to send %1?</source>
<translation>Haluatko varmasti lähettää %1?</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="150"/>
<source> and </source>
<translation> ja </translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="182"/>
<source>The amount to pay must be at least one cent (0.01).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="457"/>
<source>Warning: Invalid Bitcoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="466"/>
<source>Warning: Unknown change address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="477"/>
<source>(no label)</source>
<translation>(ei nimeä)</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="187"/>
<source>Amount exceeds your balance</source>
<translation>Määrä on suurempi kuin tilisi tämänhetkinen saldo.</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="36"/>
<source>Enter a Bitlectrum address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="177"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="192"/>
<source>Total exceeds your balance when the %1 transaction fee is included</source>
<translation>Kokonaissumma ylittäää tilisi saldon, kun siihen lisätään %1 BTC rahansiirtomaksu.</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="198"/>
<source>Duplicate address found, can only send to each address once in one send operation</source>
<translation>Tuplaosite löytynyt, voit ainoastaan lähettää kunkin osoitteen kerran yhdessä lähetysoperaatiossa.</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="203"/>
<source>Error: Transaction creation failed </source>
<translation>Virhe: Rahansiirron luonti epäonnistui</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="208"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Virhe: Rahansiirto hylättiin. Tämä voi tapahtua jos jotkin Bitlectrumeistasi on jo käytetty, esimerkiksi jos olet käyttänyt kopiota wallet.dat-lompakkotiedostosta ja Bitlectrumit on merkitty käytetyksi vain kopiossa.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="14"/>
<source>Form</source>
<translation>Lomake</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="29"/>
<source>A&mount:</source>
<translation>M&äärä:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="42"/>
<source>Pay &To:</source>
<translation>Maksun saaja:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="66"/>
<location filename="../sendcoinsentry.cpp" line="26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Anna nimi tälle osoitteelle, jos haluat lisätä sen osoitekirjaan</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="75"/>
<source>&Label:</source>
<translation>&Nimi:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="93"/>
<source>The address to send the payment to</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose address from address book</source>
<translation>Valitse osoite osoitekirjasta</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="113"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="120"/>
<source>Paste address from clipboard</source>
<translation>Liitä osoite leikepöydältä</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="130"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="137"/>
<source>Remove this recipient</source>
<translation>Poista </translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="25"/>
<source>Enter a Bitlectrum address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="24"/>
<source>&Sign Message</source>
<translation>&Allekirjoita viesti</translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="30"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Voit allekirjoittaa viestit omalla osoitteellasi todistaaksesi että omistat ne. Ole huolellinen, että et allekirjoita mitään epämääräistä, phishing-hyökkääjät voivat huijata sinua allekirjoittamaan luovuttamalla henkilöllisyytesi. Allekirjoita selvitys täysin yksityiskohtaisesti mihin olet sitoutunut.</translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="48"/>
<source>The address to sign the message with</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="55"/>
<location filename="../forms/signverifymessagedialog.ui" line="265"/>
<source>Choose previously used address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="65"/>
<location filename="../forms/signverifymessagedialog.ui" line="275"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="75"/>
<source>Paste address from clipboard</source>
<translation>Liitä osoite leikepöydältä</translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="85"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="97"/>
<source>Enter the message you want to sign here</source>
<translation>Kirjoita tähän viesti minkä haluat allekirjoittaa</translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="104"/>
<source>Signature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="131"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="152"/>
<source>Sign the message to prove you own this Bitlectrum address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="155"/>
<source>Sign &Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="169"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="172"/>
<location filename="../forms/signverifymessagedialog.ui" line="315"/>
<source>Clear &All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="231"/>
<source>&Verify Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="237"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="258"/>
<source>The address the message was signed with</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="295"/>
<source>Verify the message to ensure it was signed with the specified Bitlectrum address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="298"/>
<source>Verify &Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="312"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="29"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="30"/>
<source>Enter the signature of the message</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="31"/>
<location filename="../signverifymessagedialog.cpp" line="32"/>
<source>Enter a Bitlectrum address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="115"/>
<location filename="../signverifymessagedialog.cpp" line="195"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="115"/>
<location filename="../signverifymessagedialog.cpp" line="123"/>
<location filename="../signverifymessagedialog.cpp" line="195"/>
<location filename="../signverifymessagedialog.cpp" line="203"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="123"/>
<location filename="../signverifymessagedialog.cpp" line="203"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="131"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="139"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="151"/>
<source>Message signing failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="156"/>
<source>Message signed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="214"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="214"/>
<location filename="../signverifymessagedialog.cpp" line="227"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="227"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="234"/>
<source>Message verification failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="239"/>
<source>Message verified.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="21"/>
<source>Open for %1 blocks</source>
<translation>Avoinna %1 lohkolle</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="23"/>
<source>Open until %1</source>
<translation>Avoinna %1 asti</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="29"/>
<source>%1/offline?</source>
<translation>%1/ei linjalla?</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="31"/>
<source>%1/unconfirmed</source>
<translation>%1/vahvistamaton</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="33"/>
<source>%1 confirmations</source>
<translation>%1 vahvistusta</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="51"/>
<source><b>Status:</b> </source>
<translation><b>Tila:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="56"/>
<source>, has not been successfully broadcast yet</source>
<translation>, ei ole vielä onnistuneesti lähetetty</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="58"/>
<source>, broadcast through %1 node</source>
<translation>, lähetetään %1 solmun kautta</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="60"/>
<source>, broadcast through %1 nodes</source>
<translation>, lähetetään %1 solmunkautta</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="64"/>
<source><b>Date:</b> </source>
<translation><b>Päivä:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="71"/>
<source><b>Source:</b> Generated<br></source>
<translation><b>Lähde:</b> Generoitu<br></translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="77"/>
<location filename="../transactiondesc.cpp" line="94"/>
<source><b>From:</b> </source>
<translation><b>Lähettäjä:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="94"/>
<source>unknown</source>
<translation>tuntematon</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="95"/>
<location filename="../transactiondesc.cpp" line="118"/>
<location filename="../transactiondesc.cpp" line="178"/>
<source><b>To:</b> </source>
<translation><b>Vast. ott.:</b></translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="98"/>
<source> (yours, label: </source>
<translation>(sinun, tunniste: </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="100"/>
<source> (yours)</source>
<translation>(sinun)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="136"/>
<location filename="../transactiondesc.cpp" line="150"/>
<location filename="../transactiondesc.cpp" line="195"/>
<location filename="../transactiondesc.cpp" line="212"/>
<source><b>Credit:</b> </source>
<translation><b>Krediitti:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="138"/>
<source>(%1 matures in %2 more blocks)</source>
<translation>(%1 erääntyy %2 useammassa lohkossa)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="142"/>
<source>(not accepted)</source>
<translation>(ei hyväksytty)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="186"/>
<location filename="../transactiondesc.cpp" line="194"/>
<location filename="../transactiondesc.cpp" line="209"/>
<source><b>Debit:</b> </source>
<translation><b>Debit:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="200"/>
<source><b>Transaction fee:</b> </source>
<translation><b>Rahansiirtomaksu:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="218"/>
<source><b>Net amount:</b> </source>
<translation><b>Nettomäärä:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="220"/>
<source><b>Retained amount:</b> %1 until %2 more blocks<br></source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="227"/>
<source>Message:</source>
<translation>Viesti:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="229"/>
<source>Comment:</source>
<translation>Kommentti:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="231"/>
<source>Transaction ID:</source>
<translation>Rahansiirron ID:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="234"/>
<source>Generated coins must wait 520 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to "not accepted" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Luotujen kolikoiden on odotettava 120 lohkoa ennen kuin ne voidaan käyttää. Kun loit tämän lohkon, se lähetettiin verkkoon lisättäväksi lohkoketjuun. Jos se epäonnistuu ketjuun liittymisessä, se tila tulee muuttumaan "ei hyväksytty" eikä sitä voi käyttää. Tätä voi silloin tällöin esiintyä jos toinen solmu luo lohkon muutamia sekunteja omastasi. {520 ?}</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="236"/>
<source>Staked coins must wait 520 blocks before they can return to balance and be spent. When you generated this proof-of-stake block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to "not accepted" and not be a valid stake. This may occasionally happen if another node generates a proof-of-stake block within a few seconds of yours.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="14"/>
<source>Transaction details</source>
<translation>Rahansiirron yksityiskohdat</translation>
</message>
<message>
<location filename="../forms/transactiondescdialog.ui" line="20"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Tämä ruutu näyttää yksityiskohtaisen tiedon rahansiirrosta</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="214"/>
<source>Date</source>
<translation>Aika</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="214"/>
<source>Type</source>
<translation>Laatu</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="214"/>
<source>Address</source>
<translation>Osoite</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="214"/>
<source>Amount</source>
<translation>Määrä</translation>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="281"/>
<source>Open for %n block(s)</source>
<translation>
<numerusform>Auki %n lohkolle</numerusform>
<numerusform>Auki %n lohkoille</numerusform>
</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="284"/>
<source>Open until %1</source>
<translation>Avoinna %1 asti</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="287"/>
<source>Offline (%1 confirmations)</source>
<translation>Ei yhteyttä verkkoon (%1 vahvistusta)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="290"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Vahvistamatta (%1/%2 vahvistusta)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="293"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Vahvistettu (%1 vahvistusta)</translation>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="301"/>
<source>Mined balance will be available in %n more blocks</source>
<translation>
<numerusform>Louhittu saldo tulee saataville %n lohkossa</numerusform>
<numerusform>Louhittu saldo tulee saataville %n lohkossa</numerusform>
</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="307"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Tätä lohkoa ei vastaanotettu mistään muusta solmusta ja sitä ei mahdollisesti hyväksytty!</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="310"/>
<source>Generated but not accepted</source>
<translation>Generoitu mutta ei hyväksytty</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="353"/>
<source>Received with</source>
<translation>Vastaanotettu osoitteella</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="355"/>
<source>Received from</source>
<translation>Vastaanotettu</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="358"/>
<source>Sent to</source>
<translation>Saaja</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="360"/>
<source>Payment to yourself</source>
<translation>Maksu itsellesi</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="362"/>
<source>Mined</source>
<translation>Louhittu</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="364"/>
<source>Mint by stake</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="403"/>
<source>(n/a)</source>
<translation>(ei saatavilla)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="603"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Rahansiirron tila. Siirrä osoitin kentän päälle nähdäksesi vahvistusten lukumäärä.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="605"/>
<source>Date and time that the transaction was received.</source>
<translation>Rahansiirron vastaanottamisen päivämäärä ja aika.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="607"/>
<source>Type of transaction.</source>
<translation>Rahansiirron laatu.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="609"/>
<source>Destination address of transaction.</source>
<translation>Rahansiirron kohteen Bitlectrum-osoite</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="611"/>
<source>Amount removed from or added to balance.</source>
<translation>Saldoon lisätty tai siitä vähennetty määrä.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="55"/>
<location filename="../transactionview.cpp" line="71"/>
<source>All</source>
<translation>Kaikki</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="56"/>
<source>Today</source>
<translation>Tänään</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="57"/>
<source>This week</source>
<translation>Tällä viikolla</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="58"/>
<source>This month</source>
<translation>Tässä kuussa</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="59"/>
<source>Last month</source>
<translation>Viime kuussa</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="60"/>
<source>This year</source>
<translation>Tänä vuonna</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="61"/>
<source>Range...</source>
<translation>Alue...</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="72"/>
<source>Received with</source>
<translation>Vastaanotettu osoitteella</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="74"/>
<source>Sent to</source>
<translation>Saaja</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="76"/>
<source>To yourself</source>
<translation>Itsellesi</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="77"/>
<source>Mined</source>
<translation>Louhittu</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="78"/>
<source>Mint by stake</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../transactionview.cpp" line="79"/>
<source>Other</source>
<translation>Muu</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="85"/>
<source>Enter address or label to search</source>
<translation>Anna etsittävä osoite tai tunniste</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="91"/>
<source>Min amount</source>
<translation>Minimimäärä</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="125"/>
<source>Copy address</source>
<translation>Kopioi osoite</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="126"/>
<source>Copy label</source>
<translation>Kopioi nimi</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="127"/>
<source>Copy amount</source>
<translation>Kopioi määrä</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="128"/>
<source>Edit label</source>
<translation>Muokkaa nimeä</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="129"/>
<source>Show details...</source>
<translation>Näytä tarkemmat tiedot...</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="130"/>
<source>Clear orphans</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../transactionview.cpp" line="273"/>
<source>Export Transaction Data</source>
<translation>Vie transaktion tiedot</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="274"/>
<source>Comma separated file (*.csv)</source>
<translation>Comma separated file (*.csv)</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="282"/>
<source>Confirmed</source>
<translation>Vahvistettu</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="283"/>
<source>Date</source>
<translation>Aika</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="284"/>
<source>Type</source>
<translation>Laatu</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="285"/>
<source>Label</source>
<translation>Nimi</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="286"/>
<source>Address</source>
<translation>Osoite</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="287"/>
<source>Amount</source>
<translation>Määrä</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="288"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="292"/>
<source>Error exporting</source>
<translation>Virhe tietojen viennissä</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="292"/>
<source>Could not write to file %1.</source>
<translation>Ei voida kirjoittaa tiedostoon %1.</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="400"/>
<source>Range:</source>
<translation>Alue:</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="408"/>
<source>to</source>
<translation>kenelle</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="164"/>
<source>Sending...</source>
<translation>Lähetetään...</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="11"/>
<source>Warning: Disk space is low </source>
<translation>Varoitus: Kiintolevytila on loppumassa </translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="13"/>
<source>Usage:</source>
<translation>Käyttö:</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="8"/>
<source>Unable to bind to port %d on this computer. Bitlectrum is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="12"/>
<source>Bitlectrum version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="14"/>
<source>Send command to -server or Bitlectrumd</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="15"/>
<source>List commands</source>
<translation>Lista komennoista</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="16"/>
<source>Get help for a command</source>
<translation>Hanki apua käskyyn</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="17"/>
<source>Options:</source>
<translation>Asetukset:</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="18"/>
<source>Specify configuration file (default: Bitlectrum.conf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="19"/>
<source>Specify pid file (default: Bitlectrumd.pid)</source>
<translation>Määritä pid-tiedosto (oletus: Bitlectrum.pid)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="20"/>
<source>Generate coins</source>
<translation>Generoi kolikoita</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="21"/>
<source>Don't generate coins</source>
<translation>Älä generoi kolikoita</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="22"/>
<source>Start minimized</source>
<translation>Käynnistä pienennettynä</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="24"/>
<source>Specify data directory</source>
<translation>Määritä data-hakemisto</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="25"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="26"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="27"/>
<source>Specify connection timeout (in milliseconds)</source>
<translation>Määritä yhteyden aikakatkaisu (millisekunneissa)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="28"/>
<source>Connect through socks4 proxy</source>
<translation>Yhteys socks4-proxyn kautta</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="29"/>
<source>Allow DNS lookups for addnode and connect</source>
<translation>Salli DNS haut lisäsolmulle ja yhdistä</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="30"/>
<source>Listen for connections on <port> (default: 6901 or testnet: 9903)</source>
<translation>Kuuntele yhteyksiä portista <port> (oletus: 8333 tai testnet: 18333) {6901 ?} {9903)?}</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="31"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Pidä enintään <n> yhteyttä verkkoihin (oletus: 125)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="32"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="33"/>
<source>Connect only to the specified node</source>
<translation>Ota yhteys vain tiettyyn solmuun</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="34"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="35"/>
<source>Accept connections from outside (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="36"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="37"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="38"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Kynnysarvo aikakatkaisulle heikosti toimiville verkoille (oletus: 100)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="39"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Sekuntien määrä, kuinka kauan uudelleenkytkeydytään verkkoihin (oletus: 86400)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="42"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)</source>
<translation>Maksimi verkkoyhteyden vastaanottopuskuri, <n>*1000 tavua (oletus: 10000)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="43"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)</source>
<translation>Maksimi verkkoyhteyden lähetyspuskuri, <n>*1000 tavua (oletus: 10000)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="44"/>
<source>Use Universal Plug and Play to map the listening port (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="45"/>
<source>Use Universal Plug and Play to map the listening port (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="46"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="47"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Hyväksy merkkipohjaiset- ja JSON-RPC-käskyt</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="48"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Aja taustalla daemonina ja hyväksy komennot</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="49"/>
<source>Use the test network</source>
<translation>Käytä test -verkkoa</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="50"/>
<source>Output extra debugging information</source>
<translation>Tulosta ylimääräistä debuggaustietoa</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="51"/>
<source>Prepend debug output with timestamp</source>
<translation>Lisää debuggaustiedon tulostukseen aikaleima</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="52"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Lähetä jäljitys/debug-tieto konsoliin, debug.log-tiedoston sijaan</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="53"/>
<source>Send trace/debug info to debugger</source>
<translation>Lähetä jäljitys/debug-tieto debuggeriin</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="54"/>
<source>Username for JSON-RPC connections</source>
<translation>Käyttäjätunnus JSON-RPC-yhteyksille</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="55"/>
<source>Password for JSON-RPC connections</source>
<translation>Salasana JSON-RPC-yhteyksille</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="56"/>
<source>Listen for JSON-RPC connections on <port> (default: 6902)</source>
<translation>Kuuntele JSON-RPC -yhteyksiä portista <port> (oletus: 8332) {6902)?}</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="57"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Salli JSON-RPC yhteydet tietystä ip-osoitteesta</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="58"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Lähetä käskyjä solmuun osoitteessa <ip> (oletus: 127.0.0.1)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="59"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="62"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="63"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Aseta avainpoolin koko arvoon <n> (oletus: 100)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="64"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Skannaa uudelleen lohkoketju lompakon puuttuvien rahasiirtojen vuoksi</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="65"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="66"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="67"/>
<source>
SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="70"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Käytä OpenSSL:ää (https) JSON-RPC-yhteyksille</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="71"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Palvelimen sertifikaatti-tiedosto (oletus: server.cert)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="72"/>
<source>Server private key (default: server.pem)</source>
<translation>Palvelimen yksityisavain (oletus: server.pem)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="73"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Hyväksyttävä salaus (oletus:
TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="76"/>
<source>This help message</source>
<translation>Tämä ohjeviesti</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="77"/>
<source>Usage</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="78"/>
<source>Cannot obtain a lock on data directory %s. Bitlectrum is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="81"/>
<source>Bitlectrum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="88"/>
<source>Error loading wallet.dat: Wallet requires newer version of Bitlectrum</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="89"/>
<source>Wallet needed to be rewritten: restart Bitlectrum to complete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="103"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=bitlectrumrpc
rpcpassword=%s
(you do not need to remember this password)
If the file does not exist, create it with owner-readable-only file permissions.
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="119"/>
<source>Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitlectrum will not work properly.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="82"/>
<source>Loading addresses...</source>
<translation>Ladataan osoitteita...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="83"/>
<source>Error loading addr.dat</source>
<translation>Virhe ladattaessa addr.dat-tiedostoa</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="84"/>
<source>Loading block index...</source>
<translation>Ladataan lohkoindeksiä...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="85"/>
<source>Error loading blkindex.dat</source>
<translation>Virhe ladattaessa blkindex.dat-tiedostoa</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="86"/>
<source>Loading wallet...</source>
<translation>Ladataan lompakkoa...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="87"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Virhe ladattaessa wallet.dat-tiedostoa: Lompakko vioittunut</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="90"/>
<source>Error loading wallet.dat</source>
<translation>Virhe ladattaessa wallet.dat-tiedostoa</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="91"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="92"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="93"/>
<source>Cannot write default address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="94"/>
<source>Rescanning...</source>
<translation>Skannataan uudelleen...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="95"/>
<source>Done loading</source>
<translation>Lataus on valmis</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="96"/>
<source>Invalid -proxy address</source>
<translation>Virheellinen proxy-osoite</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="97"/>
<source>Invalid amount for -paytxfee=<amount></source>
<translation>Virheellinen määrä -paytxfee=<amount></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="98"/>
<source>Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction.</source>
<translation>Varoitus:-paytxfee on erittäin korkea. Tämä on palkkio siirrosta minkä suoritat rahansiirrosta.</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="101"/>
<source>Error: CreateThread(StartNode) failed</source>
<translation>Virhe: CreateThread(StartNode) epäonnistui</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="102"/>
<source>To use the %s option</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="112"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="113"/>
<source>An error occured while setting up the RPC port %i for listening: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="114"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="122"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="123"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="126"/>
<source>Error: Transaction creation failed </source>
<translation>Virhe: Rahansiirron luonti epäonnistui</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="127"/>
<source>Sending...</source>
<translation>Lähetetään...</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="128"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Virhe: Rahansiirto hylättiin. Tämä voi tapahtua jos jotkin Bitlectrumeistasi on jo käytetty, esimerkiksi jos olet käyttänyt kopiota wallet.dat-lompakkotiedostosta ja Bitlectrumit on merkitty käytetyksi vain kopiossa.</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="132"/>
<source>Invalid amount</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="133"/>
<source>Insufficient funds</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS> | </message>
<message> |
models.py | from django.db import models
from mahjong_portal.models import BaseModel
from tournament.models import Tournament
class TournamentStatus(BaseModel):
tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE)
current_round = models.PositiveSmallIntegerField(null=True, blank=True)
end_break_time = models.DateTimeField(null=True, blank=True)
registration_closed = models.BooleanField(default=False)
def __unicode__(self):
return self.tournament.name
class TournamentPlayers(BaseModel):
tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE)
telegram_username = models.CharField(max_length=32, null=True, blank=True)
discord_username = models.CharField(max_length=32, null=True, blank=True)
tenhou_username = models.CharField(max_length=8)
pantheon_id = models.PositiveIntegerField(null=True, blank=True)
# was user info synced with pantheon or not
added_to_pantheon = models.BooleanField(default=False)
# is user added to the pantheon seating or not
enabled_in_pantheon = models.BooleanField(default=True)
# affects user scores (replacement get -30000 per game)
is_replacement = models.BooleanField(default=False)
team_name = models.CharField(max_length=1000, null=True, blank=True)
team_number = models.PositiveIntegerField(null=True, blank=True)
def __unicode__(self):
return self.tenhou_username
class TournamentGame(BaseModel):
NEW = 0
STARTED = 1
FAILED_TO_START = 2
FINISHED = 3
STATUSES = [[NEW, "New"], [STARTED, "Started"], [FAILED_TO_START, "Failed to start"], [FINISHED, "Finished"]]
tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE)
tournament_round = models.PositiveSmallIntegerField(null=True, blank=True)
log_id = models.CharField(max_length=32, null=True, blank=True)
game_index = models.PositiveSmallIntegerField(default=0)
status = models.PositiveSmallIntegerField(choices=STATUSES, default=NEW)
class Meta:
ordering = ["-tournament", "-tournament_round", "status"]
| class TournamentGamePlayer(BaseModel):
player = models.ForeignKey(TournamentPlayers, on_delete=models.CASCADE)
game = models.ForeignKey(TournamentGame, on_delete=models.CASCADE, related_name="game_players")
wind = models.PositiveSmallIntegerField(null=True, blank=True, default=None)
def __unicode__(self):
return "{}, {}, {}, {}".format(
self.player.__unicode__(), self.wind, self.player.pantheon_id, self.player.team_name
)
class TournamentNotification(BaseModel):
TELEGRAM = 0
DISCORD = 1
DESTINATIONS = [[TELEGRAM, "Telegram"], [DISCORD, "Discord"]]
GAME_STARTED = "game_started"
GAME_FAILED = "game_failed"
GAME_FAILED_NO_MEMBERS = "game_failed_no_members"
GAME_ENDED = "game_ended"
GAMES_PREPARED = "games_prepared"
CONFIRMATION_STARTED = "confirmation_started"
CONFIRMATION_ENDED = "confirmation_ended"
ROUND_FINISHED = "round_finished"
TOURNAMENT_FINISHED = "tournament_finished"
GAME_PRE_ENDED = "game_pre_ended"
GAME_PENALTY = "game_penalty"
GAME_LOG_REMINDER = "game_log_reminder"
NOTIFICATION_TYPES = [
[GAME_STARTED, GAME_STARTED],
[GAME_FAILED, GAME_FAILED],
[GAME_FAILED_NO_MEMBERS, GAME_FAILED_NO_MEMBERS],
[GAME_ENDED, GAME_ENDED],
[CONFIRMATION_STARTED, CONFIRMATION_STARTED],
[CONFIRMATION_ENDED, CONFIRMATION_ENDED],
[GAMES_PREPARED, GAMES_PREPARED],
[ROUND_FINISHED, ROUND_FINISHED],
[TOURNAMENT_FINISHED, TOURNAMENT_FINISHED],
[GAME_PRE_ENDED, GAME_PRE_ENDED],
[GAME_PENALTY, GAME_PENALTY],
]
tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE)
notification_type = models.CharField(choices=NOTIFICATION_TYPES, max_length=300)
message_kwargs = models.JSONField(blank=True)
destination = models.PositiveSmallIntegerField(choices=DESTINATIONS)
is_processed = models.BooleanField(default=False)
failed = models.BooleanField(default=False)
class Meta:
ordering = ["-created_on"]
def __unicode__(self):
return f"{self.tournament.name} - {self.get_notification_type_display()}" | def __unicode__(self):
return "{}, {}, {}".format(self.id, self.get_status_display(), self.tournament_round)
|
focus.rs | use crate::{direction::Direction, with_current_grid};
pub fn handle(direction: Direction) -> Result<(), Box<dyn std::error::Error>> {
with_current_grid(|grid| {
| })
} | grid.focus(direction)?;
grid.draw_grid();
Ok(())
|
27.py | class Solution(object):
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
a=0
x=0
while(x<len(nums)):
if nums[x]==val:
|
x+=1
return len(nums) | nums.pop(x)
x-=1 |
conversion_store.go | package docker2aci
import (
"crypto/sha512"
"fmt"
"hash"
"io"
"io/ioutil"
"os"
"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/aci"
"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema"
"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema/types"
)
const (
hashPrefix = "sha512-"
) | type aciInfo struct {
path string
key string
ImageManifest *schema.ImageManifest
}
// ConversionStore is an simple implementation of the acirenderer.ACIRegistry
// interface. It stores the Docker layers converted to ACI so we can take
// advantage of acirenderer to generate a squashed ACI Image.
type ConversionStore struct {
acis map[string]*aciInfo
}
func NewConversionStore() *ConversionStore {
return &ConversionStore{acis: make(map[string]*aciInfo)}
}
func (ms *ConversionStore) WriteACI(path string) (string, error) {
f, err := os.Open(path)
if err != nil {
return "", err
}
defer f.Close()
cr, err := aci.NewCompressedReader(f)
if err != nil {
return "", err
}
h := sha512.New()
r := io.TeeReader(cr, h)
// read the file so we can get the hash
if _, err := io.Copy(ioutil.Discard, r); err != nil {
return "", fmt.Errorf("error reading ACI: %v", err)
}
im, err := aci.ManifestFromImage(f)
if err != nil {
return "", err
}
key := ms.HashToKey(h)
ms.acis[key] = &aciInfo{path: path, key: key, ImageManifest: im}
return key, nil
}
func (ms *ConversionStore) GetImageManifest(key string) (*schema.ImageManifest, error) {
aci, ok := ms.acis[key]
if !ok {
return nil, fmt.Errorf("aci with key: %s not found", key)
}
return aci.ImageManifest, nil
}
func (ms *ConversionStore) GetACI(name types.ACIdentifier, labels types.Labels) (string, error) {
for _, aci := range ms.acis {
// we implement this function to comply with the interface so don't
// bother implementing a proper label check
if aci.ImageManifest.Name.String() == name.String() {
return aci.key, nil
}
}
return "", fmt.Errorf("aci not found")
}
func (ms *ConversionStore) ReadStream(key string) (io.ReadCloser, error) {
img, ok := ms.acis[key]
if !ok {
return nil, fmt.Errorf("stream for key: %s not found", key)
}
f, err := os.Open(img.path)
if err != nil {
return nil, fmt.Errorf("error opening aci: %s", img.path)
}
tr, err := aci.NewCompressedReader(f)
if err != nil {
return nil, err
}
return ioutil.NopCloser(tr), nil
}
func (ms *ConversionStore) ResolveKey(key string) (string, error) {
return key, nil
}
func (ms *ConversionStore) HashToKey(h hash.Hash) string {
s := h.Sum(nil)
return fmt.Sprintf("%s%x", hashPrefix, s)
} | |
insight.service.js | // app/facebookcast/insight/insight.service.js
'use strict';
const utils = require('../../utils');
const constants = require('../../constants');
const fbRequest = require('../fbapi');
const Project = require('../project/project.model');
const Insight = require('./insight.model');
const AdSet = require('../adset/adset.model');
const Ad = require('../ad/ad.model');
const logger = utils.logger();
const moment = utils.moment();
const ProjectModel = Project.Model;
const AdSetModel = AdSet.Model;
const AdModel = Ad.Model;
const AdStatus = Ad.Status;
const PlatformModel = Insight.Model;
const DemographicModel = Insight.DemographicModel;
const InsightField = Insight.Field;
const Breakdown = Insight.Breakdown;
const Formatter = Insight.Formatter;
const breakdowns = {
platform: Breakdown.publisher_platform,
genderAge: `${Breakdown.age},${Breakdown.gender}`,
hour: Breakdown.hourly_stats_aggregated_by_advertiser_time_zone,
region: Breakdown.region,
};
const fields = {
platform: [InsightField.spend, InsightField.reach, InsightField.impressions, InsightField.clicks, InsightField.actions, InsightField.action_values].toString(),
demographic: [InsightField.spend, InsightField.impressions, InsightField.clicks, InsightField.actions].toString(),
};
class | {
async getPromotionInsights(params, mock) {
const castrBizId = params.castrBizId;
const castrLocId = params.castrLocId;
const promotionId = params.promotionId;
const dateRange = params.dateRange;
const locale = params.locale;
const summary = params.summary;
try {
let report;
if (!mock) {
// Fetch project
const project = await ProjectModel.findOne({ castrBizId: castrBizId });
if (!project) throw new Error(`No such Business (#${castrBizId})`);
const timezone = project.timezone;
const currency = project.currency;
// Prepare date range
let start;
let end;
if (!dateRange) {
logger.debug('Preparing default date range...');
end = moment.tz(timezone).endOf('day');
start = moment(end).subtract(27, 'day').startOf('day');
} else {
logger.debug('Validating date range parameter...');
const dates = dateRange.split(',');
start = moment.tz(dates[0], 'YYYYMMDD', timezone).startOf('day');
end = moment.tz(dates[1], 'YYYYMMDD', timezone).endOf('day');
if (end.diff(start) < 0) {
throw new Error(`Invalid date range: endDate (${end.format('L')}) cannot be earlier than startDate (${start.format('L')})`);
}
}
// Prepare filtering param
logger.debug('Preparing filters...');
const query = {};
if (castrBizId) query.castrBizId = castrBizId;
if (castrLocId) query.castrLocId = castrLocId;
if (promotionId) {
query.promotionId = promotionId;
} else {
query.promotionId = { $in: project.adLabels.promotionLabels.map(label => label.name) };
}
// Fetch insights
const dateQuery = (summary && !dateRange) ? {} : { $and: [{ date: { $gte: start.toDate() } }, { date: { $lte: end.toDate() } }] };
const insightsQuery = Object.assign(dateQuery, query);
const insightsRecords = await PlatformModel.find(insightsQuery);
const demographicRecords = await DemographicModel.find(insightsQuery);
if (!summary) {
// Format full insights report
// Count ads
const promotionAds = {};
const platformAds = { facebook: 0, instagram: 0, audienceNetwork: 0 };
const adsQuery = Object.assign({ status: { $ne: AdStatus.deleted } }, query);
const associatedAds = await AdModel.find(adsQuery);
platformAds.total = associatedAds.length;
const associatedAdsets = {};
associatedAds.forEach((ad) => {
if (!associatedAdsets[ad.adsetId]) associatedAdsets[ad.adsetId] = 1;
else associatedAdsets[ad.adsetId] += 1;
});
const adsets = await AdSetModel.find({ id: { $in: Object.keys(associatedAdsets) } });
adsets.forEach((adset) => {
const promoId = adset.promotionId;
const platforms = adset.targeting.publisher_platforms;
if (!promotionAds[promoId]) promotionAds[promoId] = associatedAdsets[adset.id];
else promotionAds[promoId] += associatedAdsets[adset.id];
if (!platforms) {
platformAds.facebook += associatedAdsets[adset.id];
platformAds.instagram += associatedAdsets[adset.id];
platformAds.audienceNetwork += associatedAdsets[adset.id];
} else {
if (platforms.includes('facebook')) platformAds.facebook += associatedAdsets[adset.id];
if (platforms.includes('instagram')) platformAds.instagram += associatedAdsets[adset.id];
if (platforms.includes('audience_network')) platformAds.audienceNetwork += associatedAdsets[adset.id];
}
});
const platformReport = Formatter.platform(insightsRecords, promotionAds, platformAds, timezone);
const demographicReport = Formatter.demographic(demographicRecords, locale);
report = {
platformReport: platformReport,
demographicReport: demographicReport,
};
} else {
// Format summary report
const summaryReport = Formatter.summary(insightsRecords, demographicRecords, locale, timezone);
report = {
promotionName: null,
amountSpent: summaryReport.amountSpent,
currency: project.currency,
dateStart: moment.tz(summaryReport.start, timezone).locale(locale).format('L'),
dateEnd: moment.tz(summaryReport.end, timezone).locale(locale).format('L'),
locations: null,
optimizations: null,
budget: {
facebook: summaryReport.budget.facebook,
instagram: summaryReport.budget.instagram,
audienceNetwork: summaryReport.budget.audience_network,
},
reach: {
total: summaryReport.reach,
unitCost: (summaryReport.amountSpent / (summaryReport.reach / 1000)).toFixed(constants.currencyOffset(currency)),
},
impressions: {
total: summaryReport.impressions,
unitCost: (summaryReport.amountSpent / (summaryReport.impressions / 1000)).toFixed(constants.currencyOffset(currency)),
},
linkClicks: {
total: summaryReport.linkClicks,
unitCost: (summaryReport.amountSpent / summaryReport.linkClicks).toFixed(constants.currencyOffset(currency)),
rate: ((summaryReport.linkClicks / summaryReport.impressions) * 100).toFixed(constants.currencyOffset(2)),
},
purchases: {
total: summaryReport.purchases,
unitCost: (summaryReport.amountSpent / summaryReport.purchases).toFixed(constants.currencyOffset(currency)),
rate: ((summaryReport.purchases / summaryReport.linkClicks) * 100).toFixed(constants.currencyOffset(2)),
},
responses: {
total: summaryReport.responses.total,
addPaymentInfo: summaryReport.responses.addPaymentInfo,
addToCart: summaryReport.responses.addToCart,
addToWishlist: summaryReport.responses.addToWishlist,
completeRegistration: summaryReport.responses.completeRegistration,
initiateCheckout: summaryReport.responses.initiateCheckout,
lead: summaryReport.responses.lead,
search: summaryReport.responses.search,
viewContent: summaryReport.responses.viewContent,
},
genderAge: {
mostLinkClicks: summaryReport.genderAge.linkClicks
.filter(entry => entry.value !== 0)
.sort((a, b) => b.value - a.value)
.slice(0, 4),
mostPurchases: summaryReport.genderAge.purchases
.filter(entry => entry.value !== 0)
.sort((a, b) => b.value - a.value)
.slice(0, 4),
},
region: {
mostLinkClicks: summaryReport.region.linkClicks
.filter(entry => entry.value !== 0)
.sort((a, b) => b.value - a.value)
.slice(0, 4),
mostPurchases: summaryReport.region.purchases
.filter(entry => entry.value !== 0)
.sort((a, b) => b.value - a.value)
.slice(0, 4),
},
hour: {
mostLinkClicks: summaryReport.hour.linkClicks
.filter(entry => entry.value !== 0)
.sort((a, b) => b.value - a.value)
.slice(0, 4),
mostPurchases: summaryReport.hour.purchases
.filter(entry => entry.value !== 0)
.sort((a, b) => b.value - a.value)
.slice(0, 4),
},
};
}
} else {
const demographicReport = {
impressions: {},
clicks: {},
linkClicks: {},
purchases: {},
};
const platformReport = Insight.Mock.platformReport();
const genderAgeResp = Insight.Mock.genderAge();
const regionResp = Insight.Mock.region();
const hourResp = Insight.Mock.hour();
Formatter.genderAge(demographicReport, genderAgeResp.data);
Formatter.region(demographicReport, regionResp.data, locale);
Formatter.hour(demographicReport, hourResp.data);
report = {
platformReport: platformReport,
demographicReport: demographicReport,
};
}
const msg = 'Insights returned';
logger.debug(msg);
return {
success: true,
message: msg,
data: report,
};
} catch (err) {
throw err;
}
}
async getMinimumInsights(params) {
const castrBizId = params.castrBizId;
const castrLocId = params.castrLocId;
let promotionIds = params.promotionIds;
const dateRange = params.dateRange;
try {
const report = {};
// Fetch project
const project = await ProjectModel.findOne({ castrBizId: castrBizId });
if (!project) throw new Error(`No such Business (#${castrBizId})`);
const timezone = project.timezone;
const currency = project.currency;
// Prepare date range
let start;
let end;
if (!dateRange) {
logger.debug('Preparing default date range...');
end = moment.tz(timezone).hour(23).minute(59).second(59).millisecond(999);
start = moment(end).subtract(27, 'day').hour(0).minute(0).second(0).millisecond(0);
} else {
logger.debug('Validating date range parameter...');
const dates = dateRange.split(',');
start = moment.tz(dates[0], 'YYYYMMDD', timezone).hour(0).minute(0).second(0).millisecond(0);
end = moment.tz(dates[1], 'YYYYMMDD', timezone).hour(23).minute(59).second(59).millisecond(999);
if (end.diff(start) < 0) {
throw new Error(`Invalid date range: endDate (${end.format('L')}) cannot be earlier than startDate (${start.format('L')})`);
}
}
// Prepare filtering param
logger.debug('Preparing filters...');
const query = {};
if (castrBizId) query.castrBizId = castrBizId;
if (castrLocId) query.castrLocId = castrLocId;
if (promotionIds) query.promotionId = { $in: promotionIds };
// Fetch insights
const insightsQuery = Object.assign({}, query);
insightsQuery.$and = [{ date: { $gte: start } }, { date: { $lte: end } }];
const platformRecords = await PlatformModel.find(query);
// const demographicRecords = await DemographicModel.find(query);
if (!promotionIds) {
promotionIds = [];
platformRecords.forEach((record) => {
if (!promotionIds.includes(record.promotionId)) promotionIds.push(record.promotionId);
});
}
promotionIds.forEach((promotionId) => {
report[promotionId] = {
linkClicks: 50,
purchases: 20,
amountSpent: 10000,
};
});
const msg = 'Insights returned';
logger.debug(msg);
return {
success: true,
message: msg,
data: {
currency: currency,
promotions: report,
},
};
} catch (err) {
throw err;
}
}
async updatePromotionInsights(promotionParams, mock) {
const insightParams = {
time_increment: 1,
};
try {
const insightsRequests = [];
if (!mock) {
for (let i = 0; i < promotionParams.length; i++) {
const params = promotionParams[i];
const accountId = params.accountId;
params.insights = [];
params.platformInsights = [];
params.demographicInsights = {
genderAge: [],
region: [],
hour: [],
};
// Prepare adlabel filtering
const adlabels = [`"${params.castrBizId}", "${params.castrLocId}", "${params.promotionId}"`];
insightParams.filtering = `[ {"field": "campaign.adlabels","operator": "ALL","value": [${adlabels.join()}] } ]`;
// Prepare last 28 day time query
const end = moment.tz(params.timezone).hour(23).minute(59).second(59).millisecond(999);
const start = moment(end).subtract(28, 'day').hour(0).minute(0).second(0).millisecond(0);
insightParams.time_range = { since: start.format('YYYY-MM-DD'), until: end.format('YYYY-MM-DD') };
// Fetch general insights
const generalParams = Object.assign({}, insightParams);
generalParams.fields = fields.platform;
let generalResponse;
do {
if (generalResponse) {
generalResponse = await fbRequest.get(generalResponse.paging.next, null, null, true);
} else {
generalResponse = await fbRequest.get(accountId, 'insights', generalResponse, true);
}
params.insights = params.insights.concat(generalResponse.body.data);
const utilization = JSON.parse(generalResponse.headers['x-fb-ads-insights-throttle']);
logger.debug(`Insights utilization (app: ${utilization.app_id_util_pct}, account: ${utilization.acc_id_util_pct})`);
} while (generalResponse.body.data.length > 0 && generalResponse.body.paging.next);
// Fetch platform insights
const platformParams = Object.assign({}, insightParams);
platformParams.breakdowns = breakdowns.platform;
platformParams.fields = fields.platform;
let platformResponse;
do {
if (platformResponse) {
platformResponse = await fbRequest.get(platformResponse.paging.next, null, null, true);
} else {
platformResponse = await fbRequest.get(accountId, 'insights', platformParams, true);
}
params.platformInsights = params.platformInsights.concat(platformResponse.body.data);
const utilization = JSON.parse(platformResponse.headers['x-fb-ads-insights-throttle']);
logger.debug(`Insights utilization (app: ${utilization.app_id_util_pct}, account: ${utilization.acc_id_util_pct})`);
} while (platformResponse.body.data.length > 0 && platformResponse.body.paging.next);
// Fetch genderAge insights
const genderAgeParams = Object.assign({}, insightParams);
genderAgeParams.breakdowns = breakdowns.genderAge;
genderAgeParams.fields = fields.demographic;
let genderAgeResponse;
do {
if (genderAgeResponse) {
genderAgeResponse = await fbRequest.get(genderAgeResponse.body.paging.next, null, null, true);
} else {
genderAgeResponse = await fbRequest.get(accountId, 'insights', genderAgeParams, true);
}
params.demographicInsights.genderAge = params.demographicInsights.genderAge.concat(genderAgeResponse.body.data);
const utilization = JSON.parse(genderAgeResponse.headers['x-fb-ads-insights-throttle']);
logger.debug(`Insights utilization (app: ${utilization.app_id_util_pct}, account: ${utilization.acc_id_util_pct})`);
} while (genderAgeResponse.body.data.length > 0 && genderAgeResponse.body.paging.next);
// Fetch region insights
const regionParams = Object.assign({}, insightParams);
regionParams.breakdowns = breakdowns.region;
regionParams.fields = fields.demographic;
let regionResponse;
do {
if (regionResponse) {
regionResponse = await fbRequest.get(regionResponse.body.paging.next, null, null, true);
} else {
regionResponse = await fbRequest.get(accountId, 'insights', regionParams, true);
}
params.demographicInsights.region = params.demographicInsights.region.concat(regionResponse.body.data);
const utilization = JSON.parse(regionResponse.headers['x-fb-ads-insights-throttle']);
logger.debug(`Insights utilization (app: ${utilization.app_id_util_pct}, account: ${utilization.acc_id_util_pct})`);
} while (regionResponse.body.data.length > 0 && regionResponse.body.paging.next);
// Fetch hour insights
const hourParams = Object.assign({}, insightParams);
hourParams.breakdowns = breakdowns.hour;
hourParams.fields = fields.demographic;
let hourResponse;
do {
if (hourResponse) {
hourResponse = await fbRequest.get(hourResponse.body.paging.next, null, null, true);
} else {
hourResponse = await fbRequest.get(accountId, 'insights', hourParams, true);
}
params.demographicInsights.hour = params.demographicInsights.hour.concat(hourResponse.body.data);
const utilization = JSON.parse(hourResponse.headers['x-fb-ads-insights-throttle']);
logger.debug(`Insights utilization (app: ${utilization.app_id_util_pct}, account: ${utilization.acc_id_util_pct})`);
} while (hourResponse.body.data.length > 0 && hourResponse.body.paging.next);
}
} else {
for (let i = 0; i < promotionParams.length; i++) {
const params = promotionParams[i];
const platformPromise = Insight.Mock.platform(params.timezone);
insightsRequests.push(platformPromise.then((fbResponse) => {
params.platformInsights = fbResponse;
}));
}
// Wait for all insights promises to resolve
await Promise.all(insightsRequests);
}
const platformBulk = [];
const demographicBulk = [];
promotionParams.forEach((params) => {
if (params.platformInsights.length > 0) {
params.platformInsights.forEach((insights) => {
const actions = {};
if (insights.actions) {
insights.actions.forEach((event) => {
if (event.action_type === 'link_click') actions.linkClicks = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_add_payment_info') actions.addPaymentInfo = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_add_to_cart') actions.addToCart = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_add_to_wishlist') actions.addToWishlist = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_complete_registration') actions.completeRegistration = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_initiate_checkout') actions.initiateCheckout = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_lead') actions.lead = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_purchase') actions.purchase = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_search') actions.search = event.value;
else if (event.action_type === 'offsite_conversion.fb_pixel_view_content') actions.viewContent = event.value;
});
}
const dateElems = insights.date_stop.split('-');
const date = moment.tz(params.timezone)
.year(dateElems[0]).month(dateElems[1] - 1).date(dateElems[2])
.hour(0).minute(0).second(0).millisecond(0);
platformBulk.push({
updateOne: {
filter: {
date: date.toDate(),
castrBizId: params.castrBizId,
castrLocId: params.castrLocId,
promotionId: params.promotionId,
platform: insights.publisher_platform,
},
update: {
spend: insights.spend || 0,
reach: insights.reach || 0,
impressions: insights.impressions || 0,
clicks: insights.clicks || 0,
linkClicks: actions.linkClicks || 0,
purchases: actions.purchase || 0,
addPaymentInfo: actions.addPaymentInfo || 0,
addToCart: actions.addToCart || 0,
addToWishlist: actions.addToWishlist || 0,
completeRegistration: actions.completeRegistration || 0,
initiateCheckout: actions.initiateCheckout || 0,
lead: actions.lead || 0,
search: actions.search || 0,
viewContent: actions.viewContent || 0,
timeUpdated: new Date(),
},
upsert: true,
},
});
});
}
const demoUpdate = {};
if (params.demographicInsights.genderAge.length > 0) {
params.demographicInsights.genderAge.forEach((insights) => {
const bizId = params.castrBizId;
const locId = params.castrLocId;
const promoId = params.promotionId;
const date = insights.date_stop;
if (!demoUpdate[bizId]) demoUpdate[bizId] = {};
if (!demoUpdate[bizId][locId]) demoUpdate[bizId][locId] = {};
if (!demoUpdate[bizId][locId][promoId]) demoUpdate[bizId][locId][promoId] = {};
if (!demoUpdate[bizId][locId][promoId][date]) {
demoUpdate[bizId][locId][promoId][date] = {
impressions: {},
clicks: {},
linkClicks: {},
purchases: {},
};
}
Object.keys(demoUpdate[bizId][locId][promoId][date]).forEach((metric) => {
if (!demoUpdate[bizId][locId][promoId][date][metric].genderAge) {
demoUpdate[bizId][locId][promoId][date][metric].genderAge = {};
}
if (!demoUpdate[bizId][locId][promoId][date][metric].genderAge[insights.gender]) {
demoUpdate[bizId][locId][promoId][date][metric].genderAge[insights.gender] = {};
}
demoUpdate[bizId][locId][promoId][date][metric].genderAge[insights.gender][insights.age] = this.getValue(insights, metric);
});
});
}
if (params.demographicInsights.region.length > 0) {
params.demographicInsights.region.forEach((insights) => {
const bizId = params.castrBizId;
const locId = params.castrLocId;
const promoId = params.promotionId;
const date = insights.date_stop;
if (!demoUpdate[bizId]) demoUpdate[bizId] = {};
if (!demoUpdate[bizId][locId]) demoUpdate[bizId][locId] = {};
if (!demoUpdate[bizId][locId][promoId]) demoUpdate[bizId][locId][promoId] = {};
if (!demoUpdate[bizId][locId][promoId][date]) {
demoUpdate[bizId][locId][promoId][date] = {
impressions: {},
clicks: {},
linkClicks: {},
purchases: {},
};
}
Object.keys(demoUpdate[bizId][locId][promoId][date]).forEach((metric) => {
if (!demoUpdate[bizId][locId][promoId][date][metric].region) {
demoUpdate[bizId][locId][promoId][date][metric].region = [];
}
demoUpdate[bizId][locId][promoId][date][metric].region.push({
key: insights[Breakdown.region],
value: this.getValue(insights, metric),
});
});
});
}
if (params.demographicInsights.hour.length > 0) {
params.demographicInsights.hour.forEach((insights) => {
const bizId = params.castrBizId;
const locId = params.castrLocId;
const promoId = params.promotionId;
const date = insights.date_stop;
if (!demoUpdate[bizId]) demoUpdate[bizId] = {};
if (!demoUpdate[bizId][locId]) demoUpdate[bizId][locId] = {};
if (!demoUpdate[bizId][locId][promoId]) demoUpdate[bizId][locId][promoId] = {};
if (!demoUpdate[bizId][locId][promoId][date]) {
demoUpdate[bizId][locId][promoId][date] = {
impressions: {},
clicks: {},
linkClicks: {},
purchases: {},
};
}
Object.keys(demoUpdate[bizId][locId][promoId][date]).forEach((metric) => {
if (!demoUpdate[bizId][locId][promoId][date][metric].hour) {
demoUpdate[bizId][locId][promoId][date][metric].hour = {};
}
demoUpdate[bizId][locId][promoId][date][metric].hour[insights[Breakdown.hourly_stats_aggregated_by_advertiser_time_zone]] = this.getValue(insights, metric);
});
});
}
Object.keys(demoUpdate).forEach((bizId) => {
Object.keys(demoUpdate[bizId]).forEach((locId) => {
Object.keys(demoUpdate[bizId][locId]).forEach((promoId) => {
Object.keys(demoUpdate[bizId][locId][promoId]).forEach((date) => {
const dateElems = date.split('-');
const insightDate = moment.tz(params.timezone)
.year(dateElems[0]).month(dateElems[1] - 1).date(dateElems[2])
.hour(0).minute(0).second(0).millisecond(0);
demographicBulk.push({
updateOne: {
filter: {
date: insightDate.toDate(),
castrBizId: bizId,
castrLocId: locId,
promotionId: promoId,
},
update: {
impressions: demoUpdate[bizId][locId][promoId][date].impressions,
clicks: demoUpdate[bizId][locId][promoId][date].clicks,
linkClicks: demoUpdate[bizId][locId][promoId][date].linkClicks,
purchases: demoUpdate[bizId][locId][promoId][date].purchases,
timeUpdated: new Date(),
},
upsert: true,
},
});
});
});
});
});
});
if (platformBulk.length > 0) await PlatformModel.bulkWrite(platformBulk, { ordered: false });
if (demographicBulk.length > 0) await DemographicModel.bulkWrite(demographicBulk, { ordered: false });
const updatedPromotions = promotionParams.filter(params => params.platformInsights.length > 0);
const msg = `${updatedPromotions.length} promotions insights updated`;
logger.debug(msg);
return {
success: true,
message: msg,
data: { updatedPromotions: updatedPromotions },
};
} catch (err) {
throw err;
}
}
getValue(insightObj, metric) {
let value = 0;
if (metric === 'impressions') {
value = insightObj.impressions;
} else if (metric === 'clicks') {
value = insightObj.clicks;
} else if (metric === 'linkClicks') {
if (insightObj.actions) {
for (let i = 0; i < insightObj.actions.length; i++) {
if (insightObj.actions[i].action_type === 'link_click') {
value = insightObj.actions[i].value;
break;
}
}
}
} else if (metric === 'purchases') {
if (insightObj.actions) {
for (let i = 0; i < insightObj.actions.length; i++) {
if (insightObj.actions[i].action_type === 'offsite_conversion.fb_pixel_purchase') {
value = insightObj.actions[i].value;
break;
}
}
}
}
return parseInt(value, 10);
}
}
module.exports = new InsightService();
| InsightService |
models.py | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from sorl.thumbnail import ImageField
# Create your models here.
class Profile(models.Model):
user= models.OneToOneField(
User,
on_delete=models.CASCADE,
related_name="profile"
)
image = ImageField(upload_to='profiles')
def __str__(self) :
return self.user.username
@receiver(post_save,sender=User)
def create_user_profile(sender, instance, created, **kwargs):
| if created:
Profile.objects.create(user=instance) |
|
001-init-table.migration.ts | import { MigrationInterface, QueryRunner } from 'typeorm';
export class | implements MigrationInterface {
name = 'initTable1599256555400';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
"CREATE TABLE `user` (`id` int NOT NULL AUTO_INCREMENT, `name` varchar(255) NULL, `email` varchar(255) NULL, `password` varchar(255) NULL, `salt` varchar(255) NULL, `dci` varchar(10) NULL, `activated` tinyint NULL DEFAULT 0, `source` enum ('site', 'fb') NOT NULL DEFAULT 'site', UNIQUE INDEX `IDX_bc989f4315b237c89c463c07e9` (`email`, `source`), PRIMARY KEY (`id`)) ENGINE=InnoDB",
);
await queryRunner.query(
'CREATE TABLE `card_set` (`id` int NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `short_name` varchar(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB',
);
await queryRunner.query(
'CREATE TABLE `card` (`id` int NOT NULL AUTO_INCREMENT, `card_number` int NOT NULL, `name` varchar(255) NOT NULL, `rarity` varchar(255) NOT NULL, `layout` varchar(255) NOT NULL, `card_set_1` int NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB',
);
await queryRunner.query(
'CREATE TABLE `card_amount` (`id` int NOT NULL AUTO_INCREMENT, `amount` int NOT NULL, `user_1` int NOT NULL, `card_1` int NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB',
);
await queryRunner.query(
'CREATE TABLE `calendar_event` (`id` int NOT NULL AUTO_INCREMENT, `eventStart` datetime NOT NULL, `hour` int NOT NULL, `minute` int NOT NULL, `title` varchar(255) NOT NULL, `location` varchar(255) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB',
);
await queryRunner.query(
'ALTER TABLE `card` ADD CONSTRAINT `FK_b7e0fbc73a13223a3c03e7dc2c9` FOREIGN KEY (`card_set_1`) REFERENCES `card_set`(`id`) ON DELETE NO ACTION ON UPDATE NO ACTION',
);
await queryRunner.query(
'ALTER TABLE `card_amount` ADD CONSTRAINT `FK_0d44ec4a683c6d1bfc9ecacbe0c` FOREIGN KEY (`user_1`) REFERENCES `user`(`id`) ON DELETE NO ACTION ON UPDATE NO ACTION',
);
await queryRunner.query(
'ALTER TABLE `card_amount` ADD CONSTRAINT `FK_82083388ce3d2ffcbb8bfae06d4` FOREIGN KEY (`card_1`) REFERENCES `card`(`id`) ON DELETE NO ACTION ON UPDATE NO ACTION',
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'ALTER TABLE `card_amount` DROP FOREIGN KEY `FK_82083388ce3d2ffcbb8bfae06d4`',
);
await queryRunner.query(
'ALTER TABLE `card_amount` DROP FOREIGN KEY `FK_0d44ec4a683c6d1bfc9ecacbe0c`',
);
await queryRunner.query(
'ALTER TABLE `card` DROP FOREIGN KEY `FK_b7e0fbc73a13223a3c03e7dc2c9`',
);
await queryRunner.query('DROP TABLE `calendar_event`');
await queryRunner.query('DROP TABLE `card_amount`');
await queryRunner.query('DROP TABLE `card`');
await queryRunner.query('DROP TABLE `card_set`');
await queryRunner.query('DROP INDEX `IDX_bc989f4315b237c89c463c07e9` ON `user`');
await queryRunner.query('DROP TABLE `user`');
}
}
| InitTableMigration |
mod.rs | // Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! This module provides `Pruner` which manages a thread pruning old data in the background and is
//! meant to be triggered by other threads as they commit new data to the DB.
use crate::{
metrics::{
LIBRA_STORAGE_OTHER_TIMERS_SECONDS, LIBRA_STORAGE_PRUNER_LEAST_READABLE_STATE_VERSION,
LIBRA_STORAGE_PRUNE_WINDOW,
},
schema::{
jellyfish_merkle_node::JellyfishMerkleNodeSchema, stale_node_index::StaleNodeIndexSchema,
},
};
use anyhow::Result;
use libra_jellyfish_merkle::StaleNodeIndex;
use libra_logger::prelude::*;
use libra_types::transaction::Version;
use schemadb::{ReadOptions, SchemaBatch, SchemaIterator, DB};
#[cfg(test)]
use std::thread::sleep;
use std::{
iter::Peekable,
sync::{
atomic::{AtomicU64, Ordering},
mpsc::{channel, Receiver, Sender},
Arc, Mutex,
},
thread::JoinHandle,
time::{Duration, Instant},
};
/// The `Pruner` is meant to be part of a `LibraDB` instance and runs in the background to prune old
/// data.
///
/// It creates a worker thread on construction and joins it on destruction. When destructed, it
/// quits the worker thread eagerly without waiting for all pending work to be done.
#[derive(Debug)]
pub(crate) struct Pruner {
/// Other than the latest version, how many historical versions to keep being readable. For
/// example, this being 0 means keep only the latest version.
historical_versions_to_keep: u64,
/// The worker thread handle, created upon Pruner instance construction and joined upon its
/// destruction. It only becomes `None` after joined in `drop()`.
worker_thread: Option<JoinHandle<()>>,
/// The sender side of the channel talking to the worker thread.
command_sender: Mutex<Sender<Command>>,
/// (For tests) A way for the worker thread to inform the `Pruner` the pruning progress. If it
/// sets this atomic value to `V`, all versions before `V` can no longer be accessed.
#[allow(dead_code)]
worker_progress: Arc<AtomicU64>,
}
impl Pruner {
/// Creates a worker thread that waits on a channel for pruning commands.
pub fn new(db: Arc<DB>, historical_versions_to_keep: u64) -> Self {
let (command_sender, command_receiver) = channel();
let worker_progress = Arc::new(AtomicU64::new(0));
let worker_progress_clone = Arc::clone(&worker_progress);
LIBRA_STORAGE_PRUNE_WINDOW.set(historical_versions_to_keep as i64);
let worker_thread = std::thread::Builder::new()
.name("libradb_pruner".into())
.spawn(move || Worker::new(db, command_receiver, worker_progress_clone).work_loop())
.expect("Creating pruner thread should succeed.");
Self {
historical_versions_to_keep,
worker_thread: Some(worker_thread),
command_sender: Mutex::new(command_sender),
worker_progress,
}
}
/// Sends pruning command to the worker thread when necessary.
pub fn wake(&self, latest_version: Version) {
if latest_version > self.historical_versions_to_keep {
let least_readable_version = latest_version - self.historical_versions_to_keep;
self.command_sender
.lock()
.expect("command_sender to pruner thread should lock.")
.send(Command::Prune {
least_readable_version,
})
.expect("Receiver should not destruct prematurely.");
}
}
/// (For tests only.) Notifies the worker thread and waits for it to finish its job by polling
/// an internal counter.
#[cfg(test)]
pub fn wake_and_wait(&self, latest_version: Version) -> Result<()> {
self.wake(latest_version);
if latest_version > self.historical_versions_to_keep {
let least_readable_version = latest_version - self.historical_versions_to_keep;
// Assuming no big pruning chunks will be issued by a test.
const TIMEOUT: Duration = Duration::from_secs(10);
let end = Instant::now() + TIMEOUT;
while Instant::now() < end {
if self.worker_progress.load(Ordering::Relaxed) >= least_readable_version {
return Ok(());
}
sleep(Duration::from_millis(1));
}
anyhow::bail!("Timeout waiting for pruner worker.");
}
Ok(())
}
}
impl Drop for Pruner {
fn drop(&mut self) {
self.command_sender
.lock()
.expect("Locking command_sender should not fail.")
.send(Command::Quit)
.expect("Receiver should not destruct.");
self.worker_thread
.take()
.expect("Worker thread must exist.")
.join()
.expect("Worker thread should join peacefully.");
}
}
enum Command {
Quit,
Prune { least_readable_version: Version },
}
struct Worker {
db: Arc<DB>,
command_receiver: Receiver<Command>,
target_least_readable_version: Version,
/// Keeps a record of the pruning progress. If this equals to version `V`, we know versions
/// smaller than `V` are no longer readable.
/// This being an atomic value is to communicate the info with the Pruner thread (for tests).
least_readable_version: Arc<AtomicU64>,
/// Indicates if there's NOT any pending work to do currently, to hint
/// `Self::receive_commands()` to `recv()` blocking-ly.
blocking_recv: bool,
index_min_nonpurged_version: Version,
index_purged_at: Instant,
}
impl Worker {
const MAX_VERSIONS_TO_PRUNE_PER_BATCH: usize = 100;
fn new(
db: Arc<DB>,
command_receiver: Receiver<Command>,
least_readable_version: Arc<AtomicU64>,
) -> Self {
Self {
db,
command_receiver,
least_readable_version,
target_least_readable_version: 0,
blocking_recv: true,
index_min_nonpurged_version: 0,
index_purged_at: Instant::now(),
}
}
fn work_loop(mut self) |
/// Tries to receive all pending commands, blocking waits for the next command if no work needs
/// to be done, otherwise quits with `true` to allow the outer loop to do some work before
/// getting back here.
///
/// Returns `false` if `Command::Quit` is received, to break the outer loop and let
/// `work_loop()` return.
fn receive_commands(&mut self) -> bool {
loop {
let command = if self.blocking_recv {
// Worker has nothing to do, blocking wait for the next command.
self.command_receiver
.recv()
.expect("Sender should not destruct prematurely.")
} else {
// Worker has pending work to do, non-blocking recv.
match self.command_receiver.try_recv() {
Ok(command) => command,
// Channel has drained, yield control to the outer loop.
Err(_) => return true,
}
};
match command {
// On `Command::Quit` inform the outer loop to quit by returning `false`.
Command::Quit => return false,
Command::Prune {
least_readable_version,
} => {
if least_readable_version > self.target_least_readable_version {
self.target_least_readable_version = least_readable_version;
// Switch to non-blocking to allow some work to be done after the
// channel has drained.
self.blocking_recv = false;
}
}
}
}
}
/// Purge the stale node index so that after restart not too much already pruned stuff is dealt
/// with again (although no harm is done deleting those then non-existent things.)
///
/// We issue (range) deletes on the index only periodically instead of after every pruning batch
/// to avoid sending too many deletions to the DB, which takes disk space and slows it down.
fn maybe_purge_index(&mut self) -> Result<()> {
const MIN_INTERVAL: Duration = Duration::from_secs(60);
const MIN_VERSIONS: u64 = 60000;
// A deletion is issued at most once in one minute and when the pruner has progressed by at
// least 60000 versions (assuming the pruner deletes as slow as 1000 versions per second,
// this imposes at most one minute of work in vain after restarting.)
let now = Instant::now();
if now - self.index_purged_at > MIN_INTERVAL {
let least_readable_version = self.least_readable_version.load(Ordering::Relaxed);
if least_readable_version - self.index_min_nonpurged_version + 1 > MIN_VERSIONS {
let new_min_non_purged_version = least_readable_version + 1;
self.db.range_delete::<StaleNodeIndexSchema, Version>(
&self.index_min_nonpurged_version,
&new_min_non_purged_version, // end is exclusive
)?;
self.index_min_nonpurged_version = new_min_non_purged_version;
self.index_purged_at = now;
}
}
Ok(())
}
}
struct StaleNodeIndicesByVersionIterator<'a> {
inner: Peekable<SchemaIterator<'a, StaleNodeIndexSchema>>,
target_least_readable_version: Version,
}
impl<'a> StaleNodeIndicesByVersionIterator<'a> {
fn new(
db: &'a DB,
least_readable_version: Version,
target_least_readable_version: Version,
) -> Result<Self> {
let mut iter = db.iter::<StaleNodeIndexSchema>(ReadOptions::default())?;
iter.seek(&least_readable_version)?;
Ok(Self {
inner: iter.peekable(),
target_least_readable_version,
})
}
fn next_result(&mut self) -> Result<Option<Vec<StaleNodeIndex>>> {
match self.inner.next().transpose()? {
None => Ok(None),
Some((index, _)) => {
let version = index.stale_since_version;
if version > self.target_least_readable_version {
return Ok(None);
}
let mut indices = vec![index];
while let Some(res) = self.inner.peek() {
if let Ok((index_ref, _)) = res {
if index_ref.stale_since_version != version {
break;
}
}
let (index, _) = self.inner.next().transpose()?.expect("Should be Some.");
indices.push(index);
}
Ok(Some(indices))
}
}
}
}
impl<'a> Iterator for StaleNodeIndicesByVersionIterator<'a> {
type Item = Result<Vec<StaleNodeIndex>>;
fn next(&mut self) -> Option<Self::Item> {
self.next_result().transpose()
}
}
pub fn prune_state(
db: Arc<DB>,
least_readable_version: Version,
target_least_readable_version: Version,
max_versions: usize,
) -> Result<Version> {
let indices = StaleNodeIndicesByVersionIterator::new(
&db,
least_readable_version,
target_least_readable_version,
)?
.take(max_versions) // Iterator<Item = Result<Vec<StaleNodeIndex>>>
.collect::<Result<Vec<_>>>()? // now Vec<Vec<StaleNodeIndex>>
.into_iter()
.flatten()
.collect::<Vec<_>>();
if indices.is_empty() {
Ok(least_readable_version)
} else {
let _timer = LIBRA_STORAGE_OTHER_TIMERS_SECONDS
.with_label_values(&["pruner_commit"])
.start_timer();
let new_least_readable_version = indices.last().expect("Should exist.").stale_since_version;
let mut batch = SchemaBatch::new();
indices
.into_iter()
.map(|index| batch.delete::<JellyfishMerkleNodeSchema>(&index.node_key))
.collect::<Result<_>>()?;
db.write_schemas(batch)?;
Ok(new_least_readable_version)
}
}
#[cfg(test)]
mod test;
| {
while self.receive_commands() {
// Process a reasonably small batch of work before trying to receive commands again,
// in case `Command::Quit` is received (that's when we should quit.)
match prune_state(
Arc::clone(&self.db),
self.least_readable_version.load(Ordering::Relaxed),
self.target_least_readable_version,
Self::MAX_VERSIONS_TO_PRUNE_PER_BATCH,
) {
Ok(least_readable_version) => {
// Make next recv() blocking if all done.
self.blocking_recv =
least_readable_version == self.target_least_readable_version;
// Log the progress.
self.least_readable_version
.store(least_readable_version, Ordering::Relaxed);
LIBRA_STORAGE_PRUNER_LEAST_READABLE_STATE_VERSION
.set(least_readable_version as i64);
// Try to purge the log.
if let Err(e) = self.maybe_purge_index() {
warn!(
error = ?e,
"Failed purging state node index, ignored.",
);
}
}
Err(e) => {
error!(
error = ?e,
"Error pruning stale state nodes.",
);
// On error, stop retrying vigorously by making next recv() blocking.
self.blocking_recv = true;
}
}
}
} |
test_hotplugin_memory_c7.py | '''
@author: FangSun
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import functools
_config_ = {
'timeout' : 1000,
'noparallel' : True
}
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
'''
def test()
This document sting is a dirty solution to find test case
'''
test = functools.partial(test_stub.vm_offering_testcase,
tbj=test_obj_dict,
test_image_name="imageName_i_c7",
add_cpu=False,
add_memory=True,
need_online=True)
def | ():
test_lib.lib_error_cleanup(test_obj_dict)
| error_cleanup |
registry.go | package manet
import (
"fmt"
"net"
"sync"
ma "gx/ipfs/QmXY77cVe7rVRQXZZQRioukUM7aRW3BTcAgJe12MCtb3Ji/go-multiaddr"
)
// FromNetAddrFunc is a generic function which converts a net.Addr to Multiaddress
type FromNetAddrFunc func(a net.Addr) (ma.Multiaddr, error)
// ToNetAddrFunc is a generic function which converts a Multiaddress to net.Addr
type ToNetAddrFunc func(ma ma.Multiaddr) (net.Addr, error)
var defaultCodecs *CodecMap
func init() {
defaultCodecs = NewCodecMap()
defaultCodecs.RegisterNetCodec(tcpAddrSpec)
defaultCodecs.RegisterNetCodec(udpAddrSpec)
defaultCodecs.RegisterNetCodec(ip4AddrSpec)
defaultCodecs.RegisterNetCodec(ip6AddrSpec)
defaultCodecs.RegisterNetCodec(ipnetAddrSpec)
}
// CodecMap holds a map of NetCodecs indexed by their Protocol ID
// along with parsers for the addresses they use.
// It is used to keep a list of supported network address codecs (protocols
// which addresses can be converted to and from multiaddresses).
type CodecMap struct {
codecs map[string]*NetCodec
addrParsers map[string]FromNetAddrFunc
maddrParsers map[string]ToNetAddrFunc
lk sync.Mutex
}
// NewCodecMap initializes and returns a CodecMap object.
func NewCodecMap() *CodecMap {
return &CodecMap{
codecs: make(map[string]*NetCodec),
addrParsers: make(map[string]FromNetAddrFunc),
maddrParsers: make(map[string]ToNetAddrFunc),
}
}
// NetCodec is used to identify a network codec, that is, a network type for
// which we are able to translate multiaddresses into standard Go net.Addr
// and back.
type NetCodec struct {
// NetAddrNetworks is an array of strings that may be returned
// by net.Addr.Network() calls on addresses belonging to this type
NetAddrNetworks []string
// ProtocolName is the string value for Multiaddr address keys
ProtocolName string
// ParseNetAddr parses a net.Addr belonging to this type into a multiaddr
ParseNetAddr FromNetAddrFunc
// ConvertMultiaddr converts a multiaddr of this type back into a net.Addr
ConvertMultiaddr ToNetAddrFunc
// Protocol returns the multiaddr protocol struct for this type
Protocol ma.Protocol
}
// RegisterNetCodec adds a new NetCodec to the default codecs.
func RegisterNetCodec(a *NetCodec) {
defaultCodecs.RegisterNetCodec(a)
}
// RegisterNetCodec adds a new NetCodec to the CodecMap. This function is
// thread safe.
func (cm *CodecMap) RegisterNetCodec(a *NetCodec) {
cm.lk.Lock()
defer cm.lk.Unlock()
cm.codecs[a.ProtocolName] = a
for _, n := range a.NetAddrNetworks {
cm.addrParsers[n] = a.ParseNetAddr
}
cm.maddrParsers[a.ProtocolName] = a.ConvertMultiaddr
}
var tcpAddrSpec = &NetCodec{
ProtocolName: "tcp",
NetAddrNetworks: []string{"tcp", "tcp4", "tcp6"},
ParseNetAddr: parseTCPNetAddr,
ConvertMultiaddr: parseBasicNetMaddr,
}
var udpAddrSpec = &NetCodec{
ProtocolName: "udp",
NetAddrNetworks: []string{"udp", "udp4", "udp6"},
ParseNetAddr: parseUDPNetAddr,
ConvertMultiaddr: parseBasicNetMaddr,
}
var ip4AddrSpec = &NetCodec{
ProtocolName: "ip4",
NetAddrNetworks: []string{"ip4"},
ParseNetAddr: parseIPNetAddr,
ConvertMultiaddr: parseBasicNetMaddr,
}
var ip6AddrSpec = &NetCodec{
ProtocolName: "ip6",
NetAddrNetworks: []string{"ip6"},
ParseNetAddr: parseIPNetAddr,
ConvertMultiaddr: parseBasicNetMaddr,
}
var ipnetAddrSpec = &NetCodec{
ProtocolName: "ip+net",
NetAddrNetworks: []string{"ip+net"},
ParseNetAddr: parseIPPlusNetAddr,
ConvertMultiaddr: func(ma.Multiaddr) (net.Addr, error) {
return nil, fmt.Errorf("converting ip+net multiaddr not supported")
},
}
func (cm *CodecMap) getAddrParser(net string) (FromNetAddrFunc, error) {
cm.lk.Lock()
defer cm.lk.Unlock()
parser, ok := cm.addrParsers[net]
if !ok {
return nil, fmt.Errorf("unknown network %v", net)
}
return parser, nil
}
| if !ok {
return nil, fmt.Errorf("network not supported: %s", name)
}
return p, nil
} | func (cm *CodecMap) getMaddrParser(name string) (ToNetAddrFunc, error) {
cm.lk.Lock()
defer cm.lk.Unlock()
p, ok := cm.maddrParsers[name] |
squashfs.go | // Copyright (c) 2019, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the sources of this project regarding your
// rights to use or distribute this software.
package squashfs
import (
"fmt"
"os/exec"
"path/filepath"
"strings"
"github.com/sylabs/singularity/internal/pkg/buildcfg"
"github.com/sylabs/singularity/pkg/util/singularityconf"
)
// GetPath figures out where the mksquashfs binary is
// and return an error is not available or not usable.
func GetPath() (string, error) | {
// Parse singularity configuration file
configFile := buildcfg.SINGULARITY_CONF_FILE
c, err := singularityconf.Parse(configFile)
if err != nil {
return "", fmt.Errorf("unable to parse singularity.conf file: %s", err)
}
// p is either "" or the string value in the conf file
p := c.MksquashfsPath
// If the path contains the binary name use it as is, otherwise add mksquashfs via filepath.Join
if !strings.HasSuffix(c.MksquashfsPath, "mksquashfs") {
p = filepath.Join(c.MksquashfsPath, "mksquashfs")
}
// exec.LookPath functions on absolute paths (ignoring $PATH) as well
return exec.LookPath(p)
} |
|
timesheets.ts | * The version of the OpenAPI document: 2.3.7
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { Timesheet } from '././timesheet';
export class Timesheets {
'timesheets'?: Array<Timesheet>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "timesheets",
"baseName": "Timesheets",
"type": "Array<Timesheet>"
} ];
static getAttributeTypeMap() {
return Timesheets.attributeTypeMap;
}
} | /**
* Xero Payroll AU
* This is the Xero Payroll API for orgs in Australia region.
*
|
|
api_op_DeleteApp.go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sagemaker
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/sagemaker/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/smithy-go/transport/http"
)
// Used to stop and delete an app.
func (c *Client) DeleteApp(ctx context.Context, params *DeleteAppInput, optFns ...func(*Options)) (*DeleteAppOutput, error) {
if params == nil {
params = &DeleteAppInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApp", params, optFns, addOperationDeleteAppMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAppOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAppInput struct {
// The name of the app.
//
// This member is required.
AppName *string
// The type of app.
//
// This member is required.
AppType types.AppType
// The domain ID.
//
// This member is required.
DomainId *string
// The user profile name.
//
// This member is required.
UserProfileName *string
}
type DeleteAppOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
}
func | (stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApp{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApp{}, middleware.After)
if err != nil {
return err
}
awsmiddleware.AddRequestInvocationIDMiddleware(stack)
smithyhttp.AddContentLengthMiddleware(stack)
addResolveEndpointMiddleware(stack, options)
v4.AddComputePayloadSHA256Middleware(stack)
addRetryMiddlewares(stack, options)
addHTTPSignerV4Middleware(stack, options)
awsmiddleware.AddAttemptClockSkewMiddleware(stack)
addClientUserAgent(stack)
smithyhttp.AddErrorCloseResponseBodyMiddleware(stack)
smithyhttp.AddCloseResponseBodyMiddleware(stack)
addOpDeleteAppValidationMiddleware(stack)
stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApp(options.Region), middleware.Before)
addRequestIDRetrieverMiddleware(stack)
addResponseErrorMiddleware(stack)
return nil
}
func newServiceMetadataMiddleware_opDeleteApp(region string) awsmiddleware.RegisterServiceMetadata {
return awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sagemaker",
OperationName: "DeleteApp",
}
}
| addOperationDeleteAppMiddlewares |
message.ts | // @ts-ignore
/* eslint-disable max-classes-per-file */
// @ts-ignore
import { Context, ContextFactoryOptions, ContextDefaultState } from './context';
// @ts-ignore
// @ts-ignore
import { Params } from '../../api';
// @ts-ignore
import { VKError } from '../../errors';
// @ts-ignore
// @ts-ignore
import { transformMessage } from './helpers/transform-message';
// @ts-ignore
import { MessageForwardsCollection, Attachmentable, IAllAttachmentable } from '../shared';
// @ts-ignore
// @ts-ignore
import { Attachment, ExternalAttachment, transformAttachments } from '../attachments';
// @ts-ignore
// @ts-ignore
import {
// @ts-ignore
unescapeHTML,
// @ts-ignore
pickProperties,
// @ts-ignore
getPeerType,
// @ts-ignore
applyMixins,
// @ts-ignore
getRandomId
// @ts-ignore
} from '../../utils/helpers';
// @ts-ignore
import {
// @ts-ignore
UpdateSource,
// @ts-ignore
MessageSource,
// @ts-ignore
PEER_CHAT_ID_OFFSET,
// @ts-ignore
AttachmentType,
// @ts-ignore
kSerializeData,
// @ts-ignore
AttachmentTypeString
// @ts-ignore
} from '../../utils/constants';
// @ts-ignore
import { AllowArray } from '../../types';
// @ts-ignore
import { KeyboardBuilder } from '../keyboard';
// @ts-ignore
import { IUploadSourceMedia } from '../../upload';
// @ts-ignore
// @ts-ignore
export type MessageContextType = 'message';
// @ts-ignore
// @ts-ignore
export type MessageContextPayloadEventType =
// @ts-ignore
'chat_photo_update'
// @ts-ignore
| 'chat_photo_remove'
// @ts-ignore
| 'chat_create'
// @ts-ignore
| 'chat_title_update'
// @ts-ignore
| 'chat_invite_user'
// @ts-ignore
| 'chat_kick_user'
// @ts-ignore
| 'chat_pin_message'
// @ts-ignore
| 'chat_unpin_message'
// @ts-ignore
| 'chat_invite_user_by_link';
// @ts-ignore
// @ts-ignore
export type MessageContextSubType =
// @ts-ignore
'message_new'
// @ts-ignore
| 'message_edit'
// @ts-ignore
| 'message_reply'
// @ts-ignore
| MessageContextPayloadEventType;
// @ts-ignore
// @ts-ignore
const subTypesEnum: Record<string | number, MessageContextSubType> = {
// @ts-ignore
4: 'message_new',
// @ts-ignore
5: 'message_edit',
// @ts-ignore
18: 'message_edit'
// @ts-ignore
};
// @ts-ignore
// @ts-ignore
const kForwards = Symbol('forwards');
// @ts-ignore
const kReplyMessage = Symbol('replyMessage');
// @ts-ignore
const kMessagePayload = Symbol('messagePayload');
// @ts-ignore
// @ts-ignore
const kAttachments = Symbol('attachments');
// @ts-ignore
// @ts-ignore
export interface IMessageContextSendOptions extends Params.MessagesSendParams {
// @ts-ignore
attachment?: AllowArray<Attachment | string>;
// @ts-ignore
keyboard?: KeyboardBuilder | string;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
export interface IMessageContextPayload {
// @ts-ignore
message: {
// @ts-ignore
id: number;
// @ts-ignore
conversation_message_id: number;
// @ts-ignore
out: number;
// @ts-ignore
peer_id: number;
// @ts-ignore
from_id: number;
// @ts-ignore
text?: string;
// @ts-ignore
date: number;
// @ts-ignore
update_time?: number;
// @ts-ignore
random_id: number;
// @ts-ignore
ref?: string;
// @ts-ignore
ref_source?: string;
// @ts-ignore
attachments: object[];
// @ts-ignore
important: boolean;
// @ts-ignore
geo?: {
// @ts-ignore
type: 'point';
// @ts-ignore
coordinates: {
// @ts-ignore
latitude: number;
// @ts-ignore
longitude: number;
// @ts-ignore
};
// @ts-ignore
place?: {
// @ts-ignore
id: number;
// @ts-ignore
title?: string;
// @ts-ignore
latitude?: number;
// @ts-ignore
longitude?: number;
// @ts-ignore
created?: number;
// @ts-ignore
icon?: string;
// @ts-ignore
country: number;
// @ts-ignore
city: string;
// @ts-ignore
// @ts-ignore
type?: number;
// @ts-ignore
group_id?: number;
// @ts-ignore
group_photo?: string;
// @ts-ignore
checkins?: number;
// @ts-ignore
updated?: number;
// @ts-ignore
address?: number;
// @ts-ignore
};
// @ts-ignore
};
// @ts-ignore
payload?: string;
// @ts-ignore
reply_message?: IMessageContextPayload['message'];
// @ts-ignore
fwd_messages?: IMessageContextPayload['message'][];
// @ts-ignore
action?: {
// @ts-ignore
type: MessageContextPayloadEventType;
// @ts-ignore
member_id?: number;
// @ts-ignore
text?: string;
// @ts-ignore
email?: string;
// @ts-ignore
photo?: {
// @ts-ignore
photo_50: string;
// @ts-ignore
photo_100: string;
// @ts-ignore
photo_200: string;
// @ts-ignore
};
// @ts-ignore
};
// @ts-ignore
admin_author_id?: number;
// @ts-ignore
is_cropped?: boolean;
// @ts-ignore
members_count?: number;
// @ts-ignore
was_listened?: boolean;
// @ts-ignore
pinned_at?: number;
// @ts-ignore
message_tag?: string;
// @ts-ignore
is_expired?: boolean;
// @ts-ignore
};
// @ts-ignore
client_info: {
// @ts-ignore
button_actions: (
// @ts-ignore
'text'
// @ts-ignore
| 'vkpay'
// @ts-ignore
| 'open_app'
// @ts-ignore
| 'location'
// @ts-ignore
| 'open_link'
// @ts-ignore
| 'callback'
// @ts-ignore
)[];
// @ts-ignore
keyboard: boolean;
// @ts-ignore
inline_keyboard: boolean;
// @ts-ignore
carousel: boolean;
// @ts-ignore
lang_id: number;
// @ts-ignore
};
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
export type MessageContextOptions<S> =
// @ts-ignore
ContextFactoryOptions<IMessageContextPayload, S>;
// @ts-ignore
// @ts-ignore
class MessageContext<S = ContextDefaultState>
// @ts-ignore
extends Context<
// @ts-ignore
IMessageContextPayload,
// @ts-ignore
S,
// @ts-ignore
MessageContextType,
// @ts-ignore
MessageContextSubType
// @ts-ignore
> {
// @ts-ignore
public $match!: RegExpMatchArray;
// @ts-ignore
// @ts-ignore
public text?: string;
// @ts-ignore
// @ts-ignore
protected $filled: boolean;
// @ts-ignore
// @ts-ignore
protected [kForwards]: MessageForwardsCollection;
// @ts-ignore
// @ts-ignore
protected [kReplyMessage]: MessageContext | undefined;
// @ts-ignore
// @ts-ignore
protected [kAttachments]: (Attachment | ExternalAttachment)[];
// @ts-ignore
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// @ts-ignore
protected [kMessagePayload]: any | undefined;
// @ts-ignore
// @ts-ignore
public constructor(options: MessageContextOptions<S>) {
// @ts-ignore
super({
// @ts-ignore
...options,
// @ts-ignore
// @ts-ignore
type: 'message',
// @ts-ignore
subTypes: []
// @ts-ignore
});
// @ts-ignore
// @ts-ignore
if (options.source === UpdateSource.POLLING) {
// @ts-ignore
this.$filled = false;
// @ts-ignore
// @ts-ignore
this.applyPayload(
// @ts-ignore
transformMessage((options.payload as unknown) as Parameters<typeof transformMessage>[0])
// @ts-ignore
);
// @ts-ignore
} else {
// @ts-ignore
this.$filled = true;
// @ts-ignore
// @ts-ignore
this.applyPayload(options.payload);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
this.subTypes = [
// @ts-ignore
this.eventType
// @ts-ignore
|| subTypesEnum[options.updateType]
// @ts-ignore
|| options.updateType as MessageContextSubType
// @ts-ignore
];
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Load message payload
// @ts-ignore
*/
// @ts-ignore
async loadMessagePayload({ force = false } = {}): Promise<void> {
// @ts-ignore
if (this.$filled && !force) {
// @ts-ignore
return;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
const { items } = this.id !== 0
// @ts-ignore
? await this.api.messages.getById({
// @ts-ignore
message_ids: this.id
// @ts-ignore
})
// @ts-ignore
: await this.api.messages.getByConversationMessageId({
// @ts-ignore
peer_id: this.peerId,
// @ts-ignore
conversation_message_ids: this.conversationMessageId!
// @ts-ignore
});
// @ts-ignore
// @ts-ignore
const [message] = items;
// @ts-ignore
// @ts-ignore
this.applyPayload(message as IMessageContextPayload['message']);
// @ts-ignore
// @ts-ignore
this.$filled = true;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks if there is text
// @ts-ignore
*/
// @ts-ignore
public get hasText(): boolean {
// @ts-ignore
return Boolean(this.text);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks for reply message
// @ts-ignore
*/
// @ts-ignore
public get hasReplyMessage(): boolean {
// @ts-ignore
return this.replyMessage !== undefined;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks for forwarded messages
// @ts-ignore
*/
// @ts-ignore
public get hasForwards(): boolean {
// @ts-ignore
return this.forwards.length > 0;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks for hast message payload
// @ts-ignore
*/
// @ts-ignore
public get hasMessagePayload(): boolean {
// @ts-ignore
return Boolean(this.message.payload);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks if there is text
// @ts-ignore
*/
// @ts-ignore
public get hasGeo(): boolean {
// @ts-ignore
return Boolean(this.message.geo);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks is a chat
// @ts-ignore
*/
// @ts-ignore
public get isChat(): boolean {
// @ts-ignore
return this.peerType === MessageSource.CHAT;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Check is a user
// @ts-ignore
*/
// @ts-ignore
public get isUser(): boolean {
// @ts-ignore
return this.senderType === MessageSource.USER;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks is a group
// @ts-ignore
*/
// @ts-ignore
public get isGroup(): boolean {
// @ts-ignore
return this.senderType === MessageSource.GROUP;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks is from the user
// @ts-ignore
*/
// @ts-ignore
public get isFromUser(): boolean {
// @ts-ignore
return this.peerType === MessageSource.USER;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks is from the group
// @ts-ignore
*/
// @ts-ignore
public get isFromGroup(): boolean {
// @ts-ignore
return this.peerType === MessageSource.GROUP;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks a message has arrived in direct messages
// @ts-ignore
*/
// @ts-ignore
public get isDM(): boolean {
// @ts-ignore
return this.isFromUser || this.isFromGroup;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Check is special event
// @ts-ignore
*/
// @ts-ignore
public get isEvent(): boolean {
// @ts-ignore
return this.eventType !== undefined;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks whether the message is outbox
// @ts-ignore
*/
// @ts-ignore
public get isOutbox(): boolean {
// @ts-ignore
return Boolean(this.message.out);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks whether the message is inbox
// @ts-ignore
*/
// @ts-ignore
public get isInbox(): boolean {
// @ts-ignore
return !this.isOutbox;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks that the message is important
// @ts-ignore
*/
// @ts-ignore
public get isImportant(): boolean {
// @ts-ignore
return this.message.important;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the identifier message
// @ts-ignore
*/
// @ts-ignore
public get id(): number {
// @ts-ignore
return this.message.id;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the conversation message id
// @ts-ignore
*/
// @ts-ignore
public get conversationMessageId(): number | undefined {
// @ts-ignore
return this.message.conversation_message_id;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the destination identifier
// @ts-ignore
*/
// @ts-ignore
public get peerId(): number {
// @ts-ignore
return this.message.peer_id;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the peer type
// @ts-ignore
*/
// @ts-ignore
public get peerType(): string {
// @ts-ignore
return getPeerType(this.message.peer_id);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the sender identifier
// @ts-ignore
*/
// @ts-ignore
public get senderId(): number {
// @ts-ignore
return this.message.from_id;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the sender type
// @ts-ignore
*/
// @ts-ignore
public get senderType(): string {
// @ts-ignore
return getPeerType(this.message.from_id);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the identifier chat
// @ts-ignore
*/
// @ts-ignore
public get chatId(): number | undefined {
// @ts-ignore
if (!this.isChat) {
// @ts-ignore
return undefined;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
return this.peerId - PEER_CHAT_ID_OFFSET;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the referral value
// @ts-ignore
*/
// @ts-ignore
public get referralValue(): string | undefined {
// @ts-ignore
return this.message.ref;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the referral source
// @ts-ignore
*/
// @ts-ignore
public get referralSource(): string | undefined {
// @ts-ignore
return this.message.ref_source;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the date when this message was created
// @ts-ignore
*/
// @ts-ignore
public get createdAt(): number {
// @ts-ignore
return this.message.date;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the date when this message was updated
// @ts-ignore
*/
// @ts-ignore
public get updatedAt(): number | undefined {
// @ts-ignore
return this.message.update_time;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns geo
// @ts-ignore
*/
// @ts-ignore
public get geo(): IMessageContextPayload['message']['geo'] | undefined {
// @ts-ignore
if (!this.hasGeo || !this.$filled) {
// @ts-ignore
return undefined;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
return this.message.geo;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the sender (admin community) identifier, only for community messages
// @ts-ignore
*/
// @ts-ignore
public get adminAuthorId(): IMessageContextPayload['message']['admin_author_id'] | undefined {
// @ts-ignore
return this.message.admin_author_id;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks whether the message is cropped for bot
// @ts-ignore
*/
// @ts-ignore
public get isCropped(): IMessageContextPayload['message']['is_cropped'] | undefined {
// @ts-ignore
return this.message.is_cropped;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the members count
// @ts-ignore
*/
// @ts-ignore
public get membersCount(): IMessageContextPayload['message']['members_count'] | undefined {
// @ts-ignore
return this.message.members_count;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks whether the attached audio message has already been listened by you
// @ts-ignore
*/
// @ts-ignore
public get wasListened(): IMessageContextPayload['message']['was_listened'] | undefined {
// @ts-ignore
return this.message.was_listened;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the date when this message was pinned
// @ts-ignore
*/
// @ts-ignore
public get pinnedAt(): IMessageContextPayload['message']['pinned_at'] | undefined {
// @ts-ignore
return this.message.pinned_at;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the string for matching user Notify and VK
// @ts-ignore
*/
// @ts-ignore
public get messageTag(): IMessageContextPayload['message']['message_tag'] | undefined {
// @ts-ignore
return this.message.message_tag;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Checks whether the message is expired
// @ts-ignore
*/
// @ts-ignore
public get isExpired(): IMessageContextPayload['message']['is_expired'] | undefined {
// @ts-ignore
return this.message.is_expired;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the event name
// @ts-ignore
*/
// @ts-ignore
public get eventType(): MessageContextPayloadEventType | undefined {
// @ts-ignore
return this.message.action?.type;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the event member id
// @ts-ignore
*/
// @ts-ignore
public get eventMemberId(): number | undefined {
// @ts-ignore
return this.message.action?.member_id;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the event name
// @ts-ignore
*/
// @ts-ignore
public get eventText(): string | undefined {
// @ts-ignore
return this.message.action?.text;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the event email
// @ts-ignore
*/
// @ts-ignore
public get eventEmail(): string | undefined {
// @ts-ignore
return this.message.action?.email;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the message payload
// @ts-ignore
*/
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// @ts-ignore
public get messagePayload(): any | undefined {
// @ts-ignore
return this[kMessagePayload];
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the forwards
// @ts-ignore
*/
// @ts-ignore
public get forwards(): MessageForwardsCollection {
// @ts-ignore
return this[kForwards];
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the reply message
// @ts-ignore
*/
// @ts-ignore
public get replyMessage(): MessageContext | undefined {
// @ts-ignore
return this[kReplyMessage];
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the attachments
// @ts-ignore
*/
// @ts-ignore
public get attachments(): (Attachment | ExternalAttachment)[] {
// @ts-ignore
return this[kAttachments];
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Returns the capabilities of the client the user is using.
// @ts-ignore
*/
// @ts-ignore
public get clientInfo(): IMessageContextPayload['client_info'] {
// @ts-ignore
return this.payload.client_info;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Edits a message
// @ts-ignore
*/
// @ts-ignore
editMessage(params: IMessageContextSendOptions): Promise<number> {
// @ts-ignore
const target = this.id !== 0
// @ts-ignore
? { message_id: this.id }
// @ts-ignore
: { conversation_message_id: this.conversationMessageId };
// @ts-ignore
// @ts-ignore
return this.api.messages.edit({
// @ts-ignore
attachment: String(
// @ts-ignore
this.attachments.filter(attachment => (
// @ts-ignore
attachment.canBeAttached
// @ts-ignore
))
// @ts-ignore
),
// @ts-ignore
message: this.text!,
// @ts-ignore
keep_forward_messages: 1,
// @ts-ignore
keep_snippets: 1,
// @ts-ignore
// @ts-ignore
...params,
// @ts-ignore
// @ts-ignore
...target,
// @ts-ignore
// @ts-ignore
peer_id: this.peerId
// @ts-ignore
} as Params.MessagesEditParams);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Sends a message to the current dialog
// @ts-ignore
*/
// @ts-ignore
async send(
// @ts-ignore
text: string | IMessageContextSendOptions,
// @ts-ignore
params?: IMessageContextSendOptions
// @ts-ignore
): Promise<MessageContext> {
// @ts-ignore
const randomId = getRandomId();
// @ts-ignore
// @ts-ignore
const options = {
// @ts-ignore
random_id: randomId,
// @ts-ignore
// @ts-ignore
...(
// @ts-ignore
typeof text !== 'object'
// @ts-ignore
? {
// @ts-ignore
message: text,
// @ts-ignore
// @ts-ignore
...params
// @ts-ignore
}
// @ts-ignore
: text
// @ts-ignore
)
// @ts-ignore
} as IMessageContextSendOptions;
// @ts-ignore
// @ts-ignore
if (this.$groupId !== undefined) {
// @ts-ignore
options.peer_ids = this.peerId;
// @ts-ignore
} else {
// @ts-ignore
options.peer_id = this.peerId;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
const rawDestination = await this.api.messages.send(options);
// @ts-ignore
// @ts-ignore
const { message } = this;
// @ts-ignore
// @ts-ignore
const destination = typeof rawDestination !== 'number'
// @ts-ignore
? rawDestination[0] as {
// @ts-ignore
peer_id : number;
// @ts-ignore
message_id: number;
// @ts-ignore
conversation_message_id: number;
// @ts-ignore
error: number;
// @ts-ignore
}
// @ts-ignore
: {
// @ts-ignore
peer_id: message.peer_id,
// @ts-ignore
message_id: rawDestination,
// @ts-ignore
conversation_message_id: 0
// @ts-ignore
};
// @ts-ignore
// @ts-ignore
const messageContext = new MessageContext({
// @ts-ignore
api: this.api,
// @ts-ignore
upload: this.upload,
// @ts-ignore
source: UpdateSource.WEBHOOK,
// @ts-ignore
groupId: this.$groupId,
// @ts-ignore
updateType: 'message_new',
// @ts-ignore
state: this.state,
// @ts-ignore
payload: {
// @ts-ignore
client_info: this.clientInfo,
// @ts-ignore
message: {
// @ts-ignore
id: destination.message_id,
// @ts-ignore
conversation_message_id: destination.conversation_message_id,
// @ts-ignore
// @ts-ignore
// TODO: This must be the bot identifier
// @ts-ignore
from_id: message.from_id,
// @ts-ignore
peer_id: destination.peer_id,
// @ts-ignore
// @ts-ignore
out: 1,
// @ts-ignore
important: false,
// @ts-ignore
random_id: randomId,
// @ts-ignore
// @ts-ignore
text: options.text,
// @ts-ignore
// @ts-ignore
date: Math.floor(Date.now() / 1000),
// @ts-ignore
// @ts-ignore
attachments: []
// @ts-ignore
}
// @ts-ignore
}
// @ts-ignore
});
// @ts-ignore
// @ts-ignore
messageContext.$filled = false;
// @ts-ignore
// @ts-ignore
return messageContext;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Responds to the current message
// @ts-ignore
*/
// @ts-ignore
reply(
// @ts-ignore
text: string | IMessageContextSendOptions,
// @ts-ignore
params?: IMessageContextSendOptions
// @ts-ignore
): Promise<MessageContext> {
// @ts-ignore
const forwardOptions = this.conversationMessageId
// @ts-ignore
? { conversation_message_ids: this.conversationMessageId }
// @ts-ignore
: { message_ids: this.id };
// @ts-ignore
// @ts-ignore
return this.send({
// @ts-ignore
forward: JSON.stringify({
// @ts-ignore
...forwardOptions,
// @ts-ignore
// @ts-ignore
peer_id: this.peerId,
// @ts-ignore
is_reply: true
// @ts-ignore
}),
// @ts-ignore
// @ts-ignore
...(
// @ts-ignore
typeof text !== 'object'
// @ts-ignore
? {
// @ts-ignore
message: text,
// @ts-ignore
// @ts-ignore
...params
// @ts-ignore
}
// @ts-ignore
: text
// @ts-ignore
)
// @ts-ignore
});
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Sends a photos to the current dialog
// @ts-ignore
*/
// @ts-ignore
async sendPhotos(
// @ts-ignore
rawSources: AllowArray<IUploadSourceMedia>,
// @ts-ignore
params: IMessageContextSendOptions = {}
// @ts-ignore
): Promise<MessageContext> {
// @ts-ignore
const sources = !Array.isArray(rawSources)
// @ts-ignore
? [rawSources]
// @ts-ignore
: rawSources;
// @ts-ignore
// @ts-ignore
const attachment = await Promise.all(sources.map(source => (
// @ts-ignore
this.upload.messagePhoto({
// @ts-ignore
source,
// @ts-ignore
// @ts-ignore
peer_id: this.peerId
// @ts-ignore
})
// @ts-ignore
)));
// @ts-ignore
// @ts-ignore
return this.send({
// @ts-ignore
...params,
// @ts-ignore
// @ts-ignore
attachment
// @ts-ignore
});
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Sends a documents to the current dialog
// @ts-ignore
*/
// @ts-ignore
async sendDocuments(
// @ts-ignore
rawSources: AllowArray<IUploadSourceMedia>,
// @ts-ignore
params: IMessageContextSendOptions = {}
// @ts-ignore
): Promise<MessageContext> {
// @ts-ignore
const sources = !Array.isArray(rawSources)
// @ts-ignore
? [rawSources]
// @ts-ignore
: rawSources;
// @ts-ignore
// @ts-ignore
const attachment = await Promise.all(sources.map(source => (
// @ts-ignore
this.upload.messageDocument({
// @ts-ignore
source,
// @ts-ignore
// @ts-ignore
peer_id: this.peerId
// @ts-ignore
})
// @ts-ignore
)));
// @ts-ignore
// @ts-ignore
return this.send({
// @ts-ignore
...params,
// @ts-ignore
// @ts-ignore
attachment
// @ts-ignore
});
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Sends a audio message to the current dialog
// @ts-ignore
*/
// @ts-ignore
async sendAudioMessage(
// @ts-ignore
source: IUploadSourceMedia,
// @ts-ignore
params: IMessageContextSendOptions = {}
// @ts-ignore
): Promise<MessageContext> {
// @ts-ignore
const attachment = await this.upload.audioMessage({
// @ts-ignore
source,
// @ts-ignore
// @ts-ignore
peer_id: this.peerId
// @ts-ignore
});
// @ts-ignore
// @ts-ignore
return this.send({
// @ts-ignore
...params,
// @ts-ignore
// @ts-ignore
attachment
// @ts-ignore
});
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Changes the status of typing in the dialog
// @ts-ignore
*/
// @ts-ignore
async setActivity(): Promise<boolean> {
// @ts-ignore
const isActivited = await this.api.messages.setActivity({
// @ts-ignore
peer_id: this.peerId,
// @ts-ignore
type: 'typing'
// @ts-ignore
});
// @ts-ignore
// @ts-ignore
return Boolean(isActivited);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Deletes the message
// @ts-ignore
*/
// @ts-ignore
async deleteMessage(options: Params.MessagesDeleteParams = {}): Promise<boolean> {
// @ts-ignore
const messageIds = await this.api.messages.delete({
// @ts-ignore
...options,
// @ts-ignore
// @ts-ignore
message_ids: this.id
// @ts-ignore
});
// @ts-ignore
// @ts-ignore
return Boolean(messageIds[this.id]);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Restores the message
// @ts-ignore
*/
// @ts-ignore
async restoreMessage(): Promise<boolean> {
// @ts-ignore
const isRestored = await this.api.messages.restore({
// @ts-ignore
message_id: this.id
// @ts-ignore
});
// @ts-ignore
// @ts-ignore
return Boolean(isRestored);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Return alias of payload.message
// @ts-ignore
*/
// @ts-ignore
protected get message(): IMessageContextPayload['message'] {
// @ts-ignore
return this.payload.message;
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/**
// @ts-ignore
* Applies the payload
// @ts-ignore
*/
// @ts-ignore
private applyPayload(
// @ts-ignore
payload: IMessageContextPayload
// @ts-ignore
| IMessageContextPayload['message']
// @ts-ignore
): void {
// @ts-ignore
// Polyfill for all events except new_message
// @ts-ignore
this.payload = !('client_info' in payload)
// @ts-ignore
? {
// @ts-ignore
message: payload as IMessageContextPayload['message'],
// @ts-ignore
client_info: {
// @ts-ignore
button_actions: [
// @ts-ignore
'text'
// @ts-ignore
],
// @ts-ignore
inline_keyboard: false,
// @ts-ignore
keyboard: true,
// @ts-ignore
carousel: false,
// @ts-ignore
lang_id: 0
// @ts-ignore
}
// @ts-ignore
}
// @ts-ignore
: payload;
// @ts-ignore
// @ts-ignore
const { message } = this;
// @ts-ignore
// @ts-ignore
this.text = message.text
// @ts-ignore
? unescapeHTML(message.text)
// @ts-ignore
: undefined;
// @ts-ignore
// @ts-ignore
this[kAttachments] = transformAttachments(message.attachments || [], this.api);
// @ts-ignore
// @ts-ignore
if (message.reply_message) {
// @ts-ignore
this[kReplyMessage] = new MessageContext({
// @ts-ignore
api: this.api,
// @ts-ignore
upload: this.upload,
// @ts-ignore
source: UpdateSource.WEBHOOK,
// @ts-ignore
groupId: this.$groupId,
// @ts-ignore
updateType: 'message_new',
// @ts-ignore
state: this.state,
// @ts-ignore
payload: {
// @ts-ignore
client_info: this.clientInfo,
// @ts-ignore
message: message.reply_message
// @ts-ignore
}
// @ts-ignore
});
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
this[kForwards] = new MessageForwardsCollection(...(message.fwd_messages || []).map(forward => (
// @ts-ignore
new MessageContext({
// @ts-ignore
api: this.api,
// @ts-ignore
upload: this.upload,
// @ts-ignore
source: UpdateSource.WEBHOOK,
// @ts-ignore
groupId: this.$groupId,
// @ts-ignore
updateType: 'message_new',
// @ts-ignore
state: this.state,
// @ts-ignore
payload: {
// @ts-ignore
client_info: this.clientInfo,
// @ts-ignore
message: forward
// @ts-ignore
}
// @ts-ignore
})
// @ts-ignore
)));
// @ts-ignore
// @ts-ignore
if (message.payload) {
// @ts-ignore
this[kMessagePayload] = JSON.parse(message.payload);
// @ts-ignore
}
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
/** | */
// @ts-ignore
public [kSerializeData](): object {
// @ts-ignore
const beforeAttachments: string[] = [];
// @ts-ignore
// @ts-ignore
if (this.isEvent) {
// @ts-ignore
beforeAttachments.push(
// @ts-ignore
'eventType',
// @ts-ignore
'eventMemberId',
// @ts-ignore
'eventText',
// @ts-ignore
'eventEmail'
// @ts-ignore
);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
if (this.hasReplyMessage) {
// @ts-ignore
beforeAttachments.push('replyMessage');
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
const afterAttachments: string[] = [];
// @ts-ignore
// @ts-ignore
if (this.hasMessagePayload) {
// @ts-ignore
afterAttachments.push('messagePayload');
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
if (this.hasGeo) {
// @ts-ignore
afterAttachments.push('geo');
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
afterAttachments.push('isOutbox');
// @ts-ignore
// @ts-ignore
if (this.referralSource || this.referralValue) {
// @ts-ignore
afterAttachments.push('referralValue', 'referralSource');
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
if (this.$match) {
// @ts-ignore
afterAttachments.push('$match');
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
return pickProperties(this, [
// @ts-ignore
'id',
// @ts-ignore
'conversationMessageId',
// @ts-ignore
'peerId',
// @ts-ignore
'peerType',
// @ts-ignore
'senderId',
// @ts-ignore
'senderType',
// @ts-ignore
'createdAt',
// @ts-ignore
'updatedAt',
// @ts-ignore
'pinnedAt',
// @ts-ignore
'text',
// @ts-ignore
...beforeAttachments,
// @ts-ignore
'forwards',
// @ts-ignore
'attachments',
// @ts-ignore
...afterAttachments
// @ts-ignore
]);
// @ts-ignore
}
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
// eslint-disable-next-line
// @ts-ignore
interface MessageContext extends Attachmentable, IAllAttachmentable {}
// @ts-ignore
applyMixins(MessageContext, [
// @ts-ignore
Attachmentable,
// @ts-ignore
class AllAttachmentable extends Attachmentable {
// @ts-ignore
public replyMessage?: MessageContext;
// @ts-ignore
// @ts-ignore
public forwards!: MessageForwardsCollection;
// @ts-ignore
// @ts-ignore
public hasAllAttachments(type: AttachmentType | AttachmentTypeString | undefined): boolean {
// @ts-ignore
return (
// @ts-ignore
this.hasAttachments(type)
// @ts-ignore
|| (this.replyMessage?.hasAttachments(type))
// @ts-ignore
|| this.forwards.hasAttachments(type)
// @ts-ignore
);
// @ts-ignore
}
// @ts-ignore
// @ts-ignore
public getAllAttachments(
// @ts-ignore
type: AttachmentType | AttachmentTypeString
// @ts-ignore
): (Attachment | ExternalAttachment)[] {
// @ts-ignore
return [
// @ts-ignore
// @ts-expect-error
// @ts-ignore
...this.getAttachments(type),
// @ts-ignore
// @ts-expect-error
// @ts-ignore
...((this.replyMessage?.getAttachments(type)) ?? []),
// @ts-ignore
// @ts-expect-error
// @ts-ignore
...this.forwards.getAttachments(type)
// @ts-ignore
];
// @ts-ignore
}
// @ts-ignore
}
// @ts-ignore
]);
// @ts-ignore
// @ts-ignore
export { MessageContext }; | // @ts-ignore
* Returns the custom data
// @ts-ignore |
AmazonESConnection.js | "use strict";
/**
* A connection handler for Amazon ES.
*
* Uses the aws-sdk to make signed requests to an Amazon ES endpoint.
*
* @param client {Client} - The Client that this class belongs to
* @param config {Object} - Configuration options
* @param [config.protocol=http:] {String} - The HTTP protocol that this connection will use, can be set to https:
* @class HttpConnector
*/
Object.defineProperty(exports, "__esModule", { value: true });
const AWS = require("aws-sdk");
const aws4 = require("aws4");
const elasticsearch_1 = require("@elastic/elasticsearch");
class AmazonESConnection extends elasticsearch_1.Connection {
constructor(options) {
super(options);
this.awsConfig = AWS.config;
}
request(params, cb) { | const options = {
host: this.url.href,
region: this.awsConfig.region,
};
aws4.sign(options, this.awsConfig.credentials);
Object.assign(reqParams, options);
return originalMakeRequest(reqParams);
};
return super.request(params, cb);
}
}
exports.AmazonESConnection = AmazonESConnection; | const originalMakeRequest = this.makeRequest;
this.makeRequest = (reqParams) => { |
fold.rs | //! Traits for transforming bits of IR.
use cast::Cast;
use chalk_engine::context::Context;
use chalk_engine::{DelayedLiteral, ExClause, Literal};
use std::fmt::Debug;
use std::sync::Arc;
use *;
pub mod shift;
mod subst;
pub use self::subst::Subst;
/// A "folder" is a transformer that can be used to make a copy of
/// some term -- that is, some bit of IR, such as a `Goal` -- with
/// certain changes applied. The idea is that it contains methods that
/// let you swap types/lifetimes for new types/lifetimes; meanwhile,
/// each bit of IR implements the `Fold` trait which, given a
/// `Folder`, will reconstruct itself, invoking the folder's methods
/// to transform each of the types/lifetimes embedded within.
///
/// # Usage patterns
///
/// ## Substituting for free variables
///
/// Most of the time, though, we are not interested in adjust
/// arbitrary types/lifetimes, but rather just free variables (even
/// more often, just free existential variables) that appear within
/// the term.
///
/// For this reason, the `Folder` trait extends two other traits that
/// contain methods that are invoked when just those particular
///
/// In particular, folders can intercept references to free variables
/// (either existentially or universally quantified) and replace them
/// with other types/lifetimes as appropriate.
///
/// To create a folder type F, one typically does one of two things:
///
/// - Implement `ExistentialFolder` and `IdentityUniversalFolder`:
/// - This ignores universally quantified variables but allows you to
/// replace existential variables with new values.
/// - Implement `ExistentialFolder` and `UniversalFolder`:
/// - This allows you to replace either existential or universal
/// variables with new types/lifetimes.
///
/// There is no reason to implement the `Folder` trait directly.
///
/// To **apply** a folder, use the `Fold::fold_with` method, like so
///
/// ```rust,ignore
/// let x = x.fold_with(&mut folder, 0);
/// ```
pub trait Folder: ExistentialFolder + UniversalFolder + TypeFolder {
/// Returns a "dynamic" version of this trait. There is no
/// **particular** reason to require this, except that I didn't
/// feel like making `super_fold_ty` generic for no reason.
fn to_dyn(&mut self) -> &mut dyn Folder;
}
pub trait TypeFolder {
fn fold_ty(&mut self, ty: &Ty, binders: usize) -> Fallible<Ty>;
fn fold_lifetime(&mut self, lifetime: &Lifetime, binders: usize) -> Fallible<Lifetime>;
}
impl<T: ExistentialFolder + UniversalFolder + TypeFolder> Folder for T {
fn to_dyn(&mut self) -> &mut dyn Folder {
self
}
}
/// A convenience trait that indicates that this folder doesn't take
/// any action on types in particular, but just recursively folds
/// their contents (note that free variables that are encountered in
/// that process may still be substituted). The vast majority of
/// folders implement this trait.
pub trait DefaultTypeFolder {}
impl<T: ExistentialFolder + UniversalFolder + DefaultTypeFolder> TypeFolder for T {
fn fold_ty(&mut self, ty: &Ty, binders: usize) -> Fallible<Ty> {
super_fold_ty(self.to_dyn(), ty, binders)
}
fn fold_lifetime(&mut self, lifetime: &Lifetime, binders: usize) -> Fallible<Lifetime> {
super_fold_lifetime(self.to_dyn(), lifetime, binders)
}
}
/// The methods for folding free **existentially quantified
/// variables**; for example, if you folded over `Foo<?T> }`, where `?T`
/// is an inference variable, then this would let you replace `?T` with
/// some other type.
pub trait ExistentialFolder {
/// Invoked for `Ty::Var` instances that are not bound within the type being folded
/// over:
///
/// - `depth` is the depth of the `Ty::Var`; this has been adjusted to account for binders
/// in scope.
/// - `binders` is the number of binders in scope.
///
/// This should return a type suitable for a context with `binders` in scope.
fn fold_free_existential_ty(&mut self, depth: usize, binders: usize) -> Fallible<Ty>;
/// As `fold_free_existential_ty`, but for lifetimes.
fn fold_free_existential_lifetime(
&mut self,
depth: usize,
binders: usize,
) -> Fallible<Lifetime>;
}
/// A convenience trait. If you implement this, you get an
/// implementation of `UniversalFolder` for free that simply ignores
/// universal values (that is, it replaces them with themselves).
pub trait IdentityExistentialFolder {}
impl<T: IdentityExistentialFolder> ExistentialFolder for T {
fn fold_free_existential_ty(&mut self, depth: usize, binders: usize) -> Fallible<Ty> {
Ok(Ty::Var(depth + binders))
}
fn fold_free_existential_lifetime(
&mut self,
depth: usize,
binders: usize,
) -> Fallible<Lifetime> {
Ok(Lifetime::Var(depth + binders))
}
}
pub trait UniversalFolder {
/// Invoked for `Ty::Apply` instances where the type name is a `TypeName::ForAll`.
/// Returns a type to use instead, which should be suitably shifted to account for `binders`.
///
/// - `universe` is the universe of the `TypeName::ForAll` that was found
/// - `binders` is the number of binders in scope
fn fold_free_universal_ty(&mut self, universe: UniversalIndex, binders: usize) -> Fallible<Ty>;
/// As with `fold_free_universal_ty`, but for lifetimes.
fn fold_free_universal_lifetime(
&mut self,
universe: UniversalIndex,
binders: usize,
) -> Fallible<Lifetime>;
}
/// A convenience trait. If you implement this, you get an
/// implementation of `UniversalFolder` for free that simply ignores
/// universal values (that is, it replaces them with themselves).
pub trait IdentityUniversalFolder {}
impl<T: IdentityUniversalFolder> UniversalFolder for T {
fn fold_free_universal_ty(&mut self, universe: UniversalIndex, _binders: usize) -> Fallible<Ty> {
Ok(universe.to_ty())
}
fn fold_free_universal_lifetime(
&mut self,
universe: UniversalIndex,
_binders: usize,
) -> Fallible<Lifetime> {
Ok(universe.to_lifetime())
}
}
/// Applies the given folder to a value.
pub trait Fold: Debug {
/// The type of value that will be produced once folding is done.
/// Typically this is `Self`, unless `Self` contains borrowed
/// values, in which case owned values are produced (for example,
/// one can fold over a `&T` value where `T: Fold`, in which case
/// you get back a `T`, not a `&T`).
type Result: Fold;
/// Apply the given folder `folder` to `self`; `binders` is the
/// number of binders that are in scope when beginning the
/// folder. Typically `binders` starts as 0, but is adjusted when
/// we encounter `Binders<T>` in the IR or other similar
/// constructs.
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result>;
}
impl<'a, T: Fold> Fold for &'a T {
type Result = T::Result;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
(**self).fold_with(folder, binders)
}
}
impl<T: Fold> Fold for Vec<T> {
type Result = Vec<T::Result>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
self.iter().map(|e| e.fold_with(folder, binders)).collect()
}
}
impl<T: Fold> Fold for Box<T> {
type Result = Box<T::Result>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
Ok(Box::new((**self).fold_with(folder, binders)?))
}
}
impl<T: Fold> Fold for Arc<T> {
type Result = Arc<T::Result>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
Ok(Arc::new((**self).fold_with(folder, binders)?))
}
}
macro_rules! tuple_fold {
($($n:ident),*) => {
impl<$($n: Fold,)*> Fold for ($($n,)*) {
type Result = ($($n::Result,)*);
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
#[allow(non_snake_case)]
let &($(ref $n),*) = self;
Ok(($($n.fold_with(folder, binders)?,)*))
}
}
}
}
tuple_fold!(A, B);
tuple_fold!(A, B, C);
tuple_fold!(A, B, C, D);
tuple_fold!(A, B, C, D, E);
impl<T: Fold> Fold for Option<T> {
type Result = Option<T::Result>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
match self {
None => Ok(None),
Some(e) => Ok(Some(e.fold_with(folder, binders)?)),
}
}
}
impl Fold for Ty {
type Result = Self;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
folder.fold_ty(self, binders)
}
}
pub fn super_fold_ty(folder: &mut dyn Folder, ty: &Ty, binders: usize) -> Fallible<Ty> {
match *ty {
Ty::Var(depth) => if depth >= binders {
folder.fold_free_existential_ty(depth - binders, binders)
} else {
Ok(Ty::Var(depth))
},
Ty::Apply(ref apply) => {
let ApplicationTy {
name,
ref parameters,
} = *apply;
match name {
TypeName::ForAll(ui) => {
assert!(
parameters.is_empty(),
"type {:?} with parameters {:?}",
ty,
parameters
);
folder.fold_free_universal_ty(ui, binders)
}
TypeName::ItemId(_) | TypeName::AssociatedType(_) => {
let parameters = parameters.fold_with(folder, binders)?;
Ok(ApplicationTy { name, parameters }.cast())
}
}
}
Ty::Projection(ref proj) => Ok(Ty::Projection(proj.fold_with(folder, binders)?)),
Ty::UnselectedProjection(ref proj) => {
Ok(Ty::UnselectedProjection(proj.fold_with(folder, binders)?))
}
Ty::ForAll(ref quantified_ty) => Ok(Ty::ForAll(quantified_ty.fold_with(folder, binders)?)),
}
}
impl Fold for QuantifiedTy {
type Result = Self;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
let QuantifiedTy {
num_binders,
ref ty,
} = *self;
Ok(QuantifiedTy {
num_binders,
ty: ty.fold_with(folder, binders + num_binders)?,
})
}
}
impl<T> Fold for Binders<T>
where
T: Fold,
{
type Result = Binders<T::Result>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
let Binders {
binders: ref self_binders,
value: ref self_value,
} = *self;
let value = self_value.fold_with(folder, binders + self_binders.len())?;
Ok(Binders {
binders: self_binders.clone(),
value: value,
})
}
}
impl<T> Fold for Canonical<T>
where
T: Fold,
{
type Result = Canonical<T::Result>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
let Canonical {
binders: ref self_binders,
value: ref self_value,
} = *self;
let value = self_value.fold_with(folder, binders + self_binders.len())?;
Ok(Canonical {
binders: self_binders.clone(),
value: value,
})
}
}
impl Fold for Lifetime {
type Result = Self;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
folder.fold_lifetime(self, binders)
}
}
pub fn super_fold_lifetime(
folder: &mut dyn Folder,
lifetime: &Lifetime,
binders: usize,
) -> Fallible<Lifetime> |
impl Fold for Substitution {
type Result = Substitution;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
let parameters = self.parameters.fold_with(folder, binders)?;
Ok(Substitution { parameters })
}
}
#[macro_export]
macro_rules! copy_fold {
($t:ty) => {
impl $crate::fold::Fold for $t {
type Result = Self;
fn fold_with(
&self,
_folder: &mut dyn ($crate::fold::Folder),
_binders: usize,
) -> ::chalk_engine::fallible::Fallible<Self::Result> {
Ok(*self)
}
}
};
}
copy_fold!(Identifier);
copy_fold!(UniverseIndex);
copy_fold!(ItemId);
copy_fold!(usize);
copy_fold!(QuantifierKind);
copy_fold!(chalk_engine::TableIndex);
// copy_fold!(TypeName); -- intentionally omitted! This is folded via `fold_ap`
copy_fold!(());
#[macro_export]
macro_rules! enum_fold {
($s:ident [$($n:ident),*] { $($variant:ident($($name:ident),*)),* } $($w:tt)*) => {
impl<$($n),*> $crate::fold::Fold for $s<$($n),*> $($w)* {
type Result = $s<$($n :: Result),*>;
fn fold_with(&self,
folder: &mut dyn ($crate::fold::Folder),
binders: usize)
-> ::chalk_engine::fallible::Fallible<Self::Result> {
match self {
$(
$s::$variant( $($name),* ) => {
Ok($s::$variant( $($name.fold_with(folder, binders)?),* ))
}
)*
}
}
}
};
// Hacky variant for use in slg::context::implementation
($s:ty { $p:ident :: { $($variant:ident($($name:ident),*)),* } }) => {
impl $crate::fold::Fold for $s {
type Result = $s;
fn fold_with(&self,
folder: &mut dyn ($crate::fold::Folder),
binders: usize)
-> ::chalk_engine::fallible::Fallible<Self::Result> {
match self {
$(
$p::$variant( $($name),* ) => {
Ok($p::$variant( $($name.fold_with(folder, binders)?),* ))
}
)*
}
}
}
}
}
enum_fold!(ParameterKind[T,L] { Ty(a), Lifetime(a) } where T: Fold, L: Fold);
enum_fold!(WhereClause[] { Implemented(a), ProjectionEq(a) });
enum_fold!(WellFormed[] { Trait(a), Ty(a) });
enum_fold!(FromEnv[] { Trait(a), Ty(a) });
enum_fold!(DomainGoal[] { Holds(a), WellFormed(a), FromEnv(a), Normalize(a), UnselectedNormalize(a),
InScope(a), Derefs(a), IsLocal(a), IsUpstream(a), IsFullyVisible(a),
LocalImplAllowed(a), Compatible(a), DownstreamType(a) });
enum_fold!(LeafGoal[] { EqGoal(a), DomainGoal(a) });
enum_fold!(Constraint[] { LifetimeEq(a, b) });
enum_fold!(Goal[] { Quantified(qkind, subgoal), Implies(wc, subgoal), And(g1, g2), Not(g),
Leaf(wc), CannotProve(a) });
enum_fold!(ProgramClause[] { Implies(a), ForAll(a) });
#[macro_export]
macro_rules! struct_fold {
($s:ident $([$($tt_args:tt)*])* { $($name:ident),* $(,)* } $($w:tt)*) => {
struct_fold! {
@parse_tt_args($($($tt_args)*)*)
struct_name($s)
parameters()
self_args()
result_args()
field_names($($name),*)
where_clauses($($w)*)
}
};
(
@parse_tt_args()
struct_name($s:ident)
parameters($($parameters:tt)*)
self_args($($self_args:tt)*)
result_args($($result_args:tt)*)
field_names($($field_names:tt)*)
where_clauses($($where_clauses:tt)*)
) => {
struct_fold! {
@parsed_tt_args
struct_name($s)
parameters($($parameters)*)
self_ty($s < $($self_args)* >)
result_ty($s < $($result_args)* >)
field_names($($field_names)*)
where_clauses($($where_clauses)*)
}
};
(
@parse_tt_args(, $($input:tt)*)
struct_name($s:ident)
parameters($($parameters:tt)*)
self_args($($self_args:tt)*)
result_args($($result_args:tt)*)
field_names($($field_names:tt)*)
where_clauses($($where_clauses:tt)*)
) => {
struct_fold! {
@parse_tt_args($($input)*)
struct_name($s)
parameters($($parameters)*,)
self_args($($self_args)*,)
result_args($($result_args)*,)
field_names($($field_names)*)
where_clauses($($where_clauses)*)
}
};
(
@parse_tt_args(- $n:ident $($input:tt)*)
struct_name($s:ident)
parameters($($parameters:tt)*)
self_args($($self_args:tt)*)
result_args($($result_args:tt)*)
field_names($($field_names:tt)*)
where_clauses($($where_clauses:tt)*)
) => {
struct_fold! {
@parse_tt_args($($input)*)
struct_name($s)
parameters($($parameters)* $n)
self_args($($self_args)* $n)
result_args($($result_args)* $n)
field_names($($field_names)*)
where_clauses($($where_clauses)*)
}
};
(
@parse_tt_args($n:ident $($input:tt)*)
struct_name($s:ident)
parameters($($parameters:tt)*)
self_args($($self_args:tt)*)
result_args($($result_args:tt)*)
field_names($($field_names:tt)*)
where_clauses($($where_clauses:tt)*)
) => {
struct_fold! {
@parse_tt_args($($input)*)
struct_name($s)
parameters($($parameters)* $n)
self_args($($self_args)* $n)
result_args($($result_args)* $n :: Result)
field_names($($field_names)*)
where_clauses($($where_clauses)*)
}
};
(
@parsed_tt_args
struct_name($s:ident)
parameters($($parameters:tt)*)
self_ty($self_ty:ty)
result_ty($result_ty:ty)
field_names($($field_name:ident),*)
where_clauses($($where_clauses:tt)*)
) => {
impl<$($parameters)*> $crate::fold::Fold for $self_ty $($where_clauses)* {
type Result = $result_ty;
fn fold_with(&self,
folder: &mut dyn ($crate::fold::Folder),
binders: usize)
-> ::chalk_engine::fallible::Fallible<Self::Result> {
Ok($s {
$($field_name: self.$field_name.fold_with(folder, binders)?),*
})
}
}
};
}
struct_fold!(ProjectionTy {
associated_ty_id,
parameters,
});
struct_fold!(UnselectedProjectionTy {
type_name,
parameters,
});
struct_fold!(TraitRef {
trait_id,
parameters,
});
struct_fold!(Normalize { projection, ty });
struct_fold!(ProjectionEq { projection, ty });
struct_fold!(UnselectedNormalize { projection, ty });
struct_fold!(Environment { clauses });
struct_fold!(InEnvironment[F] { environment, goal } where F: Fold<Result = F>);
struct_fold!(EqGoal { a, b });
struct_fold!(Derefs { source, target });
struct_fold!(ProgramClauseImplication {
consequence,
conditions,
});
struct_fold!(ConstrainedSubst {
subst, /* NB: The `is_trivial` routine relies on the fact that `subst` is folded first. */
constraints,
});
// struct_fold!(ApplicationTy { name, parameters }); -- intentionally omitted, folded through Ty
impl<C: Context> Fold for ExClause<C>
where
C: Context,
C::Substitution: Fold<Result = C::Substitution>,
C::RegionConstraint: Fold<Result = C::RegionConstraint>,
C::CanonicalConstrainedSubst: Fold<Result = C::CanonicalConstrainedSubst>,
C::GoalInEnvironment: Fold<Result = C::GoalInEnvironment>,
{
type Result = ExClause<C>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
let ExClause {
subst,
delayed_literals,
constraints,
subgoals,
} = self;
Ok(ExClause {
subst: subst.fold_with(folder, binders)?,
delayed_literals: delayed_literals.fold_with(folder, binders)?,
constraints: constraints.fold_with(folder, binders)?,
subgoals: subgoals.fold_with(folder, binders)?,
})
}
}
impl<C: Context> Fold for DelayedLiteral<C>
where
C: Context,
C::CanonicalConstrainedSubst: Fold<Result = C::CanonicalConstrainedSubst>,
{
type Result = DelayedLiteral<C>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
match self {
DelayedLiteral::CannotProve(()) => Ok(DelayedLiteral::CannotProve(())),
DelayedLiteral::Negative(table_index) => Ok(DelayedLiteral::Negative(
table_index.fold_with(folder, binders)?,
)),
DelayedLiteral::Positive(table_index, subst) => Ok(DelayedLiteral::Positive(
table_index.fold_with(folder, binders)?,
subst.fold_with(folder, binders)?,
)),
}
}
}
impl<C: Context> Fold for Literal<C>
where
C: Context,
C::GoalInEnvironment: Fold<Result = C::GoalInEnvironment>,
{
type Result = Literal<C>;
fn fold_with(&self, folder: &mut dyn Folder, binders: usize) -> Fallible<Self::Result> {
match self {
Literal::Positive(goal) => Ok(Literal::Positive(goal.fold_with(folder, binders)?)),
Literal::Negative(goal) => Ok(Literal::Negative(goal.fold_with(folder, binders)?)),
}
}
}
| {
match *lifetime {
Lifetime::Var(depth) => if depth >= binders {
folder.fold_free_existential_lifetime(depth - binders, binders)
} else {
Ok(Lifetime::Var(depth))
},
Lifetime::ForAll(universe) => folder.fold_free_universal_lifetime(universe, binders),
}
} |
upload_task_file_responses.go | // Code generated by go-swagger; DO NOT EDIT.
package tasks
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
models "github.com/rws-github/go-swagger/examples/task-tracker/models"
)
// UploadTaskFileReader is a Reader for the UploadTaskFile structure.
type UploadTaskFileReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *UploadTaskFileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewUploadTaskFileCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
result := NewUploadTaskFileDefault(response.Code())
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
if response.Code()/100 == 2 |
return nil, result
}
}
// NewUploadTaskFileCreated creates a UploadTaskFileCreated with default headers values
func NewUploadTaskFileCreated() *UploadTaskFileCreated {
return &UploadTaskFileCreated{}
}
/*UploadTaskFileCreated handles this case with default header values.
File added
*/
type UploadTaskFileCreated struct {
}
func (o *UploadTaskFileCreated) Error() string {
return fmt.Sprintf("[POST /tasks/{id}/files][%d] uploadTaskFileCreated ", 201)
}
func (o *UploadTaskFileCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewUploadTaskFileDefault creates a UploadTaskFileDefault with default headers values
func NewUploadTaskFileDefault(code int) *UploadTaskFileDefault {
return &UploadTaskFileDefault{
_statusCode: code,
}
}
/*UploadTaskFileDefault handles this case with default header values.
Error response
*/
type UploadTaskFileDefault struct {
_statusCode int
XErrorCode string
Payload *models.Error
}
// Code gets the status code for the upload task file default response
func (o *UploadTaskFileDefault) Code() int {
return o._statusCode
}
func (o *UploadTaskFileDefault) Error() string {
return fmt.Sprintf("[POST /tasks/{id}/files][%d] uploadTaskFile default %+v", o._statusCode, o.Payload)
}
func (o *UploadTaskFileDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header X-Error-Code
o.XErrorCode = response.GetHeader("X-Error-Code")
o.Payload = new(models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
| {
return result, nil
} |
mod.rs | use std::net::{TcpListener, SocketAddrV4, Ipv4Addr};
use std::io::{Read};
pub fn | () -> Result<(), std::io::Error> {
let loopback = Ipv4Addr::new(127, 0, 0, 1);
let socket = SocketAddrV4::new(loopback, 0);
let listener = TcpListener::bind(socket)?;
let port = listener.local_addr()?;
println!("Listening on {}, access this port to end the program", port);
let (mut tcp_stream, addr) = listener.accept()?;
println!("Connection received: {:?} is sending data.", addr);
let mut input = String::new();
let _ = tcp_stream.read_to_string(&mut input)?;
println!("{:?} says {}", addr, input);
Ok(())
} | assign_unused_port |
profile.rs | use std::rc::Rc;
use dominator::{clone, html, Dom};
use dominator::{routing, with_node};
use futures_signals::signal::Mutable;
use futures_signals::signal::SignalExt;
use web_sys::HtmlInputElement;
use crate::common::{events, snackbar, Route, SettingCategory};
use crate::query;
use crate::utils::AsyncLoader;
pub struct Profile {
old_password: Mutable<String>,
new_password: Mutable<String>,
confirm_password: Mutable<String>,
telegram_chat_id: Mutable<Option<String>>,
pub loader: AsyncLoader,
}
impl Profile {
pub fn new() -> Rc<Self> {
Rc::new(Self {
old_password: Mutable::new("".to_string()),
new_password: Mutable::new("".to_string()),
confirm_password: Mutable::new("".to_string()),
telegram_chat_id: Mutable::new(None),
loader: AsyncLoader::new(),
})
}
fn fetch_me(profile: Rc<Self>) {
profile.loader.load(clone!(profile => async move {
match query::fetch_me().await {
Ok(result) => profile.telegram_chat_id.set(result.settings.telegram_chat_id.map(|id| id.to_string())),
Err(err) => {
snackbar::show(format!("{}", err));
}
}
}));
}
fn test_telegram(profile: Rc<Self>) {
if let Some(chat_id) = profile
.telegram_chat_id
.get_cloned()
.map(|id| id.parse().unwrap_or_default())
{
profile.loader.load(async move {
match query::test_telegram(chat_id).await {
Ok(_) => {}
Err(err) => {
snackbar::show(format!("{}", err));
}
}
});
}
}
fn change_password(profile: Rc<Self>) {
profile.loader.load(clone!(profile => async move {
let old_password = profile.old_password.get_cloned();
let new_password = profile.new_password.get_cloned();
match query::change_password(old_password, new_password).await {
Ok(_) => {
routing::go_to_url(Route::Settings(SettingCategory::None).url().as_str());
},
Err(e) => {
snackbar::show(format!("change password error: {}", e));
}
};
}));
}
fn update_profile(profile: Rc<Self>) {
profile.loader.load(clone!(profile => async move {
let telegram_chat_id = profile.telegram_chat_id.get_cloned().and_then(|telegram_chat_id| telegram_chat_id.parse().ok());
match query::update_profile(telegram_chat_id).await {
Ok(_) => {
routing::go_to_url(Route::Settings(SettingCategory::None).url().as_str());
},
Err(e) => {
snackbar::show(format!("change password error: {}", e));
}
};
}));
}
pub fn | (profile: Rc<Self>) -> Dom {
html!("form", {
.style("display", "flex")
.style("flex-direction", "column")
.style("max-width", "1024px")
.style("margin-left", "auto")
.style("margin-right", "auto")
.style("border-radius", "0.5rem")
.children(&mut [
html!("input" => HtmlInputElement, {
.attribute("type", "password")
.attribute("placeholder", "Current Password")
.property_signal("value", profile.old_password.signal_cloned())
.with_node!(input => {
.event(clone!(profile => move |_: events::Input| {
profile.old_password.set(input.value());
}))
})
}),
html!("span", {
.visible_signal(profile.confirm_password.signal_cloned().map(clone!(profile => move |x| x != profile.new_password.get_cloned())))
.style("margin-left", "0.5rem")
.style("margin-right", "0.5rem")
.style("color", "red")
.text("Password do not match")
}),
html!("span", {
.visible_signal(profile.new_password.signal_cloned().map(|x| x.len() < 8))
.style("margin-left", "0.5rem")
.style("margin-right", "0.5rem")
.style("color", "red")
.text("Minimum password length is 8")
}),
html!("input" => HtmlInputElement, {
.class_signal("error", profile.confirm_password.signal_cloned().map(clone!(profile => move |x| x != profile.new_password.get_cloned())))
.attribute("type", "password")
.attribute("placeholder", "New Password")
.property_signal("value", profile.new_password.signal_cloned())
.with_node!(input => {
.event(clone!(profile => move |_: events::Input| {
profile.new_password.set(input.value());
}))
})
}),
html!("input" => HtmlInputElement, {
.class_signal("error", profile.confirm_password.signal_cloned().map(clone!(profile => move |x| x != profile.new_password.get_cloned())))
.attribute("type", "password")
.attribute("placeholder", "Confirm Password")
.property_signal("value", profile.confirm_password.signal_cloned())
.with_node!(input => {
.event(clone!(profile => move |_: events::Input| {
profile.confirm_password.set(input.value());
}))
})
}),
html!("div", {
.style("display", "flex")
.style("justify-content", "flex-end")
.style("margin", "0.5rem")
.children(&mut [
html!("input", {
.attribute("type", "submit")
.attribute_signal("disabled", profile.confirm_password.signal_cloned().map(clone!(profile => move |x| {
if x != profile.new_password.get_cloned() || x.len() < 8 {
Some("true")
} else {
None
}
})))
.text("Submit")
.event_preventable(clone!(profile => move |e: events::Click| {
e.prevent_default();
Self::change_password(profile.clone());
}))
})
])
})
])
})
}
pub fn render_telegram_setting(profile: Rc<Self>) -> Dom {
Self::fetch_me(profile.clone());
html!("form", {
.style("display", "flex")
.style("flex-direction", "column")
.style("max-width", "1024px")
.style("margin-left", "auto")
.style("margin-right", "auto")
.style("border-radius", "0.5rem")
.children(&mut [
html!("input" => HtmlInputElement, {
.attribute("type", "text")
.attribute("placeholder", "Telegram chat id, get from telegram bot")
.property_signal("value", profile.telegram_chat_id.signal_cloned().map(|id| id.unwrap_or_else(|| "".to_string())))
.with_node!(input => {
.event(clone!(profile => move |_: events::Input| {
profile.telegram_chat_id.set(Some(input.value()));
}))
})
}),
html!("div", {
.style("display", "flex")
.style("justify-content", "flex-end")
.style("margin", "0.5rem")
.children(&mut [
html!("input", {
.attribute("type", "button")
.attribute("value", "Test")
.text("Test")
.event_preventable(clone!(profile => move |e: events::Click| {
e.prevent_default();
Self::test_telegram(profile.clone());
}))
}),
html!("input", {
.attribute("type", "submit")
.text("Submit")
.event_preventable(clone!(profile => move |e: events::Click| {
e.prevent_default();
Self::update_profile(profile.clone());
}))
})
])
})
])
})
}
pub fn render(profile: Rc<Self>) -> Dom {
html!("div", {
.children(&mut [
Self::render_change_password(profile.clone()),
Self::render_telegram_setting(profile)
])
})
}
}
| render_change_password |
test_servicer.py | import grpc
from sea.servicer import ServicerMeta, msg2dict, stream2dict
from sea import exceptions
from sea.pb2 import default_pb2
from tests.wd.protos import helloworld_pb2
def test_meta_servicer(app, logstream):
class HelloContext():
def __init__(self):
self.code = None
self.details = None
def set_code(self, code):
self.code = code
def set_details(self, details):
|
class HelloServicer(metaclass=ServicerMeta):
def return_error(self, request, context):
raise exceptions.BadRequestException('error')
def return_normal(self, request, context):
return 'Got it!'
logstream.truncate(0)
logstream.seek(0)
servicer = HelloServicer()
context = HelloContext()
ret = servicer.return_error(None, context)
assert isinstance(ret, default_pb2.Empty)
assert context.code is grpc.StatusCode.INVALID_ARGUMENT
assert context.details == 'error'
p = logstream.tell()
assert p > 0
content = logstream.getvalue()
assert 'HelloServicer.return_error' in content
ret = servicer.return_normal(None, context)
assert ret == 'Got it!'
assert logstream.tell() > p
def test_msg2dict(app):
app.name = 'v-name'
app.msg = 'v-msg'
ret = msg2dict(app, ['name', 'msg', 'tz'])
assert ret == {'name': 'v-name', 'msg': 'v-msg', 'tz': 'Asia/Shanghai'}
request = helloworld_pb2.HelloRequest(name="value")
ret = msg2dict(request)
assert ret == {"name": "value"}
def test_stream2dict():
def stream_generator():
for i in range(5):
yield helloworld_pb2.HelloRequest(name=str(i))
ret = stream2dict(stream_generator())
for i, part in enumerate(ret):
assert part == {"name": str(i)}
| self.details = details |
1103_calendar.t.js | StartTest(function (t) {
//http://www.sencha.com/forum/showthread.php?268333-4.2.1-IE-quot-Focus-quot-method-can-break-on-destroyed-grid-views&p=982906#post982906
Ext.Component.override({
onDestroy : function () {
if (this.focusTask) this.focusTask.cancel()
this.callParent(arguments)
}
})
var calendarWidget, calendar, dayGrid, weekGrid, dayStore, weekStore
var generateDataSet = function (activeTab, doNotReCreateCalendar) {
var parentCalendar1 = new Gnt.data.Calendar({
name : 'Parent1',
calendarId : 'Parent1'
}),
parentCalendar2 = new Gnt.data.calendar.BusinessTime({
name : 'Parent2',
calendarId : 'Parent2'
});
if (!doNotReCreateCalendar) calendar = new Gnt.data.calendar.BusinessTime({
name : 'Calendar',
parent : parentCalendar1,
data : [
{
Id : 'initial',
Date : new Date(2010, 0, 13),
Name : 'foo',
Cls : 'gnt-national-holiday'
}
]
});
if (calendarWidget) calendarWidget.destroy()
calendarWidget = new Gnt.widget.calendar.Calendar({
calendar : calendar,
height : 550,
width : 600,
renderTo : Ext.getBody()
});
calendar = calendar
dayGrid = calendarWidget.getDayGrid()
weekGrid = calendarWidget.getWeekGrid()
dayStore = dayGrid.getStore()
weekStore = weekGrid.getStore()
if (activeTab != null) dayGrid.ownerCt.getLayout().setActiveItem(activeTab)
}
var today = Ext.Date.clearTime(new Date())
var today1wp = Ext.Date.clearTime(Sch.util.Date.add(new Date(), Sch.util.Date.WEEK, 1))
var today1wm = Ext.Date.clearTime(Sch.util.Date.add(new Date(), Sch.util.Date.WEEK, -1))
t.it('Adding day override should work', function (t) {
generateDataSet()
t.is(dayStore.getCount(), 1, "1 day override should present already");
t.is(calendar.getCount(), 1, "1 day override should present already");
t.chain(
// test adding day override
{
click : function () { return dayGrid.el.down('.gnt-action-add') }
},
function (next) {
t.is(dayStore.getCount(), 2, 'Day override successfully added.');
t.is(dayStore.getAt(0).get('Date'), today, 'and it has current date');
t.firesOk({
observable : calendar,
events : { update : 0, add : 1, remove : 0 },
during : function () {
calendarWidget.applyChanges()
}
})
t.is(calendar.getCount(), 2, 'Day override succcessfully added to the original calendar')
var newOverride = calendar.getAt(1)
t.is(newOverride.get('Date'), today, 'and it has current date');
t.notOk(newOverride.get('Id'), 'and it has empty Id');
t.is(newOverride.get('Type'), 'DAY', 'and it has default type');
}
)
})
t.it('Editing day override name and date should work', function (t) {
generateDataSet()
t.chain(
// test editing day override name and date
{ clickToEditCell : [ dayGrid, 0, 0 ] },
function (next) {
//select input of the editor...
var editor = dayGrid.editingPlugin.getActiveEditor();
editor.setValue('BAR');
editor.completeEdit();
next();
},
{ clickToEditCell : [ dayGrid, 0, 1 ] },
function (next) {
var editor = dayGrid.editingPlugin.getActiveEditor();
editor.setValue(Sch.util.Date.add(editor.getValue(), Sch.util.Date.DAY, 1));
editor.completeEdit();
t.firesOk({
observable : calendar,
events : { update : 1, add : 0, remove : 0 },
during : function () {
calendarWidget.applyChanges()
}
})
t.is(calendar.getById('initial').getName(), 'BAR', 'Name correctly changed')
t.is(calendar.getById('initial').getDate(), new Date(2010, 0, 14), 'Date correctly incremented on 1 day')
}
)
})
t.it('Editing day override availability should work', function (t) {
generateDataSet()
var availabilityGrid
t.chain(
{ click : function () { return t.getCell(dayGrid, 0, 0) } },
{ click : function () { return dayGrid.el.down('.gnt-action-edit') } },
{
click : function () {
availabilityGrid = calendarWidget.currentDayOverrideEditor
return availabilityGrid.down('radiogroup [inputValue=true]')
}
},
{ click : function () { return availabilityGrid.addButton } },
{ clickToEditCell : function () { return [ availabilityGrid, 0, 0 ] } },
function (next) {
var editor = availabilityGrid.editingPlugin.getActiveEditor();
editor.setValue('12:00AM');
editor.completeEdit();
next()
},
{ clickToEditCell : function () { return [ availabilityGrid, 0, 1 ] } },
function (next) {
var editor = availabilityGrid.editingPlugin.getActiveEditor();
editor.setValue('12:00AM');
editor.completeEdit();
next()
},
{ click : function () { return availabilityGrid.ownerCt.down('button[text=OK]') } },
function (next) {
calendarWidget.applyChanges()
t.isDeeply(calendar.getById('initial').getAvailability(), [
{
startTime : new Date(0, 0, 0, 0, 0),
endTime : new Date(0, 0, 1, 0, 0)
}
], '24h availability correctly saved in the calendar')
t.isDeeply(calendar.getById('initial').getAvailability(true), [ '00:00-24:00' ], '24h availability correctly saved in string form in the calendar')
next()
}
)
})
t.it('Adding and removing day override should work', function (t) {
generateDataSet()
t.chain(
// test adding and removing day override
{
click : function () { return dayGrid.el.down('.gnt-action-add') } | {
click : function () { return t.getCell(dayGrid, 1, 0) }
},
{
click : function () { return dayGrid.el.down('.gnt-action-remove') }
},
function (next) {
t.firesOk({
observable : calendar,
events : { update : 0, add : 1, remove : 1 },
during : function () {
calendarWidget.applyChanges()
}
})
}
)
})
t.it('Adding empty week override should work', function (t) {
generateDataSet(1)
t.chain(
// test adding empty week override
{
click : function () { return weekGrid.el.down('.gnt-action-add') }
},
function (next) {
t.is(weekStore.getCount(), 1, 'Week override successfully added.');
t.is(weekStore.getAt(0).get('startDate'), today, 'and it has correct start date');
t.is(weekStore.getAt(0).get('endDate'), today1wp, 'and it has correct end date');
t.firesOk({
observable : calendar,
events : { update : 0, add : 1, remove : 0 },
during : function () {
calendarWidget.applyChanges()
}
})
t.is(calendar.getCount(), 2, 'Since new week override is empty, only a its main day should be added to the calendar')
var newOverride = calendar.getAt(1)
t.notOk(newOverride.get('Id'), 'and it has empty Id');
t.notOk(newOverride.get('Date'), 'and it has empty Date');
t.is(newOverride.get('Type'), 'WEEKDAYOVERRIDE', 'and it has correct type of week day override');
t.is(newOverride.getOverrideStartDate(), today, 'and it has correct start date');
t.is(newOverride.getOverrideEndDate(), today1wp, 'and it has correct end date');
var nonStandardWeek = calendar.getNonStandardWeekByStartDate(new Date())
t.is(nonStandardWeek.startDate, today, 'correct start date for new week');
t.is(nonStandardWeek.endDate, today1wp, 'correct end date for new week');
t.is(nonStandardWeek.mainDay, newOverride, 'Main day correct set on the week object')
}
)
})
t.it('Adding week override with some re-defined days should work', function (t) {
generateDataSet(1)
t.chain(
// test adding week override with some re-defined days
{
click : function () { return weekGrid.el.down('.gnt-action-add') }
},
{
click : function () { return t.getCell(weekGrid, 0, 0) }
},
{
click : function () { return weekGrid.el.down('.gnt-action-edit') }
},
{
click : function () { return t.cq1('calendarweekeditor').getDayTypeRadioGroup().el.query('input')[ 1 ] }
},
{
click : function () { return t.cq1('calendarweekeditor').ownerCt.query('button[action=ok]')[ 0 ] }
},
function (next) {
t.firesOk({
observable : calendar,
events : { update : 0, add : 1, remove : 0 },
during : function () {
calendarWidget.applyChanges()
}
})
t.is(calendar.getCount(), 3, 'Since new week override has 1 day, should be 3 days in the store: 1 original, 1 main + 1 week override day')
var nonStandardWeek = calendar.getNonStandardWeekByStartDate(new Date())
t.is(nonStandardWeek.startDate, today, 'correct start date for new week');
t.is(nonStandardWeek.endDate, today1wp, 'correct end date for new week');
// monday
var overridenDay = nonStandardWeek.weekAvailability[ 1 ]
t.is(overridenDay.getType(), 'WEEKDAYOVERRIDE');
t.is(overridenDay.getName(), nonStandardWeek.name, 'Name of overriden day is the same with week object');
t.is(overridenDay.getName(), nonStandardWeek.mainDay.getName(), 'Name of overriden day is the same with the week main day');
t.is(overridenDay.getOverrideStartDate(), today)
t.is(overridenDay.getOverrideEndDate(), today1wp)
t.notOk(overridenDay.get('Id'));
t.notOk(overridenDay.get('Date'));
// keeps the current calendar - can't be in own "iit"
generateDataSet(1, true)
next()
},
// test the editing of the week override created in the previous test
function (next) {
t.is(weekStore.getCount(), 1, '1 week override should present in the week grid from start - was created in the previous step')
next()
},
{
// click on the row to select it
click : function () { return t.getCell(weekGrid, 0, 0) }
},
{
click : function () { return weekGrid.el.down('.gnt-action-edit') }
},
{
// chaing the type of the Monday to "default" - should remove the according day from week availability
click : function () { return t.cq1('calendarweekeditor').getDayTypeRadioGroup().el.query('input')[ 0 ] }
},
function (next) {
// selecting the Friday (by index in the store)
t.cq1('calendarweekeditor').getWeekDaysGrid().getSelectionModel().select(4)
next()
},
{
// chaing the type of the Friday to "non-working day" - should add availability day
click : function () { return t.cq1('calendarweekeditor').getDayTypeRadioGroup().el.query('input')[ 2 ] }
},
{
click : function () { return t.cq1('calendarweekeditor').ownerCt.query('button[action=ok]')[ 0 ] }
},
{ clickToEditCell : function () { return [ weekGrid, 0, 0 ] } },
function (next) {
var editor = weekGrid.editingPlugin.getActiveEditor();
editor.setValue('WEEKFOO');
editor.completeEdit();
next();
},
{ clickToEditCell : function () { return [ weekGrid, 0, 1 ] } },
function (next) {
var editor = weekGrid.editingPlugin.getActiveEditor();
editor.setValue(today1wm);
editor.completeEdit();
next();
},
function (next) {
// 1 update for main day
// 1 removal of the Monday
// 1 addition for the Friday
t.firesOk({
observable : calendar,
events : { update : 1, add : 1, remove : 1 },
during : function () {
calendarWidget.applyChanges()
}
})
t.is(calendar.getCount(), 3, 'Since new week override has 1 day, should be 3 days in the store: 1 original, 1 main + 1 week override day')
t.notOk(calendar.getNonStandardWeekByStartDate(new Date()), 'Should no longer find a non-standard week at the current date')
var nonStandardWeek = calendar.getNonStandardWeekByStartDate(today1wm)
t.is(nonStandardWeek.startDate, today1wm, 'correct start date for new week');
t.is(nonStandardWeek.endDate, today1wp, 'correct end date for new week');
t.notOk(nonStandardWeek.weekAvailability[ 1 ], 'Monday override was removed from the week availability')
// friday
var overridenDay = nonStandardWeek.weekAvailability[ 5 ]
t.is(overridenDay.getType(), 'WEEKDAYOVERRIDE');
t.is(overridenDay.getName(), 'WEEKFOO', 'Found the newly entered name for the week override');
t.is(overridenDay.getName(), nonStandardWeek.name, 'Name of overriden day is the same with week object');
t.is(overridenDay.getName(), nonStandardWeek.mainDay.getName(), 'Name of overriden day is the same with the week main day');
t.is(overridenDay.getOverrideStartDate(), today1wm)
t.is(overridenDay.getOverrideEndDate(), today1wp)
t.notOk(overridenDay.get('Id'));
t.notOk(overridenDay.get('Date'));
// keeps the current calendar - can't be in own "iit"
generateDataSet(1, true)
next()
},
// test the removal of the week override edited in the previous test
function (next) {
t.is(weekStore.getCount(), 1, '1 week override should present in the week grid from start - was created in the previous step')
next()
},
{
// click on the row to select it
click : function () { return t.getCell(weekGrid, 0, 0) }
},
{
click : function () { return weekGrid.el.down('.gnt-action-remove') }
},
function (next) {
// 0 update
// 2 removal - 1 main + 1 override
// 0 addition
t.firesOk({
observable : calendar,
events : { update : 0, add : 0, remove : 2 },
during : function () {
calendarWidget.applyChanges()
}
})
t.is(calendar.getCount(), 1, 'Should remain only initial override')
t.notOk(calendar.getNonStandardWeekByStartDate(new Date()), 'Should no longer find a non-standard week at the current date')
t.notOk(calendar.getNonStandardWeekByStartDate(today1wm), 'Should no longer find a non-standard week at the current date - 1 week')
}
)
})
}); | }, |
math.rs | // math.rs: Simple useful math abstractions for Moon Browser
use formality_document::document::*;
pub const PI: f64 = 3.14159265358979323846;
pub fn | (x1: f64, y1: f64, x2: f64, y2: f64) -> f64 {
let dx = x2 - x1;
let dy = y2 - y1;
(dx*dx + dy*dy).sqrt()
}
pub fn is_inside(x_click: f64, y_click: f64, elem: &Element) -> bool {
match elem {
Element::Circle{x, y, r} => {
distance(*x as f64, *y as f64, x_click, y_click) < *r as f64
}
Element::Square{x, y, r} => {
(x_click > *x as f64) && (x_click < (*x + *r) as f64) &&
(y_click > *y as f64) && (y_click < (*y + *r) as f64)
}
_ => {panic!("ERROR in function \"is_inside\": Unrecognized Element Type");}
}
}
| distance |
kazaam_int_test.go | package kazaam_test
import (
"encoding/json"
"reflect"
"testing"
"github.com/qntfy/jsonparser"
"github.com/mbordner/kazaam"
"github.com/mbordner/kazaam/transform"
)
const testJSONInput = `{"rating":{"example":{"value":3},"primary":{"value":3}}}`
func checkJSONStringsEqual(item1, item2 string) (bool, error) {
var out1, out2 interface{}
err := json.Unmarshal([]byte(item1), &out1)
if err != nil {
return false, nil
}
err = json.Unmarshal([]byte(item2), &out2)
if err != nil {
return false, nil
}
return reflect.DeepEqual(out1, out2), nil
}
func TestKazaamBadInput(t *testing.T) {
jsonOut := ``
spec := `[{"operation": "shift","spec": {"Rating": "rating.primary.value","example.old": "rating.example"}}]`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString("")
if kazaamOut != jsonOut {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestKazaamBadJSONSpecification(t *testing.T) {
_, err := kazaam.NewKazaam("{spec}")
if err == nil {
t.Error("Specification JSON is invalid and should throw an error")
t.FailNow()
}
}
func TestKazaamBadJSONTransform(t *testing.T) {
kazaamTransform, _ := kazaam.NewKazaam(`[{"operation": "shift,"spec": {"data": ["$"]}}]`)
_, err := kazaamTransform.TransformJSONString(`{"data":"foo"}`)
if err == nil {
t.Error("Specification JSON is invalid and should throw an error")
t.FailNow()
}
}
func TestKazaamBadJSONTransformNoOperation(t *testing.T) {
_, err := kazaam.NewKazaam(`[{"opeeration": "shift","spec": {"data": ["$"]}}]`)
if err == nil {
t.Error("Specification JSON is invalid and should throw an error")
t.FailNow()
}
}
func TestKazaamBadJSONTransformBadOperation(t *testing.T) {
_, err := kazaam.NewKazaam(`[{"operation":"invalid","spec": {"data": ["$"]}}]`)
if err == nil {
t.Error("Specification JSON is invalid and should throw an error")
t.FailNow()
}
}
func TestKazaamMultipleTransforms(t *testing.T) {
jsonOut1 := `{"Rating":3,"example":{"old":{"value":3}}}`
jsonOut2 := `{"rating":{"example":{"value":3},"primary":{"value":3}},"Range":5}`
spec1 := `[{"operation": "shift", "spec": {"Rating": "rating.primary.value", "example.old": "rating.example"}}]`
spec2 := `[{"operation": "default", "spec": {"Range": 5}}]`
transform1, _ := kazaam.NewKazaam(spec1)
kazaamOut1, _ := transform1.TransformJSONStringToString(testJSONInput)
areEqual1, _ := checkJSONStringsEqual(kazaamOut1, jsonOut1)
transform2, _ := kazaam.NewKazaam(spec2)
kazaamOut2, _ := transform2.TransformJSONStringToString(testJSONInput)
areEqual2, _ := checkJSONStringsEqual(kazaamOut2, jsonOut2)
if !areEqual1 {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut1)
t.Log("Actual: ", kazaamOut1)
t.FailNow()
}
if !areEqual2 {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut2)
t.Log("Actual: ", kazaamOut2)
t.FailNow()
}
}
func TestKazaamMultipleTransformsRequire(t *testing.T) {
jsonOut2 := `{"rating":{"example":{"value":3},"primary":{"value":3}},"Range":5}`
spec1 := `[{"operation": "shift", "spec": {"Rating": "rating.primary.no_value", "example.old": "rating.example"}, "require": true}]`
spec2 := `[{"operation": "default", "spec": {"Range": 5}, "require": true}]`
transform1, _ := kazaam.NewKazaam(spec1)
_, out1Err := transform1.TransformJSONStringToString(testJSONInput)
transform2, _ := kazaam.NewKazaam(spec2)
kazaamOut2, _ := transform2.TransformJSONStringToString(testJSONInput)
areEqual2, _ := checkJSONStringsEqual(kazaamOut2, jsonOut2)
if out1Err == nil {
t.Error("Transform path does not exist in message and should throw an error.")
t.FailNow()
}
if !areEqual2 {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut2)
t.Log("Actual: ", kazaamOut2)
t.FailNow()
}
}
func TestKazaamNoTransform(t *testing.T) {
jsonOut := `{"rating":{"example":{"value":3},"primary":{"value":3}}}`
var spec string
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(testJSONInput)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestKazaamCoalesceTransformAndShift(t *testing.T) {
spec := `[{
"operation": "coalesce",
"spec": {"foo": ["rating.foo", "rating.primary"]}
}, {
"operation": "shift",
"spec": {"rating.foo": "foo", "rating.example.value": "rating.primary.value"}
}]`
jsonOut := `{"rating":{"foo":{"value":3},"example":{"value":3}}}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(testJSONInput)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestKazaamShiftTransformWithTimestamp(t *testing.T) {
spec := `[{
"operation": "shift",
"spec": {"newTimestamp":"oldTimestamp","oldTimestamp":"oldTimestamp"}
}, {
"operation": "timestamp",
"spec": {"newTimestamp":{"inputFormat":"Mon Jan _2 15:04:05 -0700 2006","outputFormat":"2006-01-02T15:04:05-0700"}}
}]`
jsonIn := `{"oldTimestamp":"Fri Jul 21 08:15:27 +0000 2017"}`
jsonOut := `{"oldTimestamp":"Fri Jul 21 08:15:27 +0000 2017","newTimestamp":"2017-07-21T08:15:27+0000"}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(jsonIn)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestShiftWithOverAndWildcard(t *testing.T) {
spec := `[{"operation": "shift","spec": {"docs": "documents[*]"}}, {"operation": "shift", "spec": {"data": "norm.text"}, "over":"docs"}]`
jsonIn := `{"documents":[{"norm":{"text":"String 1"}},{"norm":{"text":"String 2"}}]}`
jsonOut := `{"docs":[{"data":"String 1"},{"data":"String 2"}]}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, err := kazaamTransform.TransformJSONStringToString(jsonIn)
if err != nil {
t.Error("Transform produced error.")
t.Log("Error: ", err.Error())
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestKazaamTransformMultiOpWithOver(t *testing.T) {
spec := `[{
"operation": "concat",
"over": "a",
"spec": {"sources": [{"path": "foo"}, {"value": "KEY"}], "targetPath": "url", "delim": ":" }
}, {
"operation": "shift",
"spec": {"urls": "a[*].url" }
}]`
jsonIn := `{"a":[{"foo":0},{"foo":1},{"foo":2}]}`
jsonOut := `{"urls":["0:KEY","1:KEY","2:KEY"]}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(jsonIn)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestShiftWithOver(t *testing.T) {
jsonIn := `{"rating":{"primary":[{"value":3},{"value":5}],"example":{"value":3}}}`
jsonOut := `{"rating":{"primary":[{"new_value":3},{"new_value":5}],"example":{"value":3}}}`
spec := `[{"operation": "shift", "over": "rating.primary", "spec": {"new_value":"value"}}]`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(jsonIn)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestShiftAndGet(t *testing.T) {
jsonOut := "3"
spec := `[{"operation": "shift","spec": {"Rating": "rating.primary.value","example.old": "rating.example"}}]`
kazaamTransform, _ := kazaam.NewKazaam(spec)
transformed, err := kazaamTransform.TransformJSONString(testJSONInput)
if err != nil {
t.Error("Failed to parse JSON message before transformation")
t.FailNow()
}
kazaamOut, _, _, err := jsonparser.Get(transformed, "Rating")
if err != nil {
t.Log("Requested key not found")
}
if string(kazaamOut) != jsonOut {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", string(kazaamOut))
t.FailNow()
}
}
func TestMissingRequiredField(t *testing.T) {
jsonIn := `{"meta": {"not_image_cache": null}, "doc": "example"}`
spec := `[
{"operation": "shift", "spec": {"results": "meta.image_cache[0].results[*]"}, "require": true}
]`
kazaamTransform, _ := kazaam.NewKazaam(spec)
k, err := kazaamTransform.TransformJSONStringToString(jsonIn)
if err == nil {
t.Error("Should have generated error for null image_cache value")
t.Error(k)
}
e := err.(*kazaam.Error)
if e.ErrType != kazaam.RequireError {
t.Error("Unexpected error type")
}
}
func TestKazaamNoModify(t *testing.T) {
spec := `[{"operation": "shift","spec": {"Rating": "rating.primary.value","example.old": "rating.example"}}]`
msgOut := `{"Rating":3,"example":{"old":{"value":3}}}`
tf, _ := kazaam.NewKazaam(spec)
data := []byte(testJSONInput)
jsonOut, _ := tf.Transform(data)
areEqual1, _ := checkJSONStringsEqual(string(jsonOut), msgOut)
if !areEqual1 {
t.Error("Unexpected transformation result")
t.Error("Actual:", string(jsonOut))
t.Error("Expected:", msgOut)
}
areEqual2, _ := checkJSONStringsEqual(string(data), testJSONInput)
if !areEqual2 {
t.Error("Unexpected modification")
t.Error("Actual:", string(data))
t.Error("Expected:", testJSONInput)
}
}
func TestConfigdKazaamGet3rdPartyTransform(t *testing.T) {
kc := kazaam.NewDefaultConfig()
kc.RegisterTransform("3rd-party", func(spec *transform.Config, data []byte) ([]byte, error) {
data, _ = jsonparser.Set(data, []byte(`"does-exist"`), "doesnt-exist")
return data, nil
})
msgOut := `{"test":"data","doesnt-exist":"does-exist"}`
k, _ := kazaam.New(`[{"operation": "3rd-party"}]`, kc)
kazaamOut, _ := k.TransformJSONStringToString(`{"test":"data"}`)
areEqual, _ := checkJSONStringsEqual(kazaamOut, msgOut)
if !areEqual {
t.Error("Unexpected transform output")
t.Log("Actual: ", kazaamOut)
t.Log("Expected: ", msgOut)
}
}
func TestKazaamTransformThreeOpWithOver(t *testing.T) {
spec := `[{
"operation": "shift",
"spec":{"a": "key.array1[0].array2[*]"}
},
{
"operation": "concat",
"over": "a",
"spec": {"sources": [{"path": "foo"}, {"value": "KEY"}], "targetPath": "url", "delim": ":" }
}, {
"operation": "shift",
"spec": {"urls": "a[*].url" }
}]`
jsonIn := `{"key":{"array1":[{"array2":[{"foo":0},{"foo":1},{"foo":2}]}]}}`
jsonOut := `{"urls":["0:KEY","1:KEY","2:KEY"]}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(jsonIn)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestKazaamTransformThreeOpWithOverRequire(t *testing.T) {
spec := `[{
"operation": "shift",
"spec":{"a": "key.array1[0].array2[*]"},
"require": true
},
{
"operation": "concat",
"over": "a",
"spec": {"sources": [{"path": "foo"}, {"value": "KEY"}], "targetPath": "url", "delim": ":" }
}, {
"operation": "shift",
"spec": {"urls": "a[*].url" }
}]`
jsonIn := `{"key":{"not_array1":[{"array2":[{"foo": 0}, {"foo": 1}, {"foo": 2}]}]}}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
_, err := kazaamTransform.TransformJSONStringToString(jsonIn)
if err == nil {
t.Error("Transform path does not exist in message and should throw an error")
t.FailNow()
}
}
func TestKazaamTransformTwoOpWithOverRequire(t *testing.T) {
spec := `[{
"operation": "shift",
"spec":{"a": "key.array1[0].array2[*]"},
"require": true
},
{
"operation": "concat",
"over": "a",
"spec": {"sources": [{"path": "foo"}, {"value": "KEY"}], "targetPath": "url", "delim": ":" }
}]`
jsonIn := `{"key":{"not_array1":[{"array2":[{"foo": 0}, {"foo": 1}, {"foo": 2}]}]}}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
_, err := kazaamTransform.TransformJSONStringToString(jsonIn)
if err == nil {
t.Error("Transform path does not exist in message and should throw an error")
t.FailNow()
}
}
func | (t *testing.T) {
spec := `[{
"operation": "delete",
"spec": {"paths": ["doc.uid", "doc.guidObjects[1]"]}
}]`
jsonIn := `{"doc":{"uid":12345,"guid":["guid0","guid2","guid4"],"guidObjects":[{"id":"guid0"},{"id":"guid2"},{"id":"guid4"}]}}`
jsonOut := `{"doc":{"guid":["guid0","guid2","guid4"],"guidObjects":[{"id":"guid0"},{"id":"guid4"}]}}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(jsonIn)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
func TestKazaamOverArrayStrings(t *testing.T) {
spec := `[{
"operation": "shift",
"over": "doc.guidObjects",
"spec": {"raw": "$"}
}]`
jsonIn := `{"doc":{"guidObjects":["foo",5,false]}}`
jsonOut := `{"doc":{"guidObjects":[{"raw":"foo"},{"raw":5},{"raw":false}]}}`
kazaamTransform, _ := kazaam.NewKazaam(spec)
kazaamOut, _ := kazaamTransform.TransformJSONStringToString(jsonIn)
areEqual, _ := checkJSONStringsEqual(kazaamOut, jsonOut)
if !areEqual {
t.Error("Transformed data does not match expectation.")
t.Log("Expected: ", jsonOut)
t.Log("Actual: ", kazaamOut)
t.FailNow()
}
}
| TestKazaamTransformDelete |
index.ts | export * from './hooks';
export * from './context'; | export * from './factories'; |
|
main.js | import {game, images, card} from "./common/game.js";
import {mapInit} from "./init/map_init.js";
import {startPlantSelect} from "./init/start_plant_select.js";
import {startMenu} from "./init/start_menu.js"
import {collision} from "./common/tools.js";
import {createSun} from "./sun/sun.js";
function init() {
game.setPen(25, "black");
startMenu();
startPlantSelect();
mapInit();
}
function | () {
createSun();
// draw background
game.draw(images.background.grass, 0, 0)
// draw card
// TODO 自适应图片
game.draw(images.plant.sun_flower.card, card._1.x, card._1.y)
game.draw(images.plant.pea.card, card._2.x, card._2.y)
game.draw(images.plant.pea.card, card._3.x, card._3.y)
game.draw(images.plant.pea.card, card._4.x, card._4.y)
game.draw(images.plant.pea.card, card._5.x, card._5.y)
game.draw(images.plant.pea.card, card._6.x, card._6.y)
game.draw(images.plant.pea.card, card._7.x, card._7.y)
game.draw(images.plant.pea.card, card._8.x, card._8.y)
game.draw(images.plant.pea.card, card._9.x, card._9.y)
// draw sun
game.draw(images.sunBank, 15, 10)
game.write(game.sun, 28, 90);
if (game.selectPlant.code != 0) {
// TODO 应该根据选择植物来更改画的图片
game.draw(game.selectPlant.card, game.cursor.x - 35, game.cursor.y - 45);
}
// plant
for (let i = 0; i < game.plants.length; ++i) {
game.plants[i].action();
}
// zombie
for (let i = 0; i < game.zombies.length; ++i) {
game.zombies[i].action();
}
// bullet
for (let i = 0; i < game.bullets.length; ++i) {
game.bullets[i].action();
}
// sun
for (let i = 0; i < game.suns.length; ++i) {
game.suns[i].action();
}
}
function destroy() {
// sun
for (let i = 0; i < game.suns.length; ++i) {
if (game.suns[i].isDestroy) {
game.suns.splice(i, 1);
}
}
// zombie
for (let i = 0; i < game.zombies.length; ++i) {
if (game.zombies[i].isDestroy) {
game.zombies.splice(i, 1);
}
}
// plant
for (let i = 0; i < game.plants.length; ++i) {
if (game.plants[i].isDestroy) {
game.plants.splice(i, 1);
}
}
// bullet
for (let i = 0; i < game.bullets.length; ++i) {
if (game.bullets[i].isDestroy) {
game.bullets.splice(i, 1);
}
}
}
function main() {
init();
setInterval(() => {
action();
destroy();
}, game.FRAME_TIME);
}
window.onload = () => {
main();
}
| action |
issue_labels_option.py | # coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.16.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class IssueLabelsOption(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'labels': 'list[int]'
}
attribute_map = {
'labels': 'labels'
}
def __init__(self, labels=None): # noqa: E501
"""IssueLabelsOption - a model defined in Swagger""" # noqa: E501
self._labels = None
self.discriminator = None
if labels is not None:
self.labels = labels
@property
def labels(self):
"""Gets the labels of this IssueLabelsOption. # noqa: E501
list of label IDs # noqa: E501
:return: The labels of this IssueLabelsOption. # noqa: E501
:rtype: list[int]
"""
return self._labels
@labels.setter
def labels(self, labels):
"""Sets the labels of this IssueLabelsOption.
list of label IDs # noqa: E501
:param labels: The labels of this IssueLabelsOption. # noqa: E501
:type: list[int]
"""
self._labels = labels
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list): | result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(IssueLabelsOption, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, IssueLabelsOption):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other | |
aralog.go | package aralog
import (
"io"
"os"
"runtime"
"sync"
"time"
"strings"
"path/filepath"
"fmt"
)
// These flags define which text to prefix to each log entry generated by the Logger.
const (
// Bits or'ed together to control what's printed. There is no control over the
// order they appear (the order listed here) or the format they present (as
// described in the comments). A colon appears after these items:
// 2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
Ldate = 1 << iota // the date: 2009/01/23
Ltime // the time: 01:23:23
Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime.
Llongfile // full file name and line number: /a/b/c/d.go:23
Lshortfile // final file name element and line number: d.go:23. overrides Llongfile
LstdFlags = Ldate | Ltime // initial values for the standard logger
)
// A Logger represents an active logging object that generates lines of
// output to an io.Writer. Each logging operation makes a single call to
// the Writer's Write method. A Logger can be used simultaneously from
// multiple goroutines; it guarantees to serialize access to the Writer.
type Logger struct {
mu sync.Mutex // ensures atomic writes; protects the following fields
prefix string // prefix to write at beginning of each line
flag int // properties
out io.Writer // destination for output
buf []byte // for accumulating text to write
size uint // current size of log file
path string // file path if output to a file
maxsize uint // minimal maxsize should >= 1MB
}
var currentOutFile *os.File
// New creates a new Logger. The out variable sets the
// destination to which log data will be written.
// The prefix appears at the beginning of each generated log line.
// The flag argument defines the logging properties.
func New(out io.Writer, prefix string, flag int) *Logger {
return &Logger{out: out, prefix: prefix, flag: flag}
}
// NewFileLogger create a new Logger which output to a file specified
func NewFileLogger(path string, flag int) (*Logger, error) {
return NewRollFileLogger(path, 1024 * 1024 * 10, flag)
}
// NewRollFileLogger create a new Logger which output to a file specified path,
// and roll at specified size
func | (path string, maxsize uint, flag int) (*Logger, error) {
if strings.ContainsAny(path, string(filepath.Separator)) {
dir := path
// not ended by "/", ex: abc/d/e/x.log
if strings.HasSuffix(path, string(filepath.Separator)) {
path = path + "aralog.log" // the default log file name if not provided
} else {
i := strings.LastIndex(path, string(filepath.Separator))
paths := strings.SplitAfterN(path, string(filepath.Separator), i)
dir = paths[0]
}
os.MkdirAll(dir, 0600)
}
out, err := os.OpenFile(path, os.O_APPEND | os.O_CREATE | os.O_WRONLY, 0600)
if err != nil {
return nil, err
}
currentOutFile = out
// minimal maxsize should >= 1MB
if maxsize < 1024 * 1024 {
maxsize = 1024 * 1024 * 10
}
return &Logger{out: out, prefix: "", flag: flag, path: path, maxsize: maxsize}, nil
}
//var std = New(os.Stderr, "", LstdFlags)
// Cheap integer to fixed-width decimal ASCII. Give a negative width to avoid zero-padding.
// Knows the buffer has capacity.
func itoa(buf *[]byte, i int, wid int) {
var u uint = uint(i)
if u == 0 && wid <= 1 {
*buf = append(*buf, '0')
return
}
// Assemble decimal in reverse order.
var b [32]byte
bp := len(b)
for ; u > 0 || wid > 0; u /= 10 {
bp--
wid--
b[bp] = byte(u % 10) + '0'
}
*buf = append(*buf, b[bp:]...)
}
func (l *Logger) formatHeader(buf *[]byte, t time.Time, file string, line int) {
*buf = append(*buf, l.prefix...)
if l.flag & (Ldate | Ltime | Lmicroseconds) != 0 {
if l.flag & Ldate != 0 {
year, month, day := t.Date()
itoa(buf, year, 4)
*buf = append(*buf, '/')
itoa(buf, int(month), 2)
*buf = append(*buf, '/')
itoa(buf, day, 2)
*buf = append(*buf, ' ')
}
if l.flag & (Ltime | Lmicroseconds) != 0 {
hour, min, sec := t.Clock()
itoa(buf, hour, 2)
*buf = append(*buf, ':')
itoa(buf, min, 2)
*buf = append(*buf, ':')
itoa(buf, sec, 2)
if l.flag & Lmicroseconds != 0 {
*buf = append(*buf, '.')
itoa(buf, t.Nanosecond() / 1e3, 6)
}
*buf = append(*buf, ' ')
}
}
if l.flag & (Lshortfile | Llongfile) != 0 {
if l.flag & Lshortfile != 0 {
short := file
for i := len(file) - 1; i > 0; i-- {
if file[i] == '/' {
short = file[i + 1:]
break
}
}
file = short
}
*buf = append(*buf, file...)
*buf = append(*buf, ':')
itoa(buf, line, -1)
*buf = append(*buf, ": "...)
}
}
// Output writes the output for a logging event. The string s contains
// the text to print after the prefix specified by the flags of the
// Logger. A newline is appended if the last character of s is not
// already a newline. Calldepth is used to recover the PC and is
// provided for generality, although at the moment on all pre-defined
// paths it will be 2.
func (l *Logger) output(calldepth int, s string) error {
now := time.Now() // get this early.
var file string
var line int
l.mu.Lock()
defer l.mu.Unlock()
if l.flag & (Lshortfile | Llongfile) != 0 {
// release lock while getting caller info - it's expensive.
l.mu.Unlock()
var ok bool
_, file, line, ok = runtime.Caller(calldepth)
if !ok {
file = "???"
line = 0
}
l.mu.Lock()
}
l.buf = l.buf[:0]
l.formatHeader(&l.buf, now, file, line)
l.buf = append(l.buf, s...)
if len(s) > 0 && s[len(s) - 1] != '\n' {
l.buf = append(l.buf, '\n')
}
if len(l.path) > 0 {
err := l.rollFile(now)
if err != nil {
return err
}
}
_, err := l.out.Write(l.buf)
return err
}
func (l *Logger) rollFile(now time.Time) error {
l.size += uint(len(l.buf))
if l.size < l.maxsize {
return nil
}
// file rotation if size > maxsize
// close file before rename it
if currentOutFile != nil {
// ignore if Close() failed
err := currentOutFile.Close()
if err != nil {
l.buf = append(l.buf, ("[XXX] ARALOGGER ERROR: Close current output file failed, " + err.Error())...)
l.buf = append(l.buf, '\n')
}
}
newPath := l.path
// rename l.path to nameYYYYMMDDhhmmss
err := os.Rename(l.path,
l.path + string(now.Year()) + string(now.Month()) + string(now.Day()) +
string(now.Hour()) + string(now.Minute()) + string(now.Second()))
if err == nil {
// TODO zip it
} else {
l.buf = append(l.buf, ("[XXX] ARALOGGER ERROR: Rolling file failed, " + err.Error())...)
l.buf = append(l.buf, '\n')
// if rename failed, start a new log file with different name
newPath = l.path + string(now.Unix())
}
newOut, err := os.OpenFile(newPath, os.O_APPEND | os.O_WRONLY, 0600)
if err != nil {
return err
}
currentOutFile = newOut
l.out = newOut
l.size = uint(len(l.buf))
return nil
}
func (l *Logger) Debug(s string, v ...interface{}) error {
err := l.output(2, fmt.Sprintf(s, v...))
return err
}
| NewRollFileLogger |
generate_dataset.py | import numpy as np
import pandas as pd
import openturns as ot
from .conf_file_generation import GENERATION_CONF, post_process_generated_dataset
def sample_from_conf(
var_conf: dict, corr_conf: dict, n_sample: int, seed: int = None
) -> pd.DataFrame: | Generate dataset with n_sample form configuration file var_conf.
Parameters
----------
var_conf: dict
Configuration file of the variables (correlations,
marginal distributions, rounding)
n_sample: int
Number of row in output dataset
seed: int, optional
Optional seed for replicability
Outputs
-------
df_sample: pd.DataFrame
dataset generated from conf files
"""
## Retrieve target variable
var_list = list(var_conf.keys())
target_var = var_list[-1]
i_target_var = len(var_list) - 1
assert var_conf[target_var]["corr"] is None # Make sure that correlation
# parameter is set to None for the target variable.
## Extract var to i_var dict
var_dict = {}
for i_var, var in enumerate(var_list):
var_dict[var] = i_var
## Define marginal distributions of each variable
marginals = []
for var in var_list:
marginals.append(var_conf[var]["marg"])
## Define correlations with target variable
R = ot.CorrelationMatrix(len(var_list))
for i_var, var in enumerate(var_list):
if var != target_var:
R[i_var, i_target_var] = var_conf[var]["corr"]
## Define correlations within explanatory variables
for key, value in corr_conf.items():
i_min = min(var_dict[key[0]], var_dict[key[1]])
i_max = max(var_dict[key[0]], var_dict[key[1]])
R[i_min, i_max] = value
## Build distribution and sample
copula = ot.NormalCopula(R)
distribution = ot.ComposedDistribution(marginals, copula)
if seed is not None:
ot.RandomGenerator.SetSeed(seed)
df_sample = pd.DataFrame(
np.array(distribution.getSample(n_sample)), columns=var_list
)
## Apply bounds
for var in var_list:
if var_conf[var]["bounds"] is not None:
df_sample[var] = df_sample[var].clip(
var_conf[var]["bounds"][0], var_conf[var]["bounds"][1]
)
## Applys rounding
for var in var_list:
df_sample[var] = df_sample[var].round(var_conf[var]["round"])
## Apply post-processinf
df_sample = post_process_generated_dataset(df_sample)
return df_sample
def prepare_ML_sets(
generation_conf: dict, n_sample: int, test_size: float = 0.25, seed: int = None
) -> tuple:
"""
Generate train, eval and test sets in X, y scikit-learn format.
Parameters
----------
generation_conf: dict
Configuration file of dataset
n_sample: int
Number of row in output dataset
test_size: float, optional
Proportion of test_size. Note that eval_size is set to eval_size
seed: int, optional
Returns
-------
output: tuple
tuple of generated datasets with format:
(X_train, y_train, X_eval, y_eval, X_test, y_test)
"""
## Get target_var name
target_var = list(generation_conf["train"]["var"].keys())[-1]
steps = ["train", "eval", "test"]
n_sample_list = [
int(n_sample * (1 - 2 * test_size)),
int(n_sample * test_size),
int(n_sample * test_size),
]
output = []
for i_step, (step, i_sample) in enumerate(zip(steps, n_sample_list)):
if seed is None: # Change seed for each step
current_seed = None
else:
current_seed = seed + i_step
df_step = sample_from_conf(
generation_conf[step]["var"],
generation_conf[step]["corr"],
i_sample, #
seed=current_seed,
)
output += [df_step.drop([target_var], axis=1), df_step[target_var]]
return tuple(output) | """ |
ir.rs | //! Intermediate representation for a regex
use crate::api;
use crate::types::{BracketContents, CaptureGroupID, CaptureGroupName};
use crate::unicode::PropertyEscape;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, string::ToString, vec::Vec};
use core::fmt;
#[derive(Debug, Copy, Clone)]
pub enum AnchorType {
StartOfLine, // ^
EndOfLine, // $
}
/// A Quantifier.
#[derive(Debug, Copy, Clone)]
pub struct Quantifier {
/// Minimum number of iterations of the loop, inclusive.
pub min: usize,
/// Maximum number of iterations of the loop, inclusive.
pub max: usize,
/// Whether the loop is greedy.
pub greedy: bool,
}
/// The node types of our IR.
#[derive(Debug)]
pub enum Node {
/// Matches the empty string.
Empty,
/// Reaching this node terminates the match successfully.
Goal,
/// Match a literal character.
Char { c: u32, icase: bool },
/// Match a literal sequence of bytes.
ByteSequence(Vec<u8>),
/// Match any of a sequence of *bytes*.
/// This may not exceed length MAX_BYTE_SET_LENGTH.
ByteSet(Vec<u8>),
/// Match any of a sequence of *chars*, case-insensitive.
/// This may not exceed length MAX_CHAR_SET_LENGTH.
CharSet(Vec<u32>),
/// Match the catenation of multiple nodes.
Cat(Vec<Node>),
/// Match an alternation like a|b.
Alt(Box<Node>, Box<Node>),
/// Match anything including newlines.
MatchAny,
/// Match anything except a newline.
MatchAnyExceptLineTerminator,
/// Match an anchor like ^ or $
Anchor(AnchorType),
/// Word boundary (\b or \B).
WordBoundary { invert: bool },
/// A capturing group.
CaptureGroup(Box<Node>, CaptureGroupID),
/// A named capturing group.
NamedCaptureGroup(Box<Node>, CaptureGroupID, CaptureGroupName),
/// A backreference.
BackRef(u32),
/// A bracket.
Bracket(BracketContents),
/// A lookaround assertions like (?:) or (?!).
LookaroundAssertion {
negate: bool,
backwards: bool,
start_group: CaptureGroupID,
end_group: CaptureGroupID,
contents: Box<Node>,
},
/// A loop like /.*/ or /x{3, 5}?/
Loop {
loopee: Box<Node>,
quant: Quantifier,
enclosed_groups: core::ops::Range<u16>,
},
/// A loop whose body matches exactly one character.
/// Enclosed capture groups are forbidden here.
Loop1CharBody {
loopee: Box<Node>,
quant: Quantifier,
},
// TODO: doc comment
UnicodePropertyEscape {
property_escape: PropertyEscape,
negate: bool,
},
}
pub type NodeList = Vec<Node>;
impl Node {
/// Reverse the children of \p self if in a lookbehind.
/// Used as a parameter to walk_mut.
pub fn reverse_cats(&mut self, w: &mut Walk) {
match self {
Node::Cat(nodes) if w.in_lookbehind => nodes.reverse(),
Node::ByteSequence(..) => panic!("Should not be reversing literal bytes"),
_ => {}
}
}
/// \return whether this is an Empty node.
pub fn is_empty(&self) -> bool {
matches!(self, Node::Empty)
}
/// \return whether this is a Cat node.
pub fn is_cat(&self) -> bool {
matches!(self, Node::Cat(..))
}
/// \return whether this node is known to match exactly one char.
/// This is best-effort: a false return is always safe.
pub fn matches_exactly_one_char(&self) -> bool {
match self {
Node::Char { .. } => true,
Node::CharSet { .. } => true,
Node::Bracket { .. } => true,
Node::MatchAny => true,
Node::MatchAnyExceptLineTerminator => true,
_ => false,
}
}
/// Duplicate a node, perhaps assigning new loop IDs. Note we must never
/// copy a capture group.
pub fn duplicate(&self) -> Node {
match self {
Node::Empty => Node::Empty,
Node::Goal => Node::Goal,
&Node::Char { c, icase } => Node::Char { c, icase },
Node::ByteSequence(bytes) => Node::ByteSequence(bytes.clone()),
Node::ByteSet(bytes) => Node::ByteSet(bytes.clone()),
Node::CharSet(chars) => Node::CharSet(chars.clone()),
Node::Cat(nodes) => Node::Cat(nodes.iter().map(|n| n.duplicate()).collect()),
Node::Alt(left, right) => {
Node::Alt(Box::new(left.duplicate()), Box::new(right.duplicate()))
}
Node::MatchAny => Node::MatchAny,
Node::MatchAnyExceptLineTerminator => Node::MatchAnyExceptLineTerminator,
&Node::Anchor(anchor_type) => Node::Anchor(anchor_type),
Node::Loop {
loopee,
quant,
enclosed_groups,
} => {
assert!(
enclosed_groups.start >= enclosed_groups.end,
"Cannot duplicate a loop with enclosed groups"
);
Node::Loop {
loopee: Box::new(loopee.as_ref().duplicate()),
quant: *quant,
enclosed_groups: enclosed_groups.clone(),
}
}
Node::Loop1CharBody { loopee, quant } => Node::Loop1CharBody {
loopee: Box::new(loopee.as_ref().duplicate()),
quant: *quant,
},
Node::CaptureGroup(..) | Node::NamedCaptureGroup(..) => {
panic!("Refusing to duplicate a capture group");
}
&Node::WordBoundary { invert } => Node::WordBoundary { invert },
&Node::BackRef(idx) => Node::BackRef(idx),
Node::Bracket(bc) => Node::Bracket(bc.clone()),
// Do not reverse into lookarounds, they already have the right sense.
Node::LookaroundAssertion {
negate,
backwards,
start_group,
end_group,
contents,
} => {
assert!(
start_group >= end_group,
"Cannot duplicate an assertion with enclosed groups"
);
Node::LookaroundAssertion {
negate: *negate,
backwards: *backwards,
start_group: *start_group,
end_group: *end_group,
contents: Box::new((*contents).duplicate()),
}
}
Node::UnicodePropertyEscape {
property_escape,
negate: negated,
} => Node::UnicodePropertyEscape {
property_escape: *property_escape,
negate: *negated,
},
}
}
}
/// A helper type for walking.
#[derive(Debug, Clone, Default)]
pub struct Walk {
// It set to true, skip the children of this node.
pub skip_children: bool,
// The current depth of the walk.
pub depth: usize,
// If true, we are in a lookbehind (and so the cursor will move backwards).
pub in_lookbehind: bool,
}
#[derive(Debug)]
struct Walker<'a, F>
where
F: FnMut(&Node, &mut Walk),
{
func: &'a mut F,
postorder: bool,
walk: Walk,
}
impl<'a, F> Walker<'a, F>
where
F: FnMut(&Node, &mut Walk),
{
fn process_children(&mut self, n: &Node) {
match n {
Node::Empty => {}
Node::Goal => {}
Node::Char { .. } => {}
Node::ByteSequence(..) => {}
Node::ByteSet(..) => {}
Node::CharSet(..) => {}
Node::Cat(nodes) => {
for node in nodes {
self.process(node);
}
}
Node::Alt(left, right) => {
self.process(left.as_ref());
self.process(right.as_ref());
}
Node::MatchAny => {}
Node::MatchAnyExceptLineTerminator => {}
Node::Anchor { .. } => {}
Node::Loop { loopee, .. } => self.process(loopee),
Node::Loop1CharBody { loopee, .. } => self.process(loopee),
Node::CaptureGroup(contents, ..) | Node::NamedCaptureGroup(contents, ..) => {
self.process(contents.as_ref())
}
Node::WordBoundary { .. } => {}
Node::BackRef { .. } => {}
Node::Bracket { .. } => {}
Node::LookaroundAssertion {
backwards,
contents,
..
} => {
let saved = self.walk.in_lookbehind;
self.walk.in_lookbehind = *backwards;
self.process(contents.as_ref());
self.walk.in_lookbehind = saved;
}
Node::UnicodePropertyEscape { .. } => {}
}
}
fn process(&mut self, n: &Node) {
self.walk.skip_children = false;
if !self.postorder {
(self.func)(n, &mut self.walk);
}
if !self.walk.skip_children {
self.walk.depth += 1;
self.process_children(n);
self.walk.depth -= 1;
}
if self.postorder {
(self.func)(n, &mut self.walk)
}
}
}
#[derive(Debug)]
struct MutWalker<'a, F>
where
F: FnMut(&mut Node, &mut Walk),
{
func: &'a mut F,
postorder: bool,
walk: Walk,
}
impl<'a, F> MutWalker<'a, F>
where
F: FnMut(&mut Node, &mut Walk),
{
fn process_children(&mut self, n: &mut Node) {
match n {
Node::Empty => {}
Node::Goal => {}
Node::Char { .. } => {}
Node::ByteSequence(..) => {}
Node::ByteSet(..) => {}
Node::CharSet(..) => {}
Node::Cat(nodes) => {
for node in nodes {
self.process(node);
}
}
Node::Alt(left, right) => {
self.process(left.as_mut());
self.process(right.as_mut());
}
Node::MatchAny => {}
Node::MatchAnyExceptLineTerminator => {}
Node::Anchor { .. } => {}
Node::Loop { loopee, .. } => {
self.process(loopee);
}
Node::Loop1CharBody { loopee, .. } => {
self.process(loopee);
}
Node::CaptureGroup(contents, ..) | Node::NamedCaptureGroup(contents, ..) => {
self.process(contents.as_mut())
}
Node::WordBoundary { .. } => {}
Node::BackRef { .. } => {}
Node::Bracket { .. } => {}
Node::LookaroundAssertion {
backwards,
contents,
..
} => {
let saved = self.walk.in_lookbehind;
self.walk.in_lookbehind = *backwards;
self.process(contents.as_mut());
self.walk.in_lookbehind = saved;
}
Node::UnicodePropertyEscape { .. } => {}
}
}
fn | (&mut self, n: &mut Node) {
self.walk.skip_children = false;
if !self.postorder {
(self.func)(n, &mut self.walk);
}
if !self.walk.skip_children {
self.walk.depth += 1;
self.process_children(n);
self.walk.depth -= 1;
}
if self.postorder {
(self.func)(n, &mut self.walk);
}
}
}
/// Call a function on every Node.
/// If \p postorder is true, then process children before the node;
/// otherwise process children after the node.
pub fn walk<F>(postorder: bool, n: &Node, func: &mut F)
where
F: FnMut(&Node, &mut Walk),
{
let mut walker = Walker {
func,
postorder,
walk: Walk::default(),
};
walker.process(n);
}
/// Call a function on every Node, which may mutate the node.
/// If \p postorder is true, then process children before the node;
/// otherwise process children after the node.
/// If postorder is false, the function should return true to process children,
/// false to avoid descending into children. If postorder is true, the return
/// value is ignored.
pub fn walk_mut<F>(postorder: bool, n: &mut Node, func: &mut F)
where
F: FnMut(&mut Node, &mut Walk),
{
let mut walker = MutWalker {
func,
postorder,
walk: Walk::default(),
};
walker.process(n);
}
/// A regex in IR form.
pub struct Regex {
pub node: Node,
pub flags: api::Flags,
}
impl Regex {}
fn display_node(node: &Node, depth: usize, f: &mut fmt::Formatter) -> fmt::Result {
for _ in 0..depth {
write!(f, "..")?;
}
match node {
Node::Empty => {
writeln!(f, "Empty")?;
}
Node::Goal => {
writeln!(f, "Goal")?;
}
Node::Char { c, icase: _ } => {
writeln!(f, "'{}'", &c.to_string())?;
}
Node::ByteSequence(bytes) => {
write!(f, "ByteSeq{} 0x", bytes.len())?;
for &b in bytes {
write!(f, "{:x}", b)?;
}
writeln!(f)?;
}
Node::ByteSet(bytes) => {
let len = bytes.len();
write!(f, "ByteSet{}", len)?;
if len > 0 {
write!(f, "0x")?;
for &b in bytes {
write!(f, "{:x}", b)?;
}
}
writeln!(f)?;
}
Node::CharSet(chars) => {
write!(f, "CharSet 0x")?;
for &c in chars {
write!(f, "{:x}", c as u32)?;
}
writeln!(f)?;
}
Node::Cat(..) => {
writeln!(f, "Cat")?;
}
Node::Alt(..) => {
writeln!(f, "Alt")?;
}
Node::MatchAny => {
writeln!(f, "MatchAny")?;
}
Node::MatchAnyExceptLineTerminator => {
writeln!(f, "MatchAnyExceptLineTerminator")?;
}
Node::Anchor(anchor_type) => {
writeln!(f, "Anchor {:?}", anchor_type)?;
}
Node::Loop {
quant,
enclosed_groups,
..
} => {
writeln!(f, "Loop (groups {:?}) {:?}", enclosed_groups, quant)?;
}
Node::Loop1CharBody { quant, .. } => {
writeln!(f, "Loop1Char {:?}", quant)?;
}
Node::CaptureGroup(_node, idx, ..) => {
writeln!(f, "CaptureGroup {:?}", idx)?;
}
Node::NamedCaptureGroup(_node, _, name) => {
writeln!(f, "NamedCaptureGroup {:?}", name)?;
}
&Node::WordBoundary { invert } => {
let kind = if invert { "\\B" } else { "\\b" };
writeln!(f, "WordBoundary {:?} ", kind)?;
}
&Node::BackRef(group) => {
writeln!(f, "BackRef {:?} ", group)?;
}
Node::Bracket(contents) => {
writeln!(f, "Bracket {:?}", contents)?;
}
&Node::LookaroundAssertion {
negate,
backwards,
start_group,
end_group,
..
} => {
let sense = if negate { "negative" } else { "positive" };
let direction = if backwards { "backwards" } else { "forwards" };
writeln!(
f,
"LookaroundAssertion {} {} {:?} {:?}",
sense, direction, start_group, end_group
)?;
}
Node::UnicodePropertyEscape {
property_escape,
negate,
} => {
let sense = if *negate { "negative" } else { "" };
writeln!(
f,
"UnicodePropertyEscape {} {:?} {:?}",
sense, property_escape.name, property_escape.value
)?;
}
}
Ok(())
}
impl fmt::Display for Regex {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
//display_node(&self.node, 0, f)
let mut result = Ok(());
walk(false, &self.node, &mut |node: &Node, walk: &mut Walk| {
if result.is_ok() {
result = display_node(node, walk.depth, f)
}
});
result
}
}
| process |
io_resolver_test.go | // Copyright (c) 2020 Joshua Mark Rutherford
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
package resolvers
import (
"strings"
"testing"
"github.com/galaho/pathogen/pkg/repositories"
. "github.com/smartystreets/goconvey/convey"
)
func TestIOResolver(t *testing.T) {
Convey("When IOResolver", t, func() {
Convey(".Resolve is invoked", func() {
Convey("with an empty variable slice", func() {
reader := strings.NewReader("orange\n")
writer := &strings.Builder{}
resolver := NewIOResolver(reader, writer)
variables := []repositories.Variable{}
expected := map[string]string{}
actual, err := resolver.Resolve(variables)
Convey("it returns an empty variable map", func() {
So(actual, ShouldResemble, expected)
})
Convey("it returns a nil error", func() {
So(err, ShouldBeNil)
})
})
Convey("with a non-empty variable slice", func() {
reader := strings.NewReader("Sir Galahad\nTo seek the Holy Grail\nBlue\n")
writer := &strings.Builder{}
resolver := NewIOResolver(reader, writer)
variables := []repositories.Variable{
repositories.Variable{
Name: "name",
Description: "your name",
Value: "",
},
repositories.Variable{
Name: "quest",
Description: "your quest",
Value: "",
},
repositories.Variable{
Name: "color",
Description: "your favorite colour",
Value: "",
},
}
expected := map[string]string{
"name": "Sir Galahad",
"quest": "To seek the Holy Grail",
"color": "Blue",
}
actual, err := resolver.Resolve(variables)
Convey("it returns the expected variable map", func() {
So(actual, ShouldResemble, expected)
})
Convey("it returns a nil error", func() {
So(err, ShouldBeNil)
})
})
})
})
} | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
PotatoTube2.0.py | import youtube_dl,re, os, tkinter
def getUrlWindow(data=None):
root=tkinter.Tk()
root.withdraw()
data = root.clipboard_get()
if re.match('https://www.youtube.com/',data) != None:
print('Downloading as MP3')
return data
else: |
def sendtoYDL(data):
ydl_opts = { 'outtmpl':os.getcwd()[:12].replace('\\',"/")+'Downloads/PotatoTube/','format': 'bestaudio/best',
'postprocessors':[{'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '320'}]}
with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([data])
if __name__ == '__main__':
Print("Welcome to PotatoTube! /n Waiting for URL...")
while True:
data= getUrlWindow()
if data==None: continue
sendtoYDL(data)
print("Downloaded. Waiting for URL....")
| return None |
index_20191030183908.js | /**
*
* InvitationForm
*
*/
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';
import { useInjectSaga } from 'utils/injectSaga';
import { useInjectReducer } from 'utils/injectReducer';
import { Container, Row, Col, Form } from 'react-bootstrap';
import Input from '../../components/Input';
import Button from '../../components/Button';
import makeSelectInvitationForm from './selectors';
import reducer from './reducer';
import saga from './saga';
import * as a from './actions';
import Wrapper from './style';
export function | (props) {
const [validated, setValidated] = useState(false);
const [fields, setFields] = useState([{ value: null }]);
const [textArea, setTextArea] = useState(false);
const handleChange = (i, event) => {
const values = [...fields];
values[i].value = event.target.value;
setFields(values);
};
const handleAddInput = () => {
const values = [...fields];
values.push({ value: null });
setFields(values);
setTextArea(false);
};
const handleAddTextArea = () => {
setTextArea(true);
};
const handleRemove = i => {
const values = [...fields];
values.splice(i, 1);
setFields(values);
};
const handleSubmit = event => {
const form = event.currentTarget;
event.preventDefault();
// fields &&
// fields.map((email, index) => {
// console.log('email', email.value);
// });
const payload =
fields &&
fields.map((email, index) => {
return {
email: email.index,
};
});
console.log(payload)
if (form.checkValidity() === true) {
if (textArea === false) {
const payload = {
email: fields[0].value,
};
props.sendInvitation(payload);
} else {
// const payload =
// fields &&
// fields.map((email, index) => {
// console.log('email', email.value);
// });
const payload = {
email: fields[0].value,
};
props.sendInvitation(payload);
}
}
setValidated(true);
};
useInjectReducer({ key: 'invitationForm', reducer });
useInjectSaga({ key: 'invitationForm', saga });
return (
<Wrapper>
<Container>
<Row className="justify-content-md-center">
<Col md={{ span: 10, offset: 1 }} className="invitaion-form">
<Form noValidate validated={validated} onSubmit={handleSubmit}>
<Form.Row>
<Form.Group
as={Col}
md="12"
controlId="validationCustom01"
className="custom-inputs"
>
{textArea && textArea ? (
<div className="textarea-input">
<Form.Label>
Enter multiple email addresses seprated by commas
</Form.Label>
<Form.Control required as="textarea" rows="5" />
<Form.Control.Feedback type="invalid">
Please provide a valid email address.
</Form.Control.Feedback>
</div>
) : (
<div>
<Form.Label>Email Address</Form.Label>
{fields.map((field, id) => {
return (
<Row key={id}>
<Col md="11">
<Form.Control
required
type="email"
placeholder="email"
value={field.value || ''}
onChange={e => handleChange(id, e)}
/>
</Col>
<Col lg="1">
<Button
variant="link"
type="button"
className="link"
btnText="x"
handle={() => handleRemove(id)}
/>
</Col>
<Col lg="12">
<Form.Control.Feedback type="invalid">
invalid email address
</Form.Control.Feedback>
</Col>
</Row>
);
})}
</div>
)}
<div className="addBtn-inputs">
<Button
variant="link"
className="link"
btnText="add another"
type="button"
handle={handleAddInput}
/>
<span>or </span>
<Button
variant="link"
className="link"
type="button"
btnText="add many at once"
handle={handleAddTextArea}
/>
</div>
</Form.Group>
<div className="send-invite">
<Button
variant="secondary"
type="submit"
btnText="Send Invites"
/>
</div>
</Form.Row>
</Form>
</Col>
</Row>
</Container>
</Wrapper>
);
}
InvitationForm.propTypes = {
dispatch: PropTypes.func.isRequired,
sendInvitation: PropTypes.func,
};
const mapStateToProps = createStructuredSelector({
invitationForm: makeSelectInvitationForm(),
});
function mapDispatchToProps(dispatch) {
return {
dispatch,
sendInvitation: payload => dispatch(a.sendInvitation(payload)),
setResponse: payload => dispatch(a.setResponse(payload)),
};
}
const withConnect = connect(
mapStateToProps,
mapDispatchToProps,
);
export default compose(withConnect)(InvitationForm);
| InvitationForm |
base_dataset.py | import torch.utils.data as data
from PIL import Image
import torchvision.transforms as transforms
from torchvision.transforms import InterpolationMode
class BaseDataset(data.Dataset):
def | (self):
super(BaseDataset, self).__init__()
def name(self):
return 'BaseDataset'
def initialize(self, opt):
pass
def get_transform(opt):
transform_list = []
if opt.resize_or_crop == 'resize_and_crop':
osize = [opt.loadSize, opt.loadSize]
transform_list.append(transforms.Resize(osize, InterpolationMode.BICUBIC))
transform_list.append(transforms.RandomCrop(opt.fineSize))
elif opt.resize_or_crop == 'crop':
transform_list.append(transforms.RandomCrop(opt.fineSize))
elif opt.resize_or_crop == 'scale_width':
transform_list.append(transforms.Lambda(
lambda img: __scale_width(img, opt.fineSize)))
elif opt.resize_or_crop == 'scale_width_and_crop':
transform_list.append(transforms.Lambda(
lambda img: __scale_width(img, opt.loadSize)))
transform_list.append(transforms.RandomCrop(opt.fineSize))
if opt.isTrain and not opt.no_flip:
transform_list.append(transforms.RandomHorizontalFlip())
transform_list += [transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5),
(0.5, 0.5, 0.5))]
return transforms.Compose(transform_list)
def __scale_width(img, target_width):
ow, oh = img.size
if (ow == target_width):
return img
w = target_width
h = int(target_width * oh / ow)
return img.resize((w, h), Image.BICUBIC)
| __init__ |
address.model.ts | import { Field, ObjectType, ID } from '@nestjs/graphql'
@ObjectType() | code!: string
@Field(() => String, { nullable: true })
lastUpdated?: string
@Field(() => String, { nullable: true })
streetAddress?: string
@Field(() => String)
city!: string
@Field(() => String, { nullable: true })
postalCode?: string
} | export class Address {
@Field(() => ID) |
terra_qry_discord_bot.py | import discord
import requests
import os
my_secret = os.environ['TOKEN']
glow = 'terra1tu9yjssxslh3fd6fe908ntkquf3nd3xt8kp2u2'
client = discord.Client()
@client.event
async def on_ready():
|
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$tickets'):
query_msg = '{"state":{"contract_addr":"' + glow + '"}}'
response = requests.get("https://lcd.terra.dev/wasm/contracts/" + glow + "/store",
params={"query_msg": query_msg},
).json()
total_tickets = response['result']['total_tickets']
await message.channel.send('Total Tickets Locked: ' + total_tickets)
client.run(my_secret)
| print('We have logged in as {0.user}'.format(client)) |
services.test.ts | import services from '../services';
describe('Services: {{{scaffold_entities}}}', () => {
const config = {
get: (): unknown => jest.fn(),
};
const {{{scaffold_entity}}} = {
name: 'Bolatan Ibrahim',
id: '5c3cab69ffb5bd22494a8484',
};
const json = jest.fn().mockReturnValue(() => {{{scaffold_entity}}});
describe('.create', () => {
const payload = {};
it('returns stringified record of newly created {{{scaffold_entity}}}', async () => {
const db = {
{{{scaffold_entities}}}: {
create: jest.fn().mockReturnValue({{{scaffold_entity}}}),
},
};
const { {{{scaffold_entities}}} } = services(db);
const actual = await {{{scaffold_entities}}}.create({ json, config, payload });
expect(JSON.parse(JSON.stringify(actual))).toEqual({{{scaffold_entity}}});
});
it('throws an error when new record creation fails', async () => {
const db = {
{{{scaffold_entities}}}: {
create: jest.fn().mockReturnValue(Promise.reject(new Error('db Error'))),
},
};
try {
await expect(
await (async (): Promise<unknown> =>
services(db).{{{scaffold_entities}}}.create({ json, config, payload }))(),
).resolves.toThrow();
} catch (e) {
expect(e).toEqual(new Error('db Error'));
} | });
describe('.findById', () => {
let db = {
{{{scaffold_entities}}}: {
findById: jest.fn().mockReturnValue({{{scaffold_entity}}}),
},
};
const payload = { id: '5c3cab69ffb5bd22494a8484' };
it('returns hal-json formatted record of fetched {{{scaffold_entity}}}', async () => {
const { {{{scaffold_entities}}} } = services(db);
const actual = await {{{scaffold_entities}}}.findById({ payload, json, config });
expect(JSON.parse(JSON.stringify(actual))).toEqual({{{scaffold_entity}}});
});
it('raises exception when {{{scaffold_entity}}} not found', async () => {
db = {
{{{scaffold_entities}}}: {
findById: jest.fn().mockReturnValue(null),
},
};
try {
await expect(
await (async (): Promise<unknown> =>
services(db).{{{scaffold_entities}}}.findById({ json, config, payload }))(),
).resolves.toThrow();
} catch (e) {
expect(e).toEqual(new Error(null));
}
});
});
}); | }); |
propagator.py | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the QuTiP: Quantum Toolbox in Python nor the names
# of its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###############################################################################
__all__ = ['propagator', 'propagator_steadystate']
import types
import numpy as np
import scipy.linalg as la
import functools
import scipy.sparse as sp
from qutip.qobj import Qobj
from qutip.tensor import tensor
from qutip.operators import qeye
from qutip.rhs_generate import (rhs_generate, rhs_clear, _td_format_check)
from qutip.superoperator import (vec2mat, mat2vec,
vector_to_operator, operator_to_vector)
from qutip.sparse import sp_reshape
from qutip.cy.sparse_utils import unit_row_norm
from qutip.mesolve import mesolve
from qutip.sesolve import sesolve
from qutip.states import basis
from qutip.solver import Options, _solver_safety_check, config
from qutip.parallel import parallel_map, _default_kwargs
from qutip.ui.progressbar import BaseProgressBar, TextProgressBar
def propagator(H, t, c_op_list=[], args={}, options=None,
unitary_mode='batch', parallel=False,
progress_bar=None, _safe_mode=True,
**kwargs):
r"""
Calculate the propagator U(t) for the density matrix or wave function such
that :math:`\psi(t) = U(t)\psi(0)` or
:math:`\rho_{\mathrm vec}(t) = U(t) \rho_{\mathrm vec}(0)`
where :math:`\rho_{\mathrm vec}` is the vector representation of the
density matrix.
Parameters
----------
H : qobj or list
Hamiltonian as a Qobj instance of a nested list of Qobjs and
coefficients in the list-string or list-function format for
time-dependent Hamiltonians (see description in :func:`qutip.mesolve`).
t : float or array-like
Time or list of times for which to evaluate the propagator.
c_op_list : list
List of qobj collapse operators.
args : list/array/dictionary
Parameters to callback functions for time-dependent Hamiltonians and
collapse operators.
options : :class:`qutip.Options`
with options for the ODE solver.
unitary_mode = str ('batch', 'single')
Solve all basis vectors simulaneously ('batch') or individually
('single').
parallel : bool {False, True}
Run the propagator in parallel mode. This will override the
unitary_mode settings if set to True.
progress_bar: BaseProgressBar
Optional instance of BaseProgressBar, or a subclass thereof, for
showing the progress of the simulation. By default no progress bar
is used, and if set to True a TextProgressBar will be used.
Returns
-------
a : qobj
Instance representing the propagator :math:`U(t)`.
"""
kw = _default_kwargs()
if 'num_cpus' in kwargs:
num_cpus = kwargs['num_cpus']
else:
num_cpus = kw['num_cpus']
if progress_bar is None:
progress_bar = BaseProgressBar()
elif progress_bar is True:
progress_bar = TextProgressBar()
if options is None:
options = Options()
options.rhs_reuse = True
rhs_clear()
if isinstance(t, (int, float, np.integer, np.floating)):
tlist = [0, t]
else:
tlist = t
if _safe_mode:
_solver_safety_check(H, None, c_ops=c_op_list, e_ops=[], args=args)
td_type = _td_format_check(H, c_op_list, solver='me')
if isinstance(H, (types.FunctionType, types.BuiltinFunctionType,
functools.partial)):
H0 = H(0.0, args)
if unitary_mode =='batch':
# batch don't work with function Hamiltonian
unitary_mode = 'single'
elif isinstance(H, list):
H0 = H[0][0] if isinstance(H[0], list) else H[0]
else:
H0 = H
if len(c_op_list) == 0 and H0.isoper:
# calculate propagator for the wave function
N = H0.shape[0]
dims = H0.dims
if parallel:
unitary_mode = 'single'
u = np.zeros([N, N, len(tlist)], dtype=complex)
output = parallel_map(_parallel_sesolve, range(N),
task_args=(N, H, tlist, args, options),
progress_bar=progress_bar, num_cpus=num_cpus)
for n in range(N):
for k, t in enumerate(tlist):
u[:, n, k] = output[n].states[k].full().T
else:
if unitary_mode == 'single':
output = sesolve(H, qeye(dims[0]), tlist, [], args, options,
_safe_mode=False)
if len(tlist) == 2:
return output.states[-1]
else:
return output.states
elif unitary_mode =='batch':
u = np.zeros(len(tlist), dtype=object)
_rows = np.array([(N+1)*m for m in range(N)])
_cols = np.zeros_like(_rows)
_data = np.ones_like(_rows, dtype=complex)
psi0 = Qobj(sp.coo_matrix((_data, (_rows, _cols))).tocsr())
if td_type[1] > 0 or td_type[2] > 0:
H2 = []
for k in range(len(H)):
if isinstance(H[k], list):
H2.append([tensor(qeye(N), H[k][0]), H[k][1]])
else:
H2.append(tensor(qeye(N), H[k]))
else:
H2 = tensor(qeye(N), H)
options.normalize_output = False
output = sesolve(H2, psi0, tlist, [],
args=args, options=options,
_safe_mode=False)
for k, t in enumerate(tlist):
u[k] = sp_reshape(output.states[k].data, (N, N))
unit_row_norm(u[k].data, u[k].indptr, u[k].shape[0])
u[k] = u[k].T.tocsr()
else:
raise Exception('Invalid unitary mode.')
elif len(c_op_list) == 0 and H0.issuper:
# calculate the propagator for the vector representation of the
# density matrix (a superoperator propagator)
unitary_mode = 'single'
N = H0.shape[0]
sqrt_N = int(np.sqrt(N))
dims = H0.dims
u = np.zeros([N, N, len(tlist)], dtype=complex)
if parallel:
output = parallel_map(_parallel_mesolve,range(N * N),
task_args=(
sqrt_N, H, tlist, c_op_list, args,
options),
progress_bar=progress_bar, num_cpus=num_cpus)
for n in range(N * N):
for k, t in enumerate(tlist):
u[:, n, k] = mat2vec(output[n].states[k].full()).T
else:
rho0 = qeye(N,N)
rho0.dims = [[sqrt_N, sqrt_N], [sqrt_N, sqrt_N]]
output = mesolve(H, psi0, tlist, [], args, options,
_safe_mode=False)
if len(tlist) == 2:
return output.states[-1]
else:
return output.states
else:
# calculate the propagator for the vector representation of the
# density matrix (a superoperator propagator)
unitary_mode = 'single'
N = H0.shape[0]
dims = [H0.dims, H0.dims]
u = np.zeros([N * N, N * N, len(tlist)], dtype=complex)
if parallel:
output = parallel_map(_parallel_mesolve, range(N * N),
task_args=(
N, H, tlist, c_op_list, args, options),
progress_bar=progress_bar, num_cpus=num_cpus)
for n in range(N * N):
for k, t in enumerate(tlist):
u[:, n, k] = mat2vec(output[n].states[k].full()).T
else:
progress_bar.start(N * N)
for n in range(N * N):
progress_bar.update(n)
col_idx, row_idx = np.unravel_index(n, (N, N))
rho0 = Qobj(sp.csr_matrix(([1], ([row_idx], [col_idx])),
shape=(N,N), dtype=complex))
output = mesolve(H, rho0, tlist, c_op_list, [], args, options,
_safe_mode=False)
for k, t in enumerate(tlist):
u[:, n, k] = mat2vec(output.states[k].full()).T
progress_bar.finished()
if len(tlist) == 2:
if unitary_mode == 'batch':
return Qobj(u[-1], dims=dims)
else:
return Qobj(u[:, :, 1], dims=dims)
else:
if unitary_mode == 'batch':
return np.array([Qobj(u[k], dims=dims)
for k in range(len(tlist))], dtype=object)
else:
return np.array([Qobj(u[:, :, k], dims=dims)
for k in range(len(tlist))], dtype=object)
def _get_min_and_index(lst):
"""
Private function for obtaining min and max indicies.
"""
minval, minidx = lst[0], 0
for i, v in enumerate(lst[1:]):
if v < minval:
minval, minidx = v, i + 1
return minval, minidx
def propagator_steadystate(U):
"""Find the steady state for successive applications of the propagator
:math:`U`.
Parameters
----------
U : qobj
Operator representing the propagator.
Returns
-------
a : qobj
Instance representing the steady-state density matrix.
"""
evals, evecs = la.eig(U.full())
shifted_vals = np.abs(evals - 1.0)
ev_idx = np.argmin(shifted_vals)
ev_min = shifted_vals[ev_idx]
evecs = evecs.T
rho = Qobj(vec2mat(evecs[ev_idx]), dims=U.dims[0])
rho = rho * (1.0 / rho.tr())
rho = 0.5 * (rho + rho.dag()) # make sure rho is herm
rho.isherm = True
return rho
def _parallel_sesolve(n, N, H, tlist, args, options):
psi0 = basis(N, n)
output = sesolve(H, psi0, tlist, [], args, options, _safe_mode=False)
return output
def _parallel_mesolve(n, N, H, tlist, c_op_list, args, options):
| col_idx, row_idx = np.unravel_index(n, (N, N))
rho0 = Qobj(sp.csr_matrix(([1], ([row_idx], [col_idx])),
shape=(N,N), dtype=complex))
output = mesolve(H, rho0, tlist, c_op_list, [], args, options,
_safe_mode=False)
return output |
|
formatting.rs | //! Implements parsing IRC formatting characters. Reference:
//! <https://modern.ircdocs.horse/formatting.html>
const CHAR_BOLD: char = '\x02';
const CHAR_ITALIC: char = '\x1D';
const CHAR_UNDERLINE: char = '\x1F';
const CHAR_STRIKETHROUGH: char = '\x1E';
const CHAR_MONOSPACE: char = '\x11';
const CHAR_COLOR: char = '\x03';
const CHAR_HEX_COLOR: char = '\x04';
const CHAR_REVERSE_COLOR: char = '\x16';
const CHAR_RESET: char = '\x0F';
static TAB_STR: &str = " ";
#[derive(Debug, PartialEq, Eq)]
pub enum IrcFormatEvent<'a> {
Text(&'a str),
Bold,
Italic,
Underline,
Strikethrough,
Monospace,
Color {
fg: Color,
bg: Option<Color>,
},
/// Reverse current background and foreground
ReverseColor,
/// Reset formatting to the default
Reset,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Color {
White,
Black,
Blue,
Green,
Red,
Brown,
Magenta,
Orange,
Yellow,
LightGreen,
Cyan,
LightCyan,
LightBlue,
Pink,
Grey,
LightGrey,
Default,
Ansi(u8),
}
impl Color {
fn from_code(code: u8) -> Self {
match code {
0 => Color::White,
1 => Color::Black,
2 => Color::Blue,
3 => Color::Green,
4 => Color::Red,
5 => Color::Brown,
6 => Color::Magenta,
7 => Color::Orange,
8 => Color::Yellow,
9 => Color::LightGreen,
10 => Color::Cyan,
11 => Color::LightCyan,
12 => Color::LightBlue,
13 => Color::Pink,
14 => Color::Grey,
15 => Color::LightGrey,
16 => Color::Ansi(52),
17 => Color::Ansi(94),
18 => Color::Ansi(100),
19 => Color::Ansi(58),
20 => Color::Ansi(22),
21 => Color::Ansi(29),
22 => Color::Ansi(23),
23 => Color::Ansi(24),
24 => Color::Ansi(17),
25 => Color::Ansi(54),
26 => Color::Ansi(53),
27 => Color::Ansi(89),
28 => Color::Ansi(88),
29 => Color::Ansi(130),
30 => Color::Ansi(142),
31 => Color::Ansi(64),
32 => Color::Ansi(28),
33 => Color::Ansi(35),
34 => Color::Ansi(30),
35 => Color::Ansi(25),
36 => Color::Ansi(18),
37 => Color::Ansi(91),
38 => Color::Ansi(90),
39 => Color::Ansi(125),
40 => Color::Ansi(124),
41 => Color::Ansi(166),
42 => Color::Ansi(184),
43 => Color::Ansi(106),
44 => Color::Ansi(34),
45 => Color::Ansi(49),
46 => Color::Ansi(37),
47 => Color::Ansi(33),
48 => Color::Ansi(19),
49 => Color::Ansi(129),
50 => Color::Ansi(127),
51 => Color::Ansi(161),
52 => Color::Ansi(196),
53 => Color::Ansi(208),
54 => Color::Ansi(226),
55 => Color::Ansi(154), | 58 => Color::Ansi(51),
59 => Color::Ansi(75),
60 => Color::Ansi(21),
61 => Color::Ansi(171),
62 => Color::Ansi(201),
63 => Color::Ansi(198),
64 => Color::Ansi(203),
65 => Color::Ansi(215),
66 => Color::Ansi(227),
67 => Color::Ansi(191),
68 => Color::Ansi(83),
69 => Color::Ansi(122),
70 => Color::Ansi(87),
71 => Color::Ansi(111),
72 => Color::Ansi(63),
73 => Color::Ansi(177),
74 => Color::Ansi(207),
75 => Color::Ansi(205),
76 => Color::Ansi(217),
77 => Color::Ansi(223),
78 => Color::Ansi(229),
79 => Color::Ansi(193),
80 => Color::Ansi(157),
81 => Color::Ansi(158),
82 => Color::Ansi(159),
83 => Color::Ansi(153),
84 => Color::Ansi(147),
85 => Color::Ansi(183),
86 => Color::Ansi(219),
87 => Color::Ansi(212),
88 => Color::Ansi(16),
89 => Color::Ansi(233),
90 => Color::Ansi(235),
91 => Color::Ansi(237),
92 => Color::Ansi(239),
93 => Color::Ansi(241),
94 => Color::Ansi(244),
95 => Color::Ansi(247),
96 => Color::Ansi(250),
97 => Color::Ansi(254),
98 => Color::Ansi(231),
_ => Color::Default,
}
}
}
struct FormatEventParser<'a> {
str: &'a str,
/// Current index in `str`. We maintain indices to be able to extract slices from `str`.
cursor: usize,
}
impl<'a> FormatEventParser<'a> {
fn new(str: &'a str) -> Self {
Self { str, cursor: 0 }
}
fn peek(&self) -> Option<char> {
self.str[self.cursor..].chars().next()
}
fn next(&mut self) -> Option<char> {
let next = self.str[self.cursor..].chars().next();
if let Some(char) = next {
self.cursor += char.len_utf8();
}
next
}
fn bump(&mut self, amt: usize) {
self.cursor += amt;
}
fn parse_text(&mut self) -> &'a str {
let cursor = self.cursor;
while let Some(next) = self.next() {
if is_irc_format_char(next) || next.is_ascii_control() {
self.cursor -= 1;
return &self.str[cursor..self.cursor];
}
}
&self.str[cursor..]
}
/// Parse a color code. Expects the color code prefix ('\x03') to be consumed. Does not
/// increment the cursor when result is `None`.
fn parse_color(&mut self) -> Option<(Color, Option<Color>)> {
match self.parse_color_code() {
None => None,
Some(fg) => {
if let Some(char) = self.peek() {
if char == ',' {
let cursor = self.cursor;
self.bump(1); // consume ','
match self.parse_color_code() {
None => {
// comma was not part of the color code, revert the cursor
self.cursor = cursor;
Some((fg, None))
}
Some(bg) => Some((fg, Some(bg))),
}
} else {
Some((fg, None))
}
} else {
Some((fg, None))
}
}
}
}
/// Parses at least one, at most two digits. Does not increment the cursor when result is `None`.
fn parse_color_code(&mut self) -> Option<Color> {
fn to_dec(ch: char) -> Option<u8> {
ch.to_digit(10).map(|c| c as u8)
}
let c1_char = self.peek()?;
let c1_digit = match to_dec(c1_char) {
None => {
return None;
}
Some(c1_digit) => {
self.bump(1); // consume digit
c1_digit
}
};
match self.peek() {
None => Some(Color::from_code(c1_digit)),
Some(c2) => match to_dec(c2) {
None => Some(Color::from_code(c1_digit)),
Some(c2_digit) => {
self.bump(1); // consume digit
Some(Color::from_code(c1_digit * 10 + c2_digit))
}
},
}
}
fn skip_hex_code(&mut self) {
// rrggbb
for _ in 0..6 {
// Use `next` here to avoid incrementing cursor too much
let _ = self.next();
}
}
}
/// Is the character start of an IRC formatting char?
fn is_irc_format_char(c: char) -> bool {
matches!(
c,
CHAR_BOLD
| CHAR_ITALIC
| CHAR_UNDERLINE
| CHAR_STRIKETHROUGH
| CHAR_MONOSPACE
| CHAR_COLOR
| CHAR_HEX_COLOR
| CHAR_REVERSE_COLOR
| CHAR_RESET
)
}
impl<'a> Iterator for FormatEventParser<'a> {
type Item = IrcFormatEvent<'a>;
fn next(&mut self) -> Option<Self::Item> {
loop {
let next = match self.peek() {
None => return None,
Some(next) => next,
};
match next {
CHAR_BOLD => {
self.bump(1);
return Some(IrcFormatEvent::Bold);
}
CHAR_ITALIC => {
self.bump(1);
return Some(IrcFormatEvent::Italic);
}
CHAR_UNDERLINE => {
self.bump(1);
return Some(IrcFormatEvent::Underline);
}
CHAR_STRIKETHROUGH => {
self.bump(1);
return Some(IrcFormatEvent::Strikethrough);
}
CHAR_MONOSPACE => {
self.bump(1);
return Some(IrcFormatEvent::Monospace);
}
CHAR_COLOR => {
self.bump(1);
match self.parse_color() {
Some((fg, bg)) => return Some(IrcFormatEvent::Color { fg, bg }),
None => {
// Just skip the control char
}
}
}
CHAR_HEX_COLOR => {
self.bump(1);
self.skip_hex_code();
}
CHAR_REVERSE_COLOR => {
self.bump(1);
return Some(IrcFormatEvent::ReverseColor);
}
CHAR_RESET => {
self.bump(1);
return Some(IrcFormatEvent::Reset);
}
'\t' => {
self.bump(1);
return Some(IrcFormatEvent::Text(TAB_STR));
}
'\n' | '\r' => {
// RFC 2812 does not allow standalone CR or LF in messages so we're free to
// interpret this however we want.
self.bump(1);
return Some(IrcFormatEvent::Text(" "));
}
other if other.is_ascii_control() => {
// ASCII controls other than tab, CR, and LF are ignored.
self.bump(1);
continue;
}
_other => return Some(IrcFormatEvent::Text(self.parse_text())),
}
}
}
}
pub fn parse_irc_formatting<'a>(s: &'a str) -> impl Iterator<Item = IrcFormatEvent> + 'a {
FormatEventParser::new(s)
}
/// Removes all IRC formatting characters and ASCII control characters.
pub fn remove_irc_control_chars(str: &str) -> String {
let mut s = String::with_capacity(str.len());
for event in parse_irc_formatting(str) {
match event {
IrcFormatEvent::Bold
| IrcFormatEvent::Italic
| IrcFormatEvent::Underline
| IrcFormatEvent::Strikethrough
| IrcFormatEvent::Monospace
| IrcFormatEvent::Color { .. }
| IrcFormatEvent::ReverseColor
| IrcFormatEvent::Reset => {}
IrcFormatEvent::Text(text) => s.push_str(text),
}
}
s
}
#[test]
fn test_translate_irc_control_chars() {
assert_eq!(
remove_irc_control_chars(" Le Voyageur imprudent "),
" Le Voyageur imprudent "
);
assert_eq!(remove_irc_control_chars("\x0301,02foo"), "foo");
assert_eq!(remove_irc_control_chars("\x0301,2foo"), "foo");
assert_eq!(remove_irc_control_chars("\x031,2foo"), "foo");
assert_eq!(remove_irc_control_chars("\x031,foo"), ",foo");
assert_eq!(remove_irc_control_chars("\x03,foo"), ",foo");
}
#[test]
fn test_parse_text_1() {
let s = "just \x02\x1d\x1f\x1e\x11\x04rrggbb\x16\x0f testing";
let mut parser = parse_irc_formatting(s);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("just ")));
assert_eq!(parser.next(), Some(IrcFormatEvent::Bold));
assert_eq!(parser.next(), Some(IrcFormatEvent::Italic));
assert_eq!(parser.next(), Some(IrcFormatEvent::Underline));
assert_eq!(parser.next(), Some(IrcFormatEvent::Strikethrough));
assert_eq!(parser.next(), Some(IrcFormatEvent::Monospace));
assert_eq!(parser.next(), Some(IrcFormatEvent::ReverseColor));
assert_eq!(parser.next(), Some(IrcFormatEvent::Reset));
assert_eq!(parser.next(), Some(IrcFormatEvent::Text(" testing")));
assert_eq!(parser.next(), None);
}
#[test]
fn test_parse_text_2() {
let s = "a\x03";
let mut parser = parse_irc_formatting(s);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("a")));
assert_eq!(parser.next(), None);
}
#[test]
fn test_parse_text_3() {
let s = "a\x03b";
let mut parser = parse_irc_formatting(s);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("a")));
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("b")));
assert_eq!(parser.next(), None);
}
#[test]
fn test_parse_text_4() {
let s = "a\x031,2b";
let mut parser = parse_irc_formatting(s);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("a")));
assert_eq!(
parser.next(),
Some(IrcFormatEvent::Color {
fg: Color::Black,
bg: Some(Color::Blue)
})
);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("b")));
assert_eq!(parser.next(), None);
}
#[test]
fn test_parse_text_5() {
let s = "\x0301,02a";
let mut parser = parse_irc_formatting(s);
assert_eq!(
parser.next(),
Some(IrcFormatEvent::Color {
fg: Color::Black,
bg: Some(Color::Blue),
})
);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("a")));
assert_eq!(parser.next(), None);
let s = "\x0301,2a";
let mut parser = parse_irc_formatting(s);
assert_eq!(
parser.next(),
Some(IrcFormatEvent::Color {
fg: Color::Black,
bg: Some(Color::Blue),
})
);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("a")));
assert_eq!(parser.next(), None);
let s = "\x031,2a";
let mut parser = parse_irc_formatting(s);
assert_eq!(
parser.next(),
Some(IrcFormatEvent::Color {
fg: Color::Black,
bg: Some(Color::Blue),
})
);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text("a")));
assert_eq!(parser.next(), None);
let s = "\x031,a";
let mut parser = parse_irc_formatting(s);
assert_eq!(
parser.next(),
Some(IrcFormatEvent::Color {
fg: Color::Black,
bg: None,
})
);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text(",a")));
assert_eq!(parser.next(), None);
let s = "\x03,a";
let mut parser = parse_irc_formatting(s);
assert_eq!(parser.next(), Some(IrcFormatEvent::Text(",a")));
assert_eq!(parser.next(), None);
}
#[test]
fn test_parse_color() {
let s = "";
let mut parser = FormatEventParser::new(s);
assert_eq!(parser.parse_color(), None);
let s = "a";
let mut parser = FormatEventParser::new(s);
assert_eq!(parser.parse_color(), None);
let s = "1a";
let mut parser = FormatEventParser::new(s);
assert_eq!(parser.parse_color(), Some((Color::Black, None)));
let s = "1,2a";
let mut parser = FormatEventParser::new(s);
assert_eq!(
parser.parse_color(),
Some((Color::Black, Some(Color::Blue)))
);
let s = "01,2a";
let mut parser = FormatEventParser::new(s);
assert_eq!(
parser.parse_color(),
Some((Color::Black, Some(Color::Blue)))
);
let s = "01,02a";
let mut parser = FormatEventParser::new(s);
assert_eq!(
parser.parse_color(),
Some((Color::Black, Some(Color::Blue)))
);
}
#[test]
fn test_newline() {
assert_eq!(remove_irc_control_chars("\na\nb\nc\n"), " a b c ");
assert_eq!(remove_irc_control_chars("\ra\rb\rc\r"), " a b c ");
}
#[test]
fn test_tab() {
assert_eq!(
remove_irc_control_chars("\ta\tb\tc\t"),
" a b c "
);
} | 56 => Color::Ansi(46),
57 => Color::Ansi(86), |
linreg_poly_vs_degree.py | # Plot polynomial regression on 1d problem
# Based on https://github.com/probml/pmtk3/blob/master/demos/linregPolyVsDegree.m
import numpy as np
import matplotlib.pyplot as plt
from pyprobml_utils import save_fig
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import MinMaxScaler
import sklearn.metrics
from sklearn.metrics import mean_squared_error as mse
def | (n=21):
np.random.seed(0)
xtrain = np.linspace(0.0, 20, n)
xtest = np.arange(0.0, 20, 0.1)
sigma2 = 4
w = np.array([-1.5, 1/9.])
fun = lambda x: w[0]*x + w[1]*np.square(x)
ytrain = fun(xtrain) + np.random.normal(0, 1, xtrain.shape) * \
np.sqrt(sigma2)
ytest= fun(xtest) + np.random.normal(0, 1, xtest.shape) * \
np.sqrt(sigma2)
return xtrain, ytrain, xtest, ytest
xtrain, ytrain, xtest, ytest = make_1dregression_data(n=21)
#Rescaling data
scaler = MinMaxScaler(feature_range=(-1, 1))
Xtrain = scaler.fit_transform(xtrain.reshape(-1, 1))
Xtest = scaler.transform(xtest.reshape(-1, 1))
degs = np.arange(1, 21, 1)
ndegs = np.max(degs)
mse_train = np.empty(ndegs)
mse_test = np.empty(ndegs)
ytest_pred_stored = np.empty(ndegs, dtype=np.ndarray)
ytrain_pred_stored = np.empty(ndegs, dtype=np.ndarray)
for deg in degs:
model = LinearRegression()
poly_features = PolynomialFeatures(degree=deg, include_bias=False)
Xtrain_poly = poly_features.fit_transform(Xtrain)
model.fit(Xtrain_poly, ytrain)
ytrain_pred = model.predict(Xtrain_poly)
ytrain_pred_stored[deg-1] = ytrain_pred
Xtest_poly = poly_features.transform(Xtest)
ytest_pred = model.predict(Xtest_poly)
mse_train[deg-1] = mse(ytrain_pred, ytrain)
mse_test[deg-1] = mse(ytest_pred, ytest)
ytest_pred_stored[deg-1] = ytest_pred
# Plot MSE vs degree
fig, ax = plt.subplots()
mask = degs <= 15
ax.plot(degs[mask], mse_test[mask], color = 'r', marker = 'x',label='test')
ax.plot(degs[mask], mse_train[mask], color='b', marker = 's', label='train')
ax.legend(loc='upper right', shadow=True)
plt.xlabel('degree')
plt.ylabel('mse')
save_fig('polyfitVsDegree.pdf')
plt.show()
# Plot fitted functions
chosen_degs = [1, 2, 14, 20]
for deg in chosen_degs:
fig, ax = plt.subplots()
ax.scatter(xtrain, ytrain)
ax.plot(xtest, ytest_pred_stored[deg-1])
ax.set_ylim((-10, 15))
plt.title('degree {}'.format(deg))
save_fig('polyfitDegree{}.pdf'.format(deg))
plt.show()
# Plot residuals
#https://blog.minitab.com/blog/adventures-in-statistics-2/why-you-need-to-check-your-residual-plots-for-regression-analysis
chosen_degs = [1, 2, 14, 20]
for deg in chosen_degs:
fig, ax = plt.subplots()
ypred = ytrain_pred_stored[deg-1]
residuals = ytrain - ypred
ax.plot(ypred, residuals, 'o')
ax.set_xlabel('predicted y')
ax.set_ylabel('residual')
plt.title('degree {}. Predictions on the training set'.format(deg))
save_fig('polyfitDegree{}Residuals.pdf'.format(deg))
plt.show()
# Plot fit vs actual
# https://blog.minitab.com/blog/adventures-in-statistics-2/regression-analysis-how-do-i-interpret-r-squared-and-assess-the-goodness-of-fit
chosen_degs = [1, 2, 14, 20]
for deg in chosen_degs:
for train in [True, False]:
if train:
ytrue = ytrain
ypred = ytrain_pred_stored[deg-1]
dataset = 'Train'
else:
ytrue = ytest
ypred = ytest_pred_stored[deg-1]
dataset = 'Test'
fig, ax = plt.subplots()
ax.scatter(ytrue, ypred)
ax.plot(ax.get_xlim(), ax.get_ylim(), ls="--", c=".3")
ax.set_xlabel('true y')
ax.set_ylabel('predicted y')
r2 = sklearn.metrics.r2_score(ytrue, ypred)
plt.title('degree {}. R2 on {} = {:0.3f}'.format(deg, dataset, r2))
save_fig('polyfitDegree{}FitVsActual{}.pdf'.format(deg, dataset))
plt.show() | make_1dregression_data |
slider.py | import pygame
from pygame.locals import *
from .const import *
from . import widget
from . import table
from . import basic
from . import pguglobals
_SLIDER_HORIZONTAL = 0
_SLIDER_VERTICAL = 1
class _slider(widget.Widget):
_value = None
def __init__(self,value,orient,min,max,size,step=1,**params):
params.setdefault('cls','slider')
widget.Widget.__init__(self,**params)
self.min,self.max,self.value,self.orient,self.size,self.step = min,max,value,orient,size,step
def paint(self,s):
self.value = self.value
r = pygame.rect.Rect(0,0,self.style.width,self.style.height)
if self.orient == _SLIDER_HORIZONTAL:
r.x = (self.value-self.min) * (r.w-self.size) / max(1,self.max-self.min);
r.w = self.size;
else:
r.y = (self.value-self.min) * (r.h-self.size) / max(1,self.max-self.min);
r.h = self.size;
self.bar = r
pguglobals.app.theme.render(s,self.style.bar,r)
def event(self,e):
used = None
r = pygame.rect.Rect(0,0,self.style.width,self.style.height)
adj = 0
if e.type == ENTER: self.repaint()
elif e.type == EXIT: self.repaint()
elif e.type == MOUSEBUTTONDOWN:
if self.bar.collidepoint(e.pos):
self.grab = e.pos[0],e.pos[1]
self.grab_value = self.value
else:
x,y,adj = e.pos[0],e.pos[1],1
self.grab = None
self.repaint()
elif e.type == MOUSEBUTTONUP:
#x,y,adj = e.pos[0],e.pos[1],1
self.repaint()
elif e.type == MOUSEMOTION:
if 1 in e.buttons and self.container.myfocus is self:
if self.grab != None:
rel = e.pos[0]-self.grab[0],e.pos[1]-self.grab[1]
if self.orient == _SLIDER_HORIZONTAL:
d = (r.w - self.size)
if d != 0: self.value = self.grab_value + ((self.max-self.min) * rel[0] / d)
else:
d = (r.h - self.size)
if d != 0: self.value = self.grab_value + ((self.max-self.min) * rel[1] / d)
else:
x,y,adj = e.pos[0],e.pos[1],1
elif e.type is KEYDOWN:
if self.orient == _SLIDER_HORIZONTAL and e.key == K_LEFT:
self.value -= self.step
used = True
elif self.orient == _SLIDER_HORIZONTAL and e.key == K_RIGHT:
self.value += self.step
used = True
elif self.orient == _SLIDER_VERTICAL and e.key == K_UP:
self.value -= self.step
used = True
elif self.orient == _SLIDER_VERTICAL and e.key == K_DOWN:
self.value += self.step
used = True
if adj:
if self.orient == _SLIDER_HORIZONTAL:
d = self.size/2 - (r.w/(self.max-self.min+1))/2
self.value = (x-d) * (self.max-self.min) / (r.w-self.size+1) + self.min
else:
d = self.size/2 - (r.h/(self.max-self.min+1))/2
self.value = (y-d) * (self.max-self.min) / (r.h-self.size+1) + self.min
self.pcls = ""
if self.container.myhover is self: self.pcls = "hover"
if (self.container.myfocus is self and 1 in pygame.mouse.get_pressed()): self.pcls = "down"
return used
# TODO - replace this with property functions and setters
def __setattr__(self,k,v):
if k == 'value':
v = int(v)
v = max(v,self.min)
v = min(v,self.max)
_v = self.__dict__.get(k,NOATTR)
self.__dict__[k]=v
if k == 'value' and _v != NOATTR and _v != v:
self.send(CHANGE)
self.repaint()
if hasattr(self,'size'):
sz = min(self.size,max(self.style.width,self.style.height))
sz = max(sz,min(self.style.width,self.style.height))
self.__dict__['size'] = sz
#self.size = sz
if hasattr(self,'max') and hasattr(self,'min'):
if self.max < self.min: self.max = self.min
# @property
# def value(self):
# return self._value
#
# @value.setter
# def value(self, val):
# val = int(val)
# val = max(val, self.min)
# val = min(val, self.max)
#
# oldval = self._value
# self._value = val
# if (oldval != val):
# self.send(CHANGE)
# self.repaint()
#
# if hasattr(self,'size'):
# sz = min(self.size,max(self.style.width,self.style.height))
# sz = max(sz,min(self.style.width,self.style.height))
# self.size = sz
#
# if hasattr(self,'max') and hasattr(self,'min'):
# if self.max < self.min: self.max = self.min
class VSlider(_slider):
"""A verticle slider."""
def __init__(self,value,min,max,size,step=1,**params):
|
class HSlider(_slider):
"""A horizontal slider."""
def __init__(self,value,min,max,size,step=1,**params):
params.setdefault('cls','hslider')
_slider.__init__(self,value,_SLIDER_HORIZONTAL,min,max,size,step,**params)
class HScrollBar(table.Table):
"""A horizontal scroll bar."""
def __init__(self,value,min,max,size,step=1,**params):
params.setdefault('cls','hscrollbar')
table.Table.__init__(self,**params)
self.slider = _slider(value,_SLIDER_HORIZONTAL,min,max,size,step=step,cls=self.cls+'.slider')
self.minus = basic.Image(self.style.minus)
self.minus.connect(MOUSEBUTTONDOWN,self._click,-1)
self.slider.connect(CHANGE,self.send,CHANGE)
self.minus2 = basic.Image(self.style.minus)
self.minus2.connect(MOUSEBUTTONDOWN,self._click,-1)
self.plus = basic.Image(self.style.plus)
self.plus.connect(MOUSEBUTTONDOWN,self._click,1)
self.size = size
def _click(self,value):
self.slider.value += self.slider.step*value
def resize(self,width=None,height=None):
self.clear()
self.tr()
w = self.style.width
h = self.slider.style.height
ww = 0
if w > (h*2 + self.minus.style.width+self.plus.style.width):
self.td(self.minus)
ww += self.minus.style.width
self.td(self.slider)
if w > (h*2 + self.minus.style.width+self.minus2.style.width+self.plus.style.width):
self.td(self.minus2)
ww += self.minus2.style.width
if w > (h*2 + self.minus.style.width+self.plus.style.width):
self.td(self.plus)
ww += self.plus.style.width
#HACK: handle theme sizing properly
xt,xr,xb,xl = pguglobals.app.theme.getspacing(self.slider)
ww += xr+xl
self.slider.style.width = self.style.width - ww
setattr(self.slider,'size',self.size * self.slider.style.width / max(1,self.style.width))
#self.slider.size = self.size * self.slider.style.width / max(1,self.style.width)
return table.Table.resize(self,width,height)
@property
def min(self):
return self.slider.min
@min.setter
def min(self, value):
self.slider.min = value
@property
def max(self):
return self.slider.max
@max.setter
def max(self, value):
self.slider.max = value
@property
def value(self):
return self.slider.value
@value.setter
def value(self, value):
self.slider.value = value
@property
def step(self):
return self.slider.step
@step.setter
def step(self, value):
self.slider.step = value
# def __setattr__(self,k,v):
# if k in ('min','max','value','step'):
# return setattr(self.slider,k,v)
# self.__dict__[k]=v
# def __getattr__(self,k):
# if k in ('min','max','value','step'):
# return getattr(self.slider,k)
# return table.Table.__getattr__(self,k) #self.__dict__[k]
class VScrollBar(table.Table):
"""A vertical scroll bar."""
def __init__(self,value,min,max,size,step=1,**params):
params.setdefault('cls','vscrollbar')
table.Table.__init__(self,**params)
self.minus = basic.Image(self.style.minus)
self.minus.connect(MOUSEBUTTONDOWN,self._click,-1)
self.minus2 = basic.Image(self.style.minus)
self.minus2.connect(MOUSEBUTTONDOWN,self._click,-1)
self.plus = basic.Image(self.style.plus)
self.plus.connect(MOUSEBUTTONDOWN,self._click,1)
self.slider = _slider(value,_SLIDER_VERTICAL,min,max,size,step=step,cls=self.cls+'.slider')
self.slider.connect(CHANGE,self.send,CHANGE)
self.size = size
def _click(self,value):
self.slider.value += self.slider.step*value
def resize(self,width=None,height=None):
self.clear()
h = self.style.height
w = self.slider.style.width
hh = 0
if h > (w*2 + self.minus.style.height+self.plus.style.height):
self.tr()
self.td(self.minus)
hh += self.minus.style.height
self.tr()
self.td(self.slider)
if h > (w*2 + self.minus.style.height+self.minus2.style.height+self.plus.style.height):
self.tr()
self.td(self.minus2)
hh += self.minus2.style.height
if h > (w*2 + self.minus.style.height+self.plus.style.height):
self.tr()
self.td(self.plus)
hh += self.plus.style.height
#HACK: handle theme sizing properly
xt,xr,xb,xl = pguglobals.app.theme.getspacing(self.slider)
hh += xt+xb
self.slider.style.height = self.style.height - hh
setattr(self.slider,'size',self.size * self.slider.style.height / max(1,self.style.height))
return table.Table.resize(self,width,height)
def __setattr__(self,k,v):
if k in ('min','max','value','step'):
return setattr(self.slider,k,v)
self.__dict__[k]=v
def __getattr__(self,k):
if k in ('min','max','value','step'):
return getattr(self.slider,k)
return table.Table.__getattr__(self,k)
| """Construct a veritcal slider widget.
Arguments:
value -- the default position of the slider, between min and max
min -- the minimum value for the slider
max -- the maximum value
size -- the length of the slider bar in pixels
step -- how much to jump when using the keyboard
"""
params.setdefault('cls','vslider')
_slider.__init__(self,value,_SLIDER_VERTICAL,min,max,size,step,**params) |
deck_test.go | package main
import "testing"
func TestNewDeck(t *testing.T) | {
d := newDeck()
if len(d) != 52 {
t.Errorf("Expected deck length of 52 but got %v", len(d))
}
} |
|
updatePointer.ts | import type { TLPointerInfo } from '@tldraw/core'
import type { Action } from 'state/constants'
import { getPagePoint } from 'state/helpers'
import { mutables } from 'state/mutables' |
export const updatePointer: Action = (data, payload: TLPointerInfo) => {
mutables.previousPoint = [...mutables.currentPoint]
mutables.currentPoint = getPagePoint(payload.point, data.pageState)
} | |
test_property.rs | // Copyright 2019 Tyler Neely
//
// 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.
//
extern crate rocksdb;
mod util;
use rocksdb::{Options, DB};
use util::DBPath;
#[test]
fn property_test() {
let n = DBPath::new("_rust_rocksdb_property_test");
{ | }
}
#[test]
fn property_cf_test() {
let n = DBPath::new("_rust_rocksdb_property_cf_test");
{
let opts = Options::default();
let mut db = DB::open_default(&n).unwrap();
db.create_cf("cf1", &opts).unwrap();
let cf = db.cf_handle("cf1").unwrap();
let value = db.property_value_cf(cf, "rocksdb.stats").unwrap().unwrap();
assert!(value.contains("Stats"));
}
}
#[test]
fn property_int_test() {
let n = DBPath::new("_rust_rocksdb_property_int_test");
{
let db = DB::open_default(&n).unwrap();
let value = db
.property_int_value("rocksdb.estimate-live-data-size")
.unwrap();
assert_eq!(value, Some(0));
}
}
#[test]
fn property_int_cf_test() {
let n = DBPath::new("_rust_rocksdb_property_int_cf_test");
{
let opts = Options::default();
let mut db = DB::open_default(&n).unwrap();
db.create_cf("cf1", &opts).unwrap();
let cf = db.cf_handle("cf1").unwrap();
let total_keys = db
.property_int_value_cf(cf, "rocksdb.estimate-num-keys")
.unwrap();
assert_eq!(total_keys, Some(0));
}
} | let db = DB::open_default(&n).unwrap();
let value = db.property_value("rocksdb.stats").unwrap().unwrap();
assert!(value.contains("Stats")); |
dynamics-form-field-option.model.ts | export class | {
value: number;
label: string;
description: string;
constructor() { }
}
| DynamicsFormFieldOption |
test_flowclassifier.py | # Copyright 2015 Futurewei. All rights reserved.
#
# 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.
import copy
import mock
from neutron.api.v2 import resource as api_res_log
from neutron import manager
from neutron.notifiers import nova as nova_log
from neutron.tests.unit.api.v2 import test_base as test_api_v2
from neutron.tests.unit.extensions import base as test_api_v2_extension
from neutron_lib import constants as const
from oslo_config import cfg
from oslo_utils import uuidutils
from webob import exc
import webtest
from networking_sfc.extensions import flowclassifier as fc_ext
_uuid = uuidutils.generate_uuid
_get_path = test_api_v2._get_path
FLOW_CLASSIFIER_PATH = (fc_ext.FLOW_CLASSIFIER_PREFIX[1:] + '/' +
fc_ext.FLOW_CLASSIFIER_EXT + 's')
class FlowClassifierExtensionTestCase(
test_api_v2_extension.ExtensionTestCase
):
fmt = 'json'
def setUp(self):
self._mock_unnecessary_logging()
super(FlowClassifierExtensionTestCase, self).setUp()
self.setup_extension(
'networking_sfc.extensions.flowclassifier.'
'FlowClassifierPluginBase',
fc_ext.FLOW_CLASSIFIER_EXT,
fc_ext.Flowclassifier,
fc_ext.FLOW_CLASSIFIER_PREFIX[1:],
plural_mappings={}
)
def _mock_unnecessary_logging(self):
mock_log_cfg_p = mock.patch.object(cfg, 'LOG')
self.mock_log_cfg = mock_log_cfg_p.start()
mock_log_manager_p = mock.patch.object(manager, 'LOG')
self.mock_log_manager = mock_log_manager_p.start()
mock_log_nova_p = mock.patch.object(nova_log, 'LOG')
self.mock_log_nova = mock_log_nova_p.start()
mock_log_api_res_log_p = mock.patch.object(api_res_log, 'LOG')
self.mock_log_api_res_log = mock_log_api_res_log_p.start()
def _get_expected_flow_classifier(self, data):
source_port_range_min = data['flow_classifier'].get(
'source_port_range_min')
if source_port_range_min is not None:
source_port_range_min = int(source_port_range_min)
source_port_range_max = data['flow_classifier'].get(
'source_port_range_max')
if source_port_range_max is not None:
source_port_range_max = int(source_port_range_max)
destination_port_range_min = data['flow_classifier'].get(
'destination_port_range_min')
if destination_port_range_min is not None:
destination_port_range_min = int(destination_port_range_min)
destination_port_range_max = data['flow_classifier'].get(
'destination_port_range_max')
if destination_port_range_max is not None:
destination_port_range_max = int(destination_port_range_max)
return {'flow_classifier': {
'name': data['flow_classifier'].get('name') or '',
'description': data['flow_classifier'].get('description') or '',
'tenant_id': data['flow_classifier']['tenant_id'],
'project_id': data['flow_classifier']['project_id'],
'source_port_range_min': source_port_range_min,
'source_port_range_max': source_port_range_max,
'destination_port_range_min': destination_port_range_min,
'destination_port_range_max': destination_port_range_max,
'l7_parameters': data['flow_classifier'].get(
'l7_parameters') or {},
'destination_ip_prefix': data['flow_classifier'].get(
'destination_ip_prefix'),
'source_ip_prefix': data['flow_classifier'].get(
'source_ip_prefix'),
'logical_source_port': data['flow_classifier'].get(
'logical_source_port'),
'logical_destination_port': data['flow_classifier'].get(
'logical_destination_port'),
'ethertype': data['flow_classifier'].get(
'ethertype') or 'IPv4',
'protocol': data['flow_classifier'].get(
'protocol')
}}
def test_create_flow_classifier(self):
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_source_port_range(self):
for source_port_range_min in [None, 100, '100']:
for source_port_range_max in [None, 200, '200']:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'source_port_range_min': source_port_range_min,
'source_port_range_max': source_port_range_max,
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_destination_port_range(self):
for destination_port_range_min in [None, 100, '100']:
for destination_port_range_max in [None, 200, '200']:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'destination_port_range_min': destination_port_range_min,
'destination_port_range_max': destination_port_range_max,
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_source_ip_prefix(self):
for logical_source_ip_prefix in [
None, '10.0.0.0/8'
]:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'source_ip_prefix': logical_source_ip_prefix,
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_destination_ip_prefix(self):
for logical_destination_ip_prefix in [
None, '10.0.0.0/8'
]:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'destination_ip_prefix': logical_destination_ip_prefix,
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(res.status_int, exc.HTTPCreated.code)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_logical_source_port(self):
for logical_source_port in [
None, _uuid()
]:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': logical_source_port,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_logical_destination_port(self):
for logical_destination_port in [
None, _uuid()
]:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_destination_port': logical_destination_port,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_l7_parameters(self):
for l7_parameters in [None, {}]:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
'l7_parameters': l7_parameters
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_ethertype(self):
for ethertype in [None, 'IPv4', 'IPv6']:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
'ethertype': ethertype
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_protocol(self):
for protocol in [
None, const.PROTO_NAME_TCP, const.PROTO_NAME_UDP,
const.PROTO_NAME_ICMP
]:
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
'protocol': protocol
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_all_fields(self):
flowclassifier_id = _uuid()
tenant_id = _uuid()
data = {'flow_classifier': {
'name': 'test1',
'description': 'desc',
'tenant_id': tenant_id, 'project_id': tenant_id,
'source_port_range_min': 100,
'source_port_range_max': 200,
'destination_port_range_min': 100,
'destination_port_range_max': 200,
'l7_parameters': {},
'destination_ip_prefix': '10.0.0.0/8',
'source_ip_prefix': '10.0.0.0/8',
'logical_source_port': _uuid(),
'logical_destination_port': _uuid(),
'ethertype': None,
'protocol': None
}}
expected_data = self._get_expected_flow_classifier(data)
return_value = copy.copy(expected_data['flow_classifier'])
return_value.update({'id': flowclassifier_id})
instance = self.plugin.return_value
instance.create_flow_classifier.return_value = return_value
res = self.api.post(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
instance.create_flow_classifier.assert_called_with(
mock.ANY,
flow_classifier=expected_data)
self.assertEqual(exc.HTTPCreated.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_create_flow_classifier_invalid_l7_parameters(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'l7_parameters': {'abc': 'def'},
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_create_flow_classifier_invalid_protocol(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'protocol': 'unknown',
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_create_flow_classifier_invalid_ethertype(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'ethertype': 'unknown',
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_create_flow_classifier_port_small(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'source_port_range_min': -1,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_create_flow_classifier_port_large(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'source_port_range_min': 65536,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_create_flow_classifier_ip_prefix_no_cidr(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'source_ip_prefix': '10.0.0.0',
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_create_flow_classifier_ip_prefix_invalid_cidr(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'source_ip_prefix': '10.0.0.0/33',
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_create_flow_classifier_port_id_nouuid(self):
tenant_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': 'unknown',
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.post,
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_list(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
return_value = [{
'tenant_id': tenant_id, 'project_id': tenant_id,
'id': flowclassifier_id
}]
instance = self.plugin.return_value
instance.get_flow_classifiers.return_value = return_value
res = self.api.get(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt))
instance.get_flow_classifiers.assert_called_with(
mock.ANY,
fields=mock.ANY,
filters=mock.ANY
)
self.assertEqual(exc.HTTPOk.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifiers', res)
self.assertEqual(return_value, res['flow_classifiers'])
def test_flow_classifier_list_all_fields(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
return_value = [{
'name': 'abc',
'description': 'abc',
'ethertype': 'IPv4',
'protocol': const.PROTO_NAME_TCP,
'source_ip_prefix': '10.0.0.0/8',
'destination_ip_prefix': '10.0.0.0/8',
'source_port_range_min': 100,
'source_port_range_max': 200,
'destination_port_range_min': 100,
'destination_port_range_max': 200,
'logical_source_port': _uuid(),
'logical_destination_port': _uuid(),
'l7_parameters': {},
'tenant_id': tenant_id, 'project_id': tenant_id,
'id': flowclassifier_id
}]
instance = self.plugin.return_value
instance.get_flow_classifiers.return_value = return_value
res = self.api.get(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt))
instance.get_flow_classifiers.assert_called_with(
mock.ANY,
fields=mock.ANY,
filters=mock.ANY
)
self.assertEqual(exc.HTTPOk.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifiers', res)
self.assertEqual(return_value, res['flow_classifiers'])
def test_flow_classifier_list_unknown_fields(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
return_value = [{
'logical_source_port': _uuid(),
'new_key': 'value',
'tenant_id': tenant_id, 'project_id': tenant_id,
'id': flowclassifier_id
}]
expected_return = copy.copy(return_value)
for item in expected_return:
del item['new_key']
instance = self.plugin.return_value
instance.get_flow_classifiers.return_value = return_value
res = self.api.get(
_get_path(FLOW_CLASSIFIER_PATH, fmt=self.fmt))
instance.get_flow_classifiers.assert_called_with(
mock.ANY,
fields=mock.ANY,
filters=mock.ANY
)
self.assertEqual(exc.HTTPOk.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifiers', res)
self.assertEqual(expected_return, res['flow_classifiers'])
def test_flow_classifier_get(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
return_value = {
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
'id': flowclassifier_id
}
instance = self.plugin.return_value
instance.get_flow_classifier.return_value = return_value
res = self.api.get(
_get_path(
FLOW_CLASSIFIER_PATH,
id=flowclassifier_id, fmt=self.fmt
)
)
instance.get_flow_classifier.assert_called_with(
mock.ANY,
flowclassifier_id,
fields=mock.ANY
)
self.assertEqual(exc.HTTPOk.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_flow_classifier_update(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
update_data = {'flow_classifier': {
'name': 'new_name',
'description': 'new_desc',
}}
return_value = {
'tenant_id': tenant_id, 'project_id': tenant_id,
'id': flowclassifier_id
}
instance = self.plugin.return_value
instance.update_flow_classifier.return_value = return_value
res = self.api.put(
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(update_data))
instance.update_flow_classifier.assert_called_with(
mock.ANY, flowclassifier_id,
flow_classifier=update_data)
self.assertEqual(exc.HTTPOk.code, res.status_int)
res = self.deserialize(res)
self.assertIn('flow_classifier', res)
self.assertEqual(return_value, res['flow_classifier'])
def test_flow_classifier_update_source_port_range_min(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'source_port_range_min': 100,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_source_port_range_max(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'source_port_range_max': 100,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_destination_port_range_min(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'destination_port_range_min': 100,
'tenant_id': tenant_id, 'project_id': tenant_id, | webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_destination_port_range_max(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'destination_port_range_max': 100,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_source_ip_prefix(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'source_ip_prefix': '10.0.0.0/8',
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_destination_ip_prefix(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'destination_ip_prefix': '10.0.0.0/8',
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_logical_source_port(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'logical_source_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_logical_destination_port(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'logical_destination_port': _uuid(),
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_ethertype(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'ethertype': None,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_protocol(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'protococol': None,
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_update_l7_parameters(self):
tenant_id = _uuid()
flowclassifier_id = _uuid()
data = {'flow_classifier': {
'l7_parameters': {},
'tenant_id': tenant_id, 'project_id': tenant_id,
}}
self.assertRaises(
webtest.app.AppError,
self.api.put,
_get_path(FLOW_CLASSIFIER_PATH, id=flowclassifier_id,
fmt=self.fmt),
self.serialize(data),
content_type='application/%s' % self.fmt)
def test_flow_classifier_delete(self):
self._test_entity_delete('flow_classifier') | }}
self.assertRaises( |
ingress.go | /*
Copyright 2019 The Knative Authors
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 ingress
import (
"context"
"encoding/json"
"fmt"
"reflect"
"sort"
istiov1alpha3 "istio.io/api/networking/v1alpha3"
"istio.io/client-go/pkg/apis/networking/v1alpha3"
"knative.dev/pkg/logging"
listers "knative.dev/serving/pkg/client/listers/networking/v1alpha1"
"knative.dev/pkg/controller"
pkgreconciler "knative.dev/pkg/reconciler"
"knative.dev/pkg/tracker"
istiolisters "knative.dev/serving/pkg/client/istio/listers/networking/v1alpha3"
"go.uber.org/zap"
"knative.dev/serving/pkg/apis/networking"
"knative.dev/serving/pkg/apis/networking/v1alpha1"
"knative.dev/serving/pkg/network"
"knative.dev/serving/pkg/network/status"
"knative.dev/serving/pkg/reconciler"
"knative.dev/serving/pkg/reconciler/ingress/config"
"knative.dev/serving/pkg/reconciler/ingress/resources"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
apierrs "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/kubernetes"
corev1listers "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
istioclientset "knative.dev/serving/pkg/client/istio/clientset/versioned"
kaccessor "knative.dev/serving/pkg/reconciler/accessor"
coreaccessor "knative.dev/serving/pkg/reconciler/accessor/core"
istioaccessor "knative.dev/serving/pkg/reconciler/accessor/istio"
)
const (
virtualServiceNotReconciled = "ReconcileVirtualServiceFailed"
notReconciledReason = "ReconcileIngressFailed"
notReconciledMessage = "Ingress reconciliation failed"
)
// ingressfinalizer is the name that we put into the resource finalizer list, e.g.
// metadata:
// finalizers:
// - ingresses.networking.internal.knative.dev
var (
ingressResource = v1alpha1.Resource("ingresses")
ingressFinalizer = ingressResource.String()
)
// Reconciler implements the control loop for the Ingress resources.
type Reconciler struct {
*reconciler.Base
istioClientSet istioclientset.Interface
virtualServiceLister istiolisters.VirtualServiceLister
gatewayLister istiolisters.GatewayLister
secretLister corev1listers.SecretLister
ingressLister listers.IngressLister
configStore reconciler.ConfigStore
tracker tracker.Interface
finalizer string
statusManager status.Manager
}
var (
_ controller.Reconciler = (*Reconciler)(nil)
_ coreaccessor.SecretAccessor = (*Reconciler)(nil)
_ istioaccessor.VirtualServiceAccessor = (*Reconciler)(nil)
)
// Reconcile compares the actual state with the desired, and attempts to
// converge the two. It then updates the Status block of the Ingress resource
// with the current status of the resource.
func (r *Reconciler) Reconcile(ctx context.Context, key string) error {
logger := logging.FromContext(ctx)
ctx = r.configStore.ToContext(ctx)
ctx = controller.WithEventRecorder(ctx, r.Recorder)
ns, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
logger.Errorf("invalid resource key: %s", key)
return nil
}
// Get the Ingress resource with this namespace and name.
original, err := r.ingressLister.Ingresses(ns).Get(name)
if apierrs.IsNotFound(err) {
// The resource may no longer exist, in which case we stop processing.
logger.Info("Ingress in work queue no longer exists")
return nil
} else if err != nil {
return err
}
// Don't modify the informers copy
ingress := original.DeepCopy()
// Reconcile this copy of the Ingress and then write back any status
// updates regardless of whether the reconciliation errored out.
reconcileErr := r.reconcileIngress(ctx, ingress)
if reconcileErr != nil {
r.Recorder.Event(ingress, corev1.EventTypeWarning, "InternalError", reconcileErr.Error())
ingress.Status.MarkIngressNotReady(notReconciledReason, notReconciledMessage)
}
if equality.Semantic.DeepEqual(original.Status, ingress.Status) {
// If we didn't change anything then don't call updateStatus.
// This is important because the copy we loaded from the informer's
// cache may be stale and we don't want to overwrite a prior update
// to status with this stale state.
} else {
if err = r.updateStatus(original, ingress); err != nil {
logger.Warnw("Failed to update Ingress status", zap.Error(err))
r.Recorder.Eventf(ingress, corev1.EventTypeWarning, "UpdateFailed",
"Failed to update status for Ingress %q: %v", ingress.GetName(), err)
return err
}
logger.Infof("Updated status for Ingress %q", ingress.GetName())
r.Recorder.Eventf(ingress, corev1.EventTypeNormal, "Updated",
"Updated status for Ingress %q", ingress.GetName())
}
return reconcileErr
}
func (r *Reconciler) reconcileIngress(ctx context.Context, ing *v1alpha1.Ingress) error {
logger := logging.FromContext(ctx)
if ing.GetDeletionTimestamp() != nil {
return r.reconcileDeletion(ctx, ing)
}
// We may be reading a version of the object that was stored at an older version
// and may not have had all of the assumed defaults specified. This won't result
// in this getting written back to the API Server, but lets downstream logic make
// assumptions about defaulting.
ing.SetDefaults(ctx)
ing.Status.InitializeConditions()
logger.Infof("Reconciling ingress: %#v", ing)
gatewayNames := qualifiedGatewayNamesFromContext(ctx)
vses, err := resources.MakeVirtualServices(ing, gatewayNames)
if err != nil {
return err
}
// First, create the VirtualServices.
logger.Infof("Creating/Updating VirtualServices")
ing.Status.ObservedGeneration = ing.GetGeneration()
if err := r.reconcileVirtualServices(ctx, ing, vses); err != nil {
ing.Status.MarkLoadBalancerFailed(virtualServiceNotReconciled, err.Error())
return err
}
if r.shouldReconcileTLS(ing) {
// Add the finalizer before adding `Servers` into Gateway so that we can be sure
// the `Servers` get cleaned up from Gateway.
if err := r.ensureFinalizer(ing); err != nil {
return err
}
originSecrets, err := resources.GetSecrets(ing, r.secretLister)
if err != nil {
return err
}
targetSecrets, err := resources.MakeSecrets(ctx, originSecrets, ing)
if err != nil {
return err
}
if err := r.reconcileCertSecrets(ctx, ing, targetSecrets); err != nil {
return err
}
for _, gw := range config.FromContext(ctx).Istio.IngressGateways {
ns, err := resources.ServiceNamespaceFromURL(gw.ServiceURL)
if err != nil {
return err
}
desired, err := resources.MakeTLSServers(ing, ns, originSecrets)
if err != nil {
return err
}
if err := r.reconcileGateway(ctx, ing, gw, desired); err != nil {
return err
}
}
}
// Update status
ing.Status.MarkNetworkConfigured()
ready, err := r.statusManager.IsReady(ctx, ing)
if err != nil {
return fmt.Errorf("failed to probe Ingress %s/%s: %w", ing.GetNamespace(), ing.GetName(), err)
}
if ready {
lbs := getLBStatus(gatewayServiceURLFromContext(ctx, ing))
publicLbs := getLBStatus(publicGatewayServiceURLFromContext(ctx))
privateLbs := getLBStatus(privateGatewayServiceURLFromContext(ctx))
ing.Status.MarkLoadBalancerReady(lbs, publicLbs, privateLbs)
} else {
ing.Status.MarkLoadBalancerNotReady()
}
// TODO(zhiminx): Mark Route status to indicate that Gateway is configured.
logger.Info("Ingress successfully synced")
return nil
}
func (r *Reconciler) reconcileCertSecrets(ctx context.Context, ing *v1alpha1.Ingress, desiredSecrets []*corev1.Secret) error {
for _, certSecret := range desiredSecrets {
// We track the origin and desired secrets so that desired secrets could be synced accordingly when the origin TLS certificate
// secret is refreshed.
r.tracker.Track(resources.SecretRef(certSecret.Namespace, certSecret.Name), ing)
r.tracker.Track(resources.SecretRef(
certSecret.Labels[networking.OriginSecretNamespaceLabelKey],
certSecret.Labels[networking.OriginSecretNameLabelKey]), ing)
if _, err := coreaccessor.ReconcileSecret(ctx, ing, certSecret, r); err != nil {
if kaccessor.IsNotOwned(err) {
ing.Status.MarkResourceNotOwned("Secret", certSecret.Name)
}
return err
}
}
return nil
}
func (r *Reconciler) reconcileVirtualServices(ctx context.Context, ing *v1alpha1.Ingress,
desired []*v1alpha3.VirtualService) error {
// First, create all needed VirtualServices.
kept := sets.NewString()
for _, d := range desired {
if d.GetAnnotations()[networking.IngressClassAnnotationKey] != network.IstioIngressClassName {
// We do not create resources that do not have istio ingress class annotation.
// As a result, obsoleted resources will be cleaned up.
continue
}
if _, err := istioaccessor.ReconcileVirtualService(ctx, ing, d, r); err != nil {
if kaccessor.IsNotOwned(err) {
ing.Status.MarkResourceNotOwned("VirtualService", d.Name)
}
return err
}
kept.Insert(d.Name)
}
// Now, remove the extra ones.
vses, err := r.virtualServiceLister.VirtualServices(ing.GetNamespace()).List(
labels.SelectorFromSet(labels.Set{networking.IngressLabelKey: ing.GetName()}))
if err != nil {
return fmt.Errorf("failed to get VirtualServices: %w", err)
}
// Sort the virtual services by their name to get a stable deletion order.
sort.Slice(vses, func(i, j int) bool {
return vses[i].Name < vses[j].Name
})
for _, vs := range vses {
n, ns := vs.Name, vs.Namespace
if kept.Has(n) {
continue
}
if !metav1.IsControlledBy(vs, ing) {
// We shouldn't remove resources not controlled by us.
continue
}
if err = r.istioClientSet.NetworkingV1alpha3().VirtualServices(ns).Delete(n, &metav1.DeleteOptions{}); err != nil {
return fmt.Errorf("failed to delete VirtualService: %w", err)
}
}
return nil
}
func (r *Reconciler) reconcileDeletion(ctx context.Context, ing *v1alpha1.Ingress) error {
logger := logging.FromContext(ctx)
// If our finalizer is first, delete the `Servers` from Gateway for this Ingress,
// and remove the finalizer.
if len(ing.GetFinalizers()) == 0 || ing.GetFinalizers()[0] != r.finalizer {
return nil
}
istiocfg := config.FromContext(ctx).Istio
logger.Infof("Cleaning up Gateway Servers for Ingress %s", ing.GetName())
for _, gws := range [][]config.Gateway{istiocfg.IngressGateways, istiocfg.LocalGateways} {
for _, gw := range gws {
if err := r.reconcileGateway(ctx, ing, gw, []*istiov1alpha3.Server{}); err != nil { | }
}
// Update the Ingress to remove the finalizer.
logger.Info("Removing finalizer")
ing.SetFinalizers(ing.GetFinalizers()[1:])
_, err := r.ServingClientSet.NetworkingV1alpha1().Ingresses(ing.GetNamespace()).Update(ing)
return err
}
// Update the Status of the Ingress. Caller is responsible for checking
// for semantic differences before calling.
func (r *Reconciler) updateStatus(existing *v1alpha1.Ingress, desired *v1alpha1.Ingress) error {
existing = existing.DeepCopy()
return pkgreconciler.RetryUpdateConflicts(func(attempts int) (err error) {
// The first iteration tries to use the informer's state, subsequent attempts fetch the latest state via API.
if attempts > 0 {
existing, err = r.ServingClientSet.NetworkingV1alpha1().Ingresses(desired.GetNamespace()).Get(desired.GetName(), metav1.GetOptions{})
if err != nil {
return err
}
}
// If there's nothing to update, just return.
if reflect.DeepEqual(existing.Status, desired.Status) {
return nil
}
existing.Status = desired.Status
_, err = r.ServingClientSet.NetworkingV1alpha1().Ingresses(existing.GetNamespace()).UpdateStatus(existing)
return err
})
}
func (r *Reconciler) ensureFinalizer(ing *v1alpha1.Ingress) error {
finalizers := sets.NewString(ing.GetFinalizers()...)
if finalizers.Has(r.finalizer) {
return nil
}
mergePatch := map[string]interface{}{
"metadata": map[string]interface{}{
"finalizers": append(ing.GetFinalizers(), r.finalizer),
"resourceVersion": ing.GetResourceVersion(),
},
}
patch, err := json.Marshal(mergePatch)
if err != nil {
return err
}
_, err = r.ServingClientSet.NetworkingV1alpha1().Ingresses(ing.GetNamespace()).Patch(ing.GetName(), types.MergePatchType, patch)
return err
}
func (r *Reconciler) reconcileGateway(ctx context.Context, ing *v1alpha1.Ingress, gw config.Gateway, desired []*istiov1alpha3.Server) error {
// TODO(zhiminx): Need to handle the scenario when deleting Ingress. In this scenario,
// the Gateway servers of the Ingress need also be removed from Gateway.
gateway, err := r.gatewayLister.Gateways(gw.Namespace).Get(gw.Name)
if err != nil {
// Unlike VirtualService, a default gateway needs to be existent.
// It should be installed when installing Knative.
return fmt.Errorf("failed to get Gateway: %w", err)
}
existing := resources.GetServers(gateway, ing)
existingHTTPServer := resources.GetHTTPServer(gateway)
if existingHTTPServer != nil {
existing = append(existing, existingHTTPServer)
}
desiredHTTPServer := resources.MakeHTTPServer(config.FromContext(ctx).Network.HTTPProtocol, []string{"*"})
if desiredHTTPServer != nil {
desired = append(desired, desiredHTTPServer)
}
if equality.Semantic.DeepEqual(existing, desired) {
return nil
}
copy := gateway.DeepCopy()
copy = resources.UpdateGateway(copy, desired, existing)
if _, err := r.istioClientSet.NetworkingV1alpha3().Gateways(copy.Namespace).Update(copy); err != nil {
return fmt.Errorf("failed to update Gateway: %w", err)
}
r.Recorder.Eventf(ing, corev1.EventTypeNormal, "Updated", "Updated Gateway %s/%s", gateway.Namespace, gateway.Name)
return nil
}
// GetKubeClient returns the client to access k8s resources.
func (r *Reconciler) GetKubeClient() kubernetes.Interface {
return r.KubeClientSet
}
// GetSecretLister returns the lister for Secret.
func (r *Reconciler) GetSecretLister() corev1listers.SecretLister {
return r.secretLister
}
// GetIstioClient returns the client to access Istio resources.
func (r *Reconciler) GetIstioClient() istioclientset.Interface {
return r.istioClientSet
}
// GetVirtualServiceLister returns the lister for VirtualService.
func (r *Reconciler) GetVirtualServiceLister() istiolisters.VirtualServiceLister {
return r.virtualServiceLister
}
// qualifiedGatewayNamesFromContext get gateway names from context
func qualifiedGatewayNamesFromContext(ctx context.Context) map[v1alpha1.IngressVisibility]sets.String {
publicGateways := sets.NewString()
for _, gw := range config.FromContext(ctx).Istio.IngressGateways {
publicGateways.Insert(gw.QualifiedName())
}
privateGateways := sets.NewString()
for _, gw := range config.FromContext(ctx).Istio.LocalGateways {
privateGateways.Insert(gw.QualifiedName())
}
return map[v1alpha1.IngressVisibility]sets.String{
v1alpha1.IngressVisibilityExternalIP: publicGateways,
v1alpha1.IngressVisibilityClusterLocal: privateGateways,
}
}
// gatewayServiceURLFromContext return an address of a load-balancer
// that the given Ingress is exposed to, or empty string if
// none.
func gatewayServiceURLFromContext(ctx context.Context, ing *v1alpha1.Ingress) string {
if ing.IsPublic() {
return publicGatewayServiceURLFromContext(ctx)
}
return privateGatewayServiceURLFromContext(ctx)
}
func publicGatewayServiceURLFromContext(ctx context.Context) string {
cfg := config.FromContext(ctx).Istio
if len(cfg.IngressGateways) > 0 {
return cfg.IngressGateways[0].ServiceURL
}
return ""
}
func privateGatewayServiceURLFromContext(ctx context.Context) string {
cfg := config.FromContext(ctx).Istio
if len(cfg.LocalGateways) > 0 {
return cfg.LocalGateways[0].ServiceURL
}
return ""
}
// getLBStatus get LB Status
func getLBStatus(gatewayServiceURL string) []v1alpha1.LoadBalancerIngressStatus {
// The Ingress isn't load-balanced by any particular
// Service, but through a Service mesh.
if gatewayServiceURL == "" {
return []v1alpha1.LoadBalancerIngressStatus{
{MeshOnly: true},
}
}
return []v1alpha1.LoadBalancerIngressStatus{
{DomainInternal: gatewayServiceURL},
}
}
func (r *Reconciler) shouldReconcileTLS(ing *v1alpha1.Ingress) bool {
// We should keep reconciling the Ingress whose TLS has been reconciled before
// to make sure deleting IngressTLS will clean up the TLS server in the Gateway.
return (ing.IsPublic() && len(ing.Spec.TLS) > 0) || r.wasTLSReconciled(ing)
}
func (r *Reconciler) wasTLSReconciled(ing *v1alpha1.Ingress) bool {
return len(ing.GetFinalizers()) != 0 && ing.GetFinalizers()[0] == r.finalizer
} | return err
} |
search.rs | use std::collections::HashSet;
use std::fs::{self, File};
use std::io::prelude::*;
use std::path::Path;
use cargo_test_support::cargo_process;
use cargo_test_support::git::repo;
use cargo_test_support::paths;
use cargo_test_support::registry::{api_path, registry_path, registry_url};
use url::Url;
fn api() -> Url {
Url::from_file_path(&*api_path()).ok().unwrap()
}
fn write_crates(dest: &Path) {
let content = r#"{
"crates": [{
"created_at": "2014-11-16T20:17:35Z",
"description": "Design by contract style assertions for Rust",
"documentation": null,
"downloads": 2,
"homepage": null,
"id": "hoare",
"keywords": [],
"license": null,
"links": {
"owners": "/api/v1/crates/hoare/owners",
"reverse_dependencies": "/api/v1/crates/hoare/reverse_dependencies",
"version_downloads": "/api/v1/crates/hoare/downloads",
"versions": "/api/v1/crates/hoare/versions"
},
"max_version": "0.1.1",
"name": "hoare",
"repository": "https://github.com/nick29581/libhoare",
"updated_at": "2014-11-20T21:49:21Z",
"versions": null
}],
"meta": {
"total": 1
}
}"#;
// Older versions of curl don't peel off query parameters when looking for
// filenames, so just make both files.
//
// On windows, though, `?` is an invalid character, but we always build curl
// from source there anyway!
File::create(&dest)
.unwrap()
.write_all(content.as_bytes())
.unwrap();
if !cfg!(windows) {
File::create(&dest.with_file_name("crates?q=postgres&per_page=10"))
.unwrap()
.write_all(content.as_bytes())
.unwrap();
}
}
fn setup() {
let cargo_home = paths::root().join(".cargo");
fs::create_dir_all(cargo_home).unwrap();
fs::create_dir_all(&api_path().join("api/v1")).unwrap();
// Init a new registry
let _ = repo(®istry_path())
.file(
"config.json",
&format!(r#"{{"dl":"{0}","api":"{0}"}}"#, api()),
)
.build();
let base = api_path().join("api/v1/crates");
write_crates(&base);
}
fn set_cargo_config() {
let config = paths::root().join(".cargo/config");
File::create(&config)
.unwrap()
.write_all(
format!(
r#"
[source.crates-io]
registry = 'https://wut'
replace-with = 'dummy-registry'
[source.dummy-registry]
registry = '{reg}'
"#,
reg = registry_url(),
)
.as_bytes(),
)
.unwrap();
}
#[cargo_test]
fn not_update() {
setup();
set_cargo_config();
use cargo::core::{Shell, Source, SourceId};
use cargo::sources::RegistrySource;
use cargo::util::Config;
let sid = SourceId::for_registry(®istry_url()).unwrap();
let cfg = Config::new(
Shell::from_write(Box::new(Vec::new())),
paths::root(),
paths::home().join(".cargo"),
);
let lock = cfg.acquire_package_cache_lock().unwrap();
let mut regsrc = RegistrySource::remote(sid, &HashSet::new(), &cfg);
regsrc.update().unwrap();
drop(lock);
cargo_process("search postgres")
.with_stdout_contains("hoare = \"0.1.1\" # Design by contract style assertions for Rust")
.with_stderr("") // without "Updating ... index"
.run();
}
#[cargo_test]
fn replace_default() {
setup();
set_cargo_config();
cargo_process("search postgres")
.with_stdout_contains("hoare = \"0.1.1\" # Design by contract style assertions for Rust")
.with_stderr_contains("[..]Updating [..] index")
.run();
}
#[cargo_test]
fn simple() {
setup();
cargo_process("search postgres --index")
.arg(registry_url().to_string())
.with_stdout_contains("hoare = \"0.1.1\" # Design by contract style assertions for Rust")
.run();
}
// TODO: Deprecated
// remove once it has been decided '--host' can be safely removed
#[cargo_test]
fn simple_with_host() {
setup();
cargo_process("search postgres --host")
.arg(registry_url().to_string())
.with_stderr(
"\
[WARNING] The flag '--host' is no longer valid.
Previous versions of Cargo accepted this flag, but it is being
deprecated. The flag is being renamed to 'index', as the flag
wants the location of the index. Please use '--index' instead.
This will soon become a hard error, so it's either recommended
to update to a fixed version or contact the upstream maintainer
about this warning.
[UPDATING] `[CWD]/registry` index
",
)
.with_stdout_contains("hoare = \"0.1.1\" # Design by contract style assertions for Rust")
.run();
}
// TODO: Deprecated
// remove once it has been decided '--host' can be safely removed
#[cargo_test]
fn simple_with_index_and_host() {
setup();
cargo_process("search postgres --index")
.arg(registry_url().to_string())
.arg("--host")
.arg(registry_url().to_string())
.with_stderr(
"\
[WARNING] The flag '--host' is no longer valid.
Previous versions of Cargo accepted this flag, but it is being
deprecated. The flag is being renamed to 'index', as the flag
wants the location of the index. Please use '--index' instead.
This will soon become a hard error, so it's either recommended
to update to a fixed version or contact the upstream maintainer
about this warning.
[UPDATING] `[CWD]/registry` index
",
)
.with_stdout_contains("hoare = \"0.1.1\" # Design by contract style assertions for Rust")
.run();
}
#[cargo_test]
fn multiple_query_params() {
setup();
cargo_process("search postgres sql --index")
.arg(registry_url().to_string())
.with_stdout_contains("hoare = \"0.1.1\" # Design by contract style assertions for Rust")
.run();
}
#[cargo_test]
fn | () {
cargo_process("search -h").run();
cargo_process("help search").run();
// Ensure that help output goes to stdout, not stderr.
cargo_process("search --help").with_stderr("").run();
cargo_process("search --help")
.with_stdout_contains("[..] --frozen [..]")
.run();
}
| help |
__init__.py | # Copyright (C) 2019 NTT DATA
# All Rights Reserved.
#
# 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.
"""
Request Body validating middleware.
"""
| from tacker.api.validation import validators
from tacker.common import exceptions
def schema(request_body_schema):
"""Register a schema to validate request body.
Registered schema will be used for validating request body just before
API method executing.
:param dict request_body_schema: a schema to validate request body
"""
def add_validator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
schema_validator = validators._SchemaValidator(
request_body_schema)
try:
schema_validator.validate(kwargs['body'])
except KeyError:
raise webob.exc.HTTPBadRequest(
explanation=_("Malformed request body"))
return func(*args, **kwargs)
return wrapper
return add_validator
def query_schema(query_params_schema):
"""Register a schema to validate request query parameters.
Registered schema will be used for validating request query params just
before API method executing.
:param query_params_schema: A dict, the JSON-Schema for validating the
query parameters.
"""
def add_validator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
# NOTE(tpatil): The second argument of the method
# calling this method should always be 'request'.
if 'request' in kwargs:
req = kwargs['request']
else:
req = args[1]
try:
req.GET.dict_of_lists()
except UnicodeDecodeError:
msg = _('Query string is not UTF-8 encoded')
raise exceptions.ValidationError(msg)
query_opts = {}
query_opts.update(req.GET)
schema_validator = validators._SchemaValidator(
query_params_schema)
schema_validator.validate(query_opts)
return func(*args, **kwargs)
return wrapper
return add_validator | import functools
import webob
|
settings.py | """
Django settings for cfehome project.
Generated by 'django-admin startproject' using Django 2.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'em-9$ln6^a0z!s2pbo=mu*l$cgnqgsyd_z21f-%2d(_h7*wu^0'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'channels',
'chat',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'cfehome.urls'
ASGI_APPLICATION = "cfehome.routing.application"
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'cfehome.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
| AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_URL = '/static/'
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("localhost", 6379)],
# For heroku
# "hosts": [os.environ.get('REDIS_URL', 'redis://localhost:6379')],
},
},
} | |
timer.py | import timeit
class timer(object):
def __init__(self, repeats=3, loops=1, gc=False):
self.repeats = repeats
self.loops = loops | def __enter__(self):
return self
def __exit__(self, type, value, traceback):
if type is not None:
return False
else:
return True
def results(self):
return self.func()
def time(self, func, *args, **kargs):
if self.gc is True:
self.gbcol="gc.enable()"
else:
self.gbcol="gc.disable()"
self.funcname = func.__name__
pfunc = lambda: func(*args, **kargs)
self.elapsed = timeit.repeat(pfunc, self.gbcol, repeat=self.repeats, number=self.loops)
self.runtime = min(self.elapsed)
return [self.runtime, self.funcname]
def printTime(self):
result = "%s finished in %.5fs (%s loops, repeated %s times): %.5fs per loop (with %s)" % (self.funcname, self.runtime, self.loops, self.repeats, self.runtime/self.loops, self.gbcol)
print result | self.gc = gc
|
test_redis.py | from mock import call
from nose.tools import istest
from provy.more.debian import AptitudeRole, RedisRole
from tests.unit.tools.helpers import ProvyTestCase
class RedisRoleTest(ProvyTestCase):
def setUp(self):
super(RedisRoleTest, self).setUp()
self.role = RedisRole(prov=None, context={})
@istest
def | (self):
with self.using_stub(AptitudeRole) as mock_aptitude:
self.role.provision()
install_calls = mock_aptitude.ensure_package_installed.mock_calls
self.assertEqual(install_calls, [call('redis-server'), call('python-redis')])
| installs_necessary_packages_to_provision |
gelf_decoder.rs | use super::Decoder;
use crate::flowgger::config::Config;
use crate::flowgger::record::{Record, SDValue, StructuredData, SEVERITY_MAX};
use crate::flowgger::utils;
use serde_json::de;
use serde_json::error::Error::Syntax;
use serde_json::error::ErrorCode;
use serde_json::value::Value;
#[derive(Clone)]
pub struct GelfDecoder;
impl GelfDecoder {
/// The GELF decoder doesn't support any configuration, the config is passed as an argument
/// just to respect the interface https://docs.graylog.org/en/3.1/pages/gelf.html
pub fn new(_config: &Config) -> GelfDecoder {
GelfDecoder
}
}
impl Decoder for GelfDecoder {
/// Implements decode from a GELF formated text line to a Record object
/// https://docs.graylog.org/en/3.1/pages/gelf.html
///
/// # Parameters
/// - `line`: A string slice containing a JSON with valid GELF data
///
/// # Returns
/// A `Result` that contain:
///
/// - `Ok`: A record containing all the line parsed as a Record data struct
/// - `Err`: if there was any error parsing the line, that could be missing values, bad json or wrong
/// types associated with specific fields
fn decode(&self, line: &str) -> Result<Record, &'static str> {
let mut sd = StructuredData::new(None);
let mut ts = None;
let mut hostname = None;
let mut msg = None;
let mut full_msg = None;
let mut severity = None;
let obj = match de::from_str(line) {
x @ Ok(_) => x,
Err(Syntax(ErrorCode::InvalidUnicodeCodePoint, ..)) => {
de::from_str(&line.replace('\n', r"\n"))
}
x => x,
};
let obj: Value = obj.or(Err("Invalid GELF input, unable to parse as a JSON object"))?;
let obj = obj.as_object().ok_or("Empty GELF input")?;
for (key, value) in obj {
match key.as_ref() {
"timestamp" => ts = Some(value.as_f64().ok_or("Invalid GELF timestamp")?),
"host" => {
hostname = Some(
value
.as_str()
.ok_or("GELF host name must be a string")?
.to_owned(),
)
}
"short_message" => {
msg = Some(
value
.as_str()
.ok_or("GELF short message must be a string")?
.to_owned(),
)
}
"full_message" => {
full_msg = Some(
value
.as_str()
.ok_or("GELF full message must be a string")?
.to_owned(),
)
}
"version" => match value.as_str().ok_or("GELF version must be a string")? {
"1.0" | "1.1" => {}
_ => return Err("Unsupported GELF version"),
},
"level" => {
let severity_given = value.as_u64().ok_or("Invalid severity level")?;
if severity_given > u64::from(SEVERITY_MAX) {
return Err("Invalid severity level (too high)");
}
severity = Some(severity_given as u8)
}
name => {
let sd_value: SDValue = match *value {
Value::String(ref value) => SDValue::String(value.to_owned()),
Value::Bool(value) => SDValue::Bool(value),
Value::F64(value) => SDValue::F64(value),
Value::I64(value) => SDValue::I64(value),
Value::U64(value) => SDValue::U64(value),
Value::Null => SDValue::Null,
_ => return Err("Invalid value type in structured data"),
};
let name = if name.starts_with('_') {
name.to_owned()
} else | ;
sd.pairs.push((name, sd_value));
}
}
}
let record = Record {
ts: ts.unwrap_or_else(|| utils::PreciseTimestamp::now().as_f64()),
hostname: hostname.ok_or("Missing hostname")?,
facility: None,
severity,
appname: None,
procid: None,
msgid: None,
sd: if sd.pairs.is_empty() { None } else { Some(sd) },
msg,
full_msg,
};
Ok(record)
}
}
#[cfg(test)]
mod test {
use super::*;
use crate::flowgger::record::SEVERITY_MAX;
#[test]
fn test_gelf_decoder() {
let msg = r#"{"version":"1.1", "host": "example.org","short_message": "A short message that helps you identify what is going on", "full_message": "Backtrace here\n\nmore stuff", "timestamp": 1385053862.3072, "level": 1, "_user_id": 9001, "_some_info": "foo", "_some_env_var": "bar"}"#;
let res = GelfDecoder.decode(msg).unwrap();
assert!(res.ts == 1_385_053_862.307_2);
assert!(res.hostname == "example.org");
assert!(res.msg.unwrap() == "A short message that helps you identify what is going on");
assert!(res.full_msg.unwrap() == "Backtrace here\n\nmore stuff");
assert!(res.severity.unwrap() == 1);
let sd = res.sd.unwrap();
let pairs = sd.pairs;
assert!(pairs
.iter()
.cloned()
.any(|(k, v)| if let SDValue::U64(v) = v {
k == "_user_id" && v == 9001
} else {
false
}));
assert!(pairs
.iter()
.cloned()
.any(|(k, v)| if let SDValue::String(v) = v {
k == "_some_info" && v == "foo"
} else {
false
}));
assert!(pairs
.iter()
.cloned()
.any(|(k, v)| if let SDValue::String(v) = v {
k == "_some_env_var" && v == "bar"
} else {
false
}));
}
#[test]
#[should_panic(expected = "Invalid value type in structured data")]
fn test_gelf_decoder_bad_key() {
let msg = r#"{"some_key": []}"#;
let _res = GelfDecoder.decode(&msg).unwrap();
}
#[test]
#[should_panic(expected = "Invalid GELF timestamp")]
fn test_gelf_decoder_bad_timestamp() {
let msg = r#"{"timestamp": "a string not a timestamp", "host": "anhostname"}"#;
let _res = GelfDecoder.decode(&msg).unwrap();
}
#[test]
#[should_panic(expected = "Invalid GELF input, unable to parse as a JSON object")]
fn test_gelf_decoder_invalid_input() {
let _res = GelfDecoder.decode("{some_key = \"some_value\"}").unwrap();
}
#[test]
#[should_panic(expected = "Unsupported GELF version")]
fn test_gelf_decoder_wrong_version() {
let msg = r#"{"version":"42"}"#;
let _res = GelfDecoder.decode(msg).unwrap();
}
#[test]
#[should_panic(expected = "Invalid severity level (too high)")]
fn test_gelf_decoder_severity_to_high() {
let _res = GelfDecoder
.decode(format!("{{\"level\": {}}}", SEVERITY_MAX + 1).as_str())
.unwrap();
}
}
| {
format!("_{}", name)
} |
lib.rs | //! A platform agnostic driver to interface with the I3G4250D (gyroscope)
//!
//! This driver was built using [`embedded-hal`] traits.
//!
//! [`embedded-hal`]: https://docs.rs/embedded-hal/0.2
//!
//! # Examples
//!
//! You should find at least one example in the [f3] crate.
//!
//! [f3]: https://docs.rs/f3/0.6
#![deny(missing_docs)]
#![deny(warnings)]
#![no_std]
use embedded_hal::blocking::spi::{Transfer, Write};
use embedded_hal::digital::v2::OutputPin;
use embedded_hal::spi::{Mode};
/// SPI mode
pub const MODE: Mode = embedded_hal::spi::MODE_3;
/// I3G4250D driver
pub struct I3G4250D<SPI, CS> {
spi: SPI,
cs: CS,
}
impl<SPI, CS, E> I3G4250D<SPI, CS>
where
SPI: Transfer<u8, Error = E> + Write<u8, Error = E>,
CS: OutputPin,
{
/// Creates a new driver from a SPI peripheral and a NCS pin
pub fn new(spi: SPI, cs: CS) -> Result<Self, E> {
let mut i3g4259d = I3G4250D { spi, cs };
// power up and enable all the axes
i3g4259d.write_register(Register::CTRL_REG1, 0b00_00_1_111)?;
Ok(i3g4259d)
}
/// Temperature measurement + gyroscope measurements
pub fn all(&mut self) -> Result<Measurements, E> {
let mut bytes = [0u8; 9];
self.read_many(Register::OUT_TEMP, &mut bytes)?;
Ok(Measurements {
gyro: I16x3 {
x: (bytes[3] as u16 + ((bytes[4] as u16) << 8)) as i16,
y: (bytes[5] as u16 + ((bytes[6] as u16) << 8)) as i16,
z: (bytes[7] as u16 + ((bytes[8] as u16) << 8)) as i16,
},
temp: bytes[1] as i8,
})
}
/// Gyroscope measurements
pub fn gyro(&mut self) -> Result<I16x3, E> {
let mut bytes = [0u8; 7];
self.read_many(Register::OUT_X_L, &mut bytes)?;
Ok(I16x3 {
x: (bytes[1] as u16 + ((bytes[2] as u16) << 8)) as i16,
y: (bytes[3] as u16 + ((bytes[4] as u16) << 8)) as i16,
z: (bytes[5] as u16 + ((bytes[6] as u16) << 8)) as i16,
})
}
/// Temperature sensor measurement
pub fn temp(&mut self) -> Result<i8, E> {
Ok(self.read_register(Register::OUT_TEMP)? as i8)
}
/// Reads the WHO_AM_I register; should return `0xD4`
pub fn who_am_i(&mut self) -> Result<u8, E> {
self.read_register(Register::WHO_AM_I)
}
/// Read `STATUS_REG` of sensor
pub fn status(&mut self) -> Result<Status, E> {
let sts = self.read_register(Register::STATUS_REG)?;
Ok(Status::from_u8(sts))
}
/// Get the current Output Data Rate
pub fn odr(&mut self) -> Result<Odr, E> {
// Read control register
let reg1 = self.read_register(Register::CTRL_REG1)?;
Ok(Odr::from_u8(reg1))
}
/// Set the Output Data Rate
pub fn set_odr(&mut self, odr: Odr) -> Result<&mut Self, E> {
self.change_config(Register::CTRL_REG1, odr)
}
/// Get current Bandwidth
pub fn bandwidth(&mut self) -> Result<Bandwidth, E> {
let reg1 = self.read_register(Register::CTRL_REG1)?;
Ok(Bandwidth::from_u8(reg1))
}
/// Set low-pass cut-off frequency (i.e. bandwidth)
///
/// See `Bandwidth` for further explanation
pub fn set_bandwidth(&mut self, bw: Bandwidth) -> Result<&mut Self, E> {
self.change_config(Register::CTRL_REG1, bw)
}
/// Get the current Full Scale Selection
///
/// This is the sensitivity of the sensor, see `Scale` for more information
pub fn scale(&mut self) -> Result<Scale, E> {
let scl = self.read_register(Register::CTRL_REG4)?;
Ok(Scale::from_u8(scl))
}
/// Set the Full Scale Selection
///
/// This sets the sensitivity of the sensor, see `Scale` for more
/// information
pub fn set_scale(&mut self, scale: Scale) -> Result<&mut Self, E> {
self.change_config(Register::CTRL_REG4, scale)
}
fn read_register(&mut self, reg: Register) -> Result<u8, E> {
let _ = self.cs.set_low();
let mut buffer = [reg.addr() | SINGLE | READ, 0];
self.spi.transfer(&mut buffer)?;
let _ = self.cs.set_high();
Ok(buffer[1])
}
/// Read multiple bytes starting from the `start_reg` register.
/// This function will attempt to fill the provided buffer.
fn read_many(&mut self,
start_reg: Register,
buffer: &mut [u8])
-> Result<(), E> {
let _ = self.cs.set_low();
buffer[0] = start_reg.addr() | MULTI | READ ;
self.spi.transfer(buffer)?;
let _ = self.cs.set_high();
Ok(())
}
fn write_register(&mut self, reg: Register, byte: u8) -> Result<(), E> {
let _ = self.cs.set_low();
let buffer = [reg.addr() | SINGLE | WRITE, byte];
self.spi.write(&buffer)?;
let _ = self.cs.set_high();
Ok(())
}
/// Change configuration in register
///
/// Helper function to update a particular part of a register without
/// affecting other parts of the register that might contain desired
/// configuration. This allows the `I3G4250D` struct to be used like
/// a builder interface when configuring specific parameters.
fn change_config<B: BitValue>(&mut self, reg: Register, bits: B) -> Result<&mut Self, E> {
// Create bit mask from width and shift of value
let mask = B::mask() << B::shift();
// Extract the value as u8
let bits = (bits.value() << B::shift()) & mask;
// Read current value of register
let current = self.read_register(reg)?;
// Use supplied mask so we don't affect more than necessary
let masked = current & !mask;
// Use `or` to apply the new value without affecting other parts
let new_reg = masked | bits;
self.write_register(reg, new_reg)?;
Ok(self)
}
}
/// Trait to represent a value that can be sent to sensor
trait BitValue {
/// The width of the bitfield in bits
fn width() -> u8;
/// The bit 'mask' of the value
fn mask() -> u8 {
(1 << Self::width()) - 1
}
/// The number of bits to shift the mask by
fn shift() -> u8;
/// Convert the type to a byte value to be sent to sensor
///
/// # Note
/// This value should not be bit shifted.
fn value(&self) -> u8;
}
#[allow(dead_code)]
#[allow(non_camel_case_types)]
#[derive(Clone, Copy)]
enum Register {
WHO_AM_I = 0x0F,
CTRL_REG1 = 0x20,
CTRL_REG2 = 0x21,
CTRL_REG3 = 0x22,
CTRL_REG4 = 0x23,
CTRL_REG5 = 0x24,
REFERENCE = 0x25,
OUT_TEMP = 0x26,
STATUS_REG = 0x27,
OUT_X_L = 0x28,
OUT_X_H = 0x29,
OUT_Y_L = 0x2A,
OUT_Y_H = 0x2B,
OUT_Z_L = 0x2C,
OUT_Z_H = 0x2D,
FIFO_CTRL_REG = 0x2E,
FIFO_SRC_REG = 0x2F,
INT1_CFG = 0x30,
INT1_SRC = 0x31,
INT1_TSH_XH = 0x32,
INT1_TSH_XL = 0x33,
INT1_TSH_YH = 0x34,
INT1_TSH_YL = 0x35,
INT1_TSH_ZH = 0x36,
INT1_TSH_ZL = 0x37,
INT1_DURATION = 0x38,
}
/// Output Data Rate
#[derive(Debug, Clone, Copy)]
pub enum Odr {
/// 100 Hz data rate
Hz100 = 0x00,
/// 200 Hz data rate
Hz200 = 0x01,
/// 400 Hz data rate
Hz400 = 0x02,
/// 800 Hz data rate
Hz800 = 0x03,
}
impl BitValue for Odr {
fn width() -> u8 {
2
}
fn shift() -> u8 {
6
}
fn value(&self) -> u8 {
*self as u8
}
}
impl Odr {
fn from_u8(from: u8) -> Self {
// Extract ODR value, converting to enum (ROI: 0b1100_0000)
match (from >> Odr::shift()) & Odr::mask() {
x if x == Odr::Hz100 as u8 => Odr::Hz100,
x if x == Odr::Hz200 as u8 => Odr::Hz200,
x if x == Odr::Hz400 as u8 => Odr::Hz400,
x if x == Odr::Hz800 as u8 => Odr::Hz800,
_ => unreachable!(),
}
}
}
/// Full scale selection
#[derive(Debug, Clone, Copy)]
pub enum Scale {
/// 245 Degrees Per Second
Dps245 = 0x00,
/// 500 Degrees Per Second
Dps500 = 0x01,
/// 2000 Degrees Per Second
Dps2000 = 0x03,
}
impl BitValue for Scale {
fn width() -> u8 {
2
}
fn shift() -> u8 {
4
}
fn value(&self) -> u8 {
*self as u8
}
}
impl Scale {
fn from_u8(from: u8) -> Self {
// Extract scale value from register, ensure that we mask with
// `0b0000_0011` to extract `FS1-FS2` part of register
match (from >> Scale::shift()) & Scale::mask() {
x if x == Scale::Dps245 as u8 => Scale::Dps245,
x if x == Scale::Dps500 as u8 => Scale::Dps500,
x if x == Scale::Dps2000 as u8 => Scale::Dps2000,
// Special case for Dps2000
0x02 => Scale::Dps2000,
_ => unreachable!(),
}
}
}
/// Bandwidth of sensor
///
/// The bandwidth of the sensor is equal to the cut-off for the low-pass
/// filter. The cut-off depends on the `Odr` of the sensor, for specific
/// information consult the data sheet.
#[derive(Debug, Clone, Copy)]
pub enum Bandwidth {
/// Lowest possible cut-off for any `Odr` configuration
Low = 0x00,
/// Medium cut-off, can be the same as `High` for some `Odr` configurations
Medium = 0x01,
/// High cut-off
High = 0x02,
/// Maximum cut-off for any `Odr` configuration
Maximum = 0x03,
}
impl BitValue for Bandwidth {
fn width() -> u8 {
2
}
fn shift() -> u8 {
4
}
fn value(&self) -> u8 {
*self as u8
}
}
impl Bandwidth {
fn from_u8(from: u8) -> Self {
// Shift and mask bandwidth of register, (ROI: 0b0011_0000)
match (from >> Bandwidth::shift()) & Bandwidth::mask() {
x if x == Bandwidth::Low as u8 => Bandwidth::Low,
x if x == Bandwidth::Medium as u8 => Bandwidth::Medium,
x if x == Bandwidth::High as u8 => Bandwidth::High,
x if x == Bandwidth::Maximum as u8 => Bandwidth::Maximum,
_ => unreachable!(),
}
}
}
const READ: u8 = 1 << 7;
const WRITE: u8 = 0 << 7;
const MULTI: u8 = 1 << 6;
const SINGLE: u8 = 0 << 6;
impl Register {
fn addr(self) -> u8 {
self as u8
}
}
impl Scale {
/// Convert a measurement to degrees
pub fn degrees(&self, val: i16) -> f32 {
match *self {
Scale::Dps245 => val as f32 * 0.00875,
Scale::Dps500 => val as f32 * 0.0175,
Scale::Dps2000 => val as f32 * 0.07,
}
}
/// Convert a measurement to radians
pub fn radians(&self, val: i16) -> f32 {
// TODO: Use `to_radians` or other built in method
// NOTE: `to_radians` is only exported in `std` (07.02.18)
self.degrees(val) * (core::f32::consts::PI / 180.0)
}
}
/// XYZ triple
#[derive(Debug)]
pub struct I16x3 {
/// X component
pub x: i16,
/// Y component
pub y: i16,
/// Z component
pub z: i16,
}
/// Several measurements
#[derive(Debug)]
pub struct Measurements {
/// Gyroscope measurements
pub gyro: I16x3, | /// Temperature sensor measurement
pub temp: i8,
}
/// Sensor status
#[derive(Debug, Clone, Copy)]
pub struct Status {
/// Overrun (data has overwritten previously unread data)
/// has occurred on at least one axis
pub overrun: bool,
/// Overrun occurred on Z-axis
pub z_overrun: bool,
/// Overrun occurred on Y-axis
pub y_overrun: bool,
/// Overrun occurred on X-axis
pub x_overrun: bool,
/// New data is available for either X, Y, Z - axis
pub new_data: bool,
/// New data is available on Z-axis
pub z_new: bool,
/// New data is available on Y-axis
pub y_new: bool,
/// New data is available on X-axis
pub x_new: bool,
}
impl Status {
fn from_u8(from: u8) -> Self {
Status {
overrun: (from & 1 << 7) != 0,
z_overrun: (from & 1 << 6) != 0,
y_overrun: (from & 1 << 5) != 0,
x_overrun: (from & 1 << 4) != 0,
new_data: (from & 1 << 3) != 0,
z_new: (from & 1 << 2) != 0,
y_new: (from & 1 << 1) != 0,
x_new: (from & 1 << 0) != 0,
}
}
} | |
params.rs | use crate::config::{err, ok, Client, Response};
use crate::error::Error;
use serde::de::DeserializeOwned;
use serde_derive::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Clone, Default)]
pub struct Headers {
pub stripe_account: Option<String>,
pub client_id: Option<String>,
}
pub trait Identifiable {
fn id(&self) -> &str;
}
#[derive(Debug, Deserialize, Serialize)]
pub struct List<T> {
pub data: Vec<T>,
pub has_more: bool,
pub total_count: Option<u64>,
pub url: String,
}
impl<T: Clone> Clone for List<T> {
fn clone(&self) -> Self {
List {
data: self.data.clone(),
has_more: self.has_more,
total_count: self.total_count,
url: self.url.clone(),
}
}
}
impl<T: DeserializeOwned + Send + 'static> List<T> {
/// Prefer `List::next` when possible
pub fn get_next(client: &Client, url: &str, last_id: &str) -> Response<List<T>> {
if url.starts_with("/v1/") {
// TODO: Maybe parse the URL? Perhaps `List` should always parse its `url` field.
let mut url = url.trim_start_matches("/v1/").to_string();
if url.contains('?') {
url.push_str(&format!("&starting_after={}", last_id));
} else {
url.push_str(&format!("?starting_after={}", last_id));
}
client.get(&url)
} else {
err(Error::Unsupported("URL for fetching additional data uses different API version"))
}
}
}
impl<T: Identifiable + DeserializeOwned + Send + 'static> List<T> {
/// Repeatedly queries Stripe for more data until all elements in list are fetched, using
/// Stripe's default page size.
///
/// Not supported by `stripe::async::Client`.
#[cfg(not(feature = "async"))]
pub fn get_all(self, client: &Client) -> Response<Vec<T>> {
let mut data = Vec::new();
let mut next = self;
loop {
if next.has_more {
let resp = next.next(&client)?;
data.extend(next.data);
next = resp;
} else {
data.extend(next.data);
break;
}
} | pub fn next(&self, client: &Client) -> Response<List<T>> {
if let Some(last_id) = self.data.last().map(|d| d.id()) {
List::get_next(client, &self.url, last_id)
} else {
ok(List {
data: Vec::new(),
has_more: false,
total_count: self.total_count,
url: self.url.clone(),
})
}
}
}
pub type Metadata = HashMap<String, String>;
pub type Timestamp = i64;
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub struct RangeBounds<T> {
pub gt: Option<T>,
pub gte: Option<T>,
pub lt: Option<T>,
pub lte: Option<T>,
}
impl<T> Default for RangeBounds<T> {
fn default() -> Self {
RangeBounds { gt: None, gte: None, lt: None, lte: None }
}
}
/// A set of generic request parameters that can be used on
/// list endpoints to filter their results by some timestamp.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum RangeQuery<T> {
Exact(T),
Bounds(RangeBounds<T>),
}
impl<T> RangeQuery<T> {
/// Filter results to exactly match a given value
pub fn eq(value: T) -> RangeQuery<T> {
RangeQuery::Exact(value)
}
/// Filter results to be after a given value
pub fn gt(value: T) -> RangeQuery<T> {
let mut bounds = RangeBounds::default();
bounds.gt = Some(value);
RangeQuery::Bounds(bounds)
}
/// Filter results to be after or equal to a given value
pub fn gte(value: T) -> RangeQuery<T> {
let mut bounds = RangeBounds::default();
bounds.gte = Some(value);
RangeQuery::Bounds(bounds)
}
/// Filter results to be before to a given value
pub fn lt(value: T) -> RangeQuery<T> {
let mut bounds = RangeBounds::default();
bounds.gt = Some(value);
RangeQuery::Bounds(bounds)
}
/// Filter results to be before or equal to a given value
pub fn lte(value: T) -> RangeQuery<T> {
let mut bounds = RangeBounds::default();
bounds.gte = Some(value);
RangeQuery::Bounds(bounds)
}
}
// NOTE: Only intended to handle conversion from ASCII CamelCase to SnakeCase
// This function is used to convert static Rust identifiers to snakecase
// TODO: pub(crate) fn
pub fn to_snakecase(camel: &str) -> String {
let mut i = 0;
let mut snake = String::new();
let mut chars = camel.chars().peekable();
while let Some(ch) = chars.next() {
if ch.is_uppercase() {
if i > 0 && !chars.peek().unwrap_or(&'A').is_uppercase() {
snake.push('_');
}
snake.push(ch.to_lowercase().next().unwrap_or(ch));
} else {
snake.push(ch);
}
i += 1;
}
snake
}
#[cfg(test)]
mod tests {
#[test]
fn to_snakecase() {
use super::to_snakecase;
assert_eq!(to_snakecase("snake_case").as_str(), "snake_case");
assert_eq!(to_snakecase("CamelCase").as_str(), "camel_case");
assert_eq!(to_snakecase("XMLHttpRequest").as_str(), "xml_http_request");
assert_eq!(to_snakecase("UPPER").as_str(), "upper");
assert_eq!(to_snakecase("lower").as_str(), "lower");
}
} | Ok(data)
}
/// Fetch additional page of data from stripe |
rabbitmq.go | package storage
import (
"fmt"
"github.com/joaosoft/logger"
"github.com/joaosoft/manager"
)
type StorageRabbitmq struct {
conn manager.IRabbitmqProducer |
func NewStorageRabbitmq(connection manager.IRabbitmqProducer, logger logger.ILogger) *StorageRabbitmq {
return &StorageRabbitmq{
conn: connection,
logger: logger,
}
}
func (storage *StorageRabbitmq) Upload(path string, file []byte) (string, error) {
storage.logger.Infof("uploading file %s", path)
routingKey := fmt.Sprintf("upload.file")
storage.conn.Publish(routingKey, file, true)
return path, nil
}
func (storage *StorageRabbitmq) Download(path string) ([]byte, error) {
storage.logger.Infof("downloading file with id upload %s", path)
return nil, nil
} | logger logger.ILogger
} |
executive_step_06.py | #!/usr/bin/env python3
"""
Description:
Usage:
$> roslaunch turtle_nodes.launch
$> ./executive_step_06.py
Output:
[INFO] : State machine starting in initial state 'RESET' with userdata:
[INFO] : State machine transitioning 'RESET':'succeeded'-->'SPAWN'
[INFO] : State machine transitioning 'SPAWN':'succeeded'-->'TELEPORT1'
[INFO] : State machine transitioning 'TELEPORT1':'succeeded'-->'TELEPORT2'
[INFO] : State machine transitioning 'TELEPORT2':'succeeded'-->'DRAW_SHAPES'
[INFO] : Concurrence starting with userdata:
[]
[INFO] : State machine starting in initial state 'DRAW_WITH_MONITOR' with userdata:
[]
[INFO] : Concurrence starting with userdata:
[]
[WARN] : Still waiting for action server 'turtle_shape1' to start... is it running?
[WARN] : Still waiting for action server 'turtle_shape2' to start... is it running?
[INFO] : Connected to action server 'turtle_shape2'. | edges: 6
radius: 0.5
[INFO] : Concurrent Outcomes: {'MONITOR': 'invalid', 'DRAW': 'preempted'}
[INFO] : State machine transitioning 'DRAW_WITH_MONITOR':'interrupted'-->'WAIT_FOR_CLEAR'
[INFO] : State machine transitioning 'WAIT_FOR_CLEAR':'invalid'-->'DRAW_WITH_MONITOR'
[INFO] : Concurrence starting with userdata:
[]
[INFO] : Concurrent Outcomes: {'MONITOR': 'preempted', 'DRAW': 'succeeded'}
[INFO] : State machine terminating 'DRAW_WITH_MONITOR':'succeeded':'succeeded'
[INFO] : Concurrent Outcomes: {'SMALL': 'succeeded', 'BIG': 'succeeded'}
[INFO] : State machine terminating 'DRAW_SHAPES':'succeeded':'succeeded'
"""
import rospy
import threading
from math import sqrt, pow
import smach
from smach import StateMachine, ServiceState, SimpleActionState, MonitorState, IntrospectionServer, Concurrence
import std_srvs.srv
import turtlesim.srv
import turtlesim.msg
import turtle_actionlib.msg
def main():
rospy.init_node('smach_usecase_step_06')
# Construct static goals
polygon_big = turtle_actionlib.msg.ShapeGoal(edges = 11, radius = 4.0)
polygon_small = turtle_actionlib.msg.ShapeGoal(edges = 6, radius = 0.5)
# Create a SMACH state machine
sm0 = StateMachine(outcomes=['succeeded','aborted','preempted'])
# Open the container
with sm0:
# Reset turtlesim
StateMachine.add('RESET',
ServiceState('reset', std_srvs.srv.Empty),
{'succeeded':'SPAWN'})
# Create a second turtle
StateMachine.add('SPAWN',
ServiceState('spawn', turtlesim.srv.Spawn,
request = turtlesim.srv.SpawnRequest(0.0,0.0,0.0,'turtle2')),
{'succeeded':'TELEPORT1'})
# Teleport turtle 1
StateMachine.add('TELEPORT1',
ServiceState('turtle1/teleport_absolute', turtlesim.srv.TeleportAbsolute,
request = turtlesim.srv.TeleportAbsoluteRequest(5.0,1.0,0.0)),
{'succeeded':'TELEPORT2'})
# Teleport turtle 2
StateMachine.add('TELEPORT2',
ServiceState('turtle2/teleport_absolute', turtlesim.srv.TeleportAbsolute,
request = turtlesim.srv.TeleportAbsoluteRequest(9.0,5.0,0.0)),
{'succeeded':'DRAW_SHAPES'})
# Draw some polygons
shapes_cc = Concurrence(
outcomes=['succeeded','aborted','preempted'],
default_outcome='aborted',
outcome_map = {'succeeded':{'BIG':'succeeded','SMALL':'succeeded'}})
StateMachine.add('DRAW_SHAPES',shapes_cc)
with shapes_cc:
# Draw a large polygon with the first turtle
Concurrence.add('BIG',
SimpleActionState('turtle_shape1',turtle_actionlib.msg.ShapeAction,
goal = polygon_big))
# Draw a small polygon with the second turtle
draw_monitor_cc = Concurrence(
['succeeded','aborted','preempted'],
'aborted',
child_termination_cb = lambda so: True,
outcome_map = {
'succeeded':{'DRAW':'succeeded'},
'preempted':{'DRAW':'preempted','MONITOR':'preempted'},
'aborted':{'MONITOR':'invalid'}})
Concurrence.add('SMALL',draw_monitor_cc)
with draw_monitor_cc:
Concurrence.add('DRAW',
SimpleActionState('turtle_shape2',turtle_actionlib.msg.ShapeAction,
goal = polygon_small))
def turtle_far_away(ud, msg):
"""Returns True while turtle pose in msg is at least 1 unit away from (9,5)"""
if sqrt(pow(msg.x-9.0,2) + pow(msg.y-5.0,2)) > 2.0:
return True
return False
Concurrence.add('MONITOR',
MonitorState('/turtle1/pose',turtlesim.msg.Pose,
cond_cb = turtle_far_away))
# Attach a SMACH introspection server
sis = IntrospectionServer('smach_usecase_01', sm0, '/USE_CASE')
sis.start()
# Set preempt handler
smach.set_preempt_handler(sm0)
# Execute SMACH tree in a separate thread so that we can ctrl-c the script
smach_thread = threading.Thread(target = sm0.execute)
smach_thread.start()
# Signal handler
rospy.spin()
if __name__ == '__main__':
main() | [INFO] : Connected to action server 'turtle_shape1'.
[INFO] : Preempt requested on action 'turtle_shape2'
[INFO] : Preempt on action 'turtle_shape2' cancelling goal: |
requests.rs | use super::*;
pub(crate) fn extract_requests_from_openapi(openapi: &OpenAPI) -> Vec<Request> {
let mut requests = Vec::new();
// IndexMap<String, ReferenceOr<PathItem>>
for (path, data) in openapi.paths.clone() {
// https://docs.rs/openapiv3/0.3.0/openapiv3/struct.PathItem.html
for request in extract_request_from_openapi(path, data) {
requests.push(request);
}
}
requests
}
fn extract_request_from_openapi(path: String, data: ReferenceOr<PathItem>) -> Vec<Request> {
let mut requests = Vec::new();
if let ReferenceOr::Item(data) = data {
data.get.map(|operation| {
requests.push(openapi_operation_to_request(
path.clone(),
Method::Get,
operation,
))
});
data.put.map(|operation| {
requests.push(openapi_operation_to_request(
path.clone(),
Method::Put,
operation,
))
});
data.post.map(|operation| {
requests.push(openapi_operation_to_request(
path.clone(),
Method::Post,
operation,
))
});
};
requests
}
fn openapi_operation_to_request(path: String, method: Method, operation: Operation) -> Request {
// https://docs.rs/openapiv3/0.3.0/openapiv3/struct.Operation.html
Request {
name: operation.operation_id.unwrap_or("".to_string()),
path,
params: extract_params_from_openapi(operation.parameters)
.into_iter()
.map(|v| Box::new(v))
.collect(),
method,
response_type: extract_response_type_from_openapi(operation.responses),
error_type: None,
}
}
fn | (responses: Responses) -> Option<Box<VariableType>> {
if let Some(response) = responses.default {
if let ReferenceOr::Item(response) = response {
for (name, content) in response.content {
if let Some(reference) = content.schema {
if let ReferenceOr::Reference{ reference } = reference {
if let Some(complex_type) = reference.split("/").last() {
return Some(Box::new(
VariableType::ComplexType(complex_type.into())
));
} else {
return variable_type_from_string("String"); // FIX
}
}
}
}
}
};
None
}
fn variable_type_from_string(t: &str) -> Option<Box<VariableType>> {
None
}
fn extract_params_from_openapi(parameters: Vec<ReferenceOr<Parameter>>) -> Vec<Variable> {
let mut variables = Vec::new();
for parameter in parameters {
if let ReferenceOr::Item(parameter) = parameter {
match parameter {
Parameter::Query { parameter_data, .. } => variables.push(Variable {
name: parameter_data.name,
optional: parameter_data.required,
value: None,
variable_type: VariableType::StringType,
}),
Parameter::Path { parameter_data, .. } => variables.push(Variable {
name: parameter_data.name,
optional: parameter_data.required,
value: None,
variable_type: VariableType::StringType,
}),
_ => (),
}
}
}
variables
}
| extract_response_type_from_openapi |
operators.js | function Scope(name)
{
if (Scope.prototype.newScopeId === undefined)
{
var scopeId = 0, self = Scope.prototype;
self.newScopeId = function() {
return scopeId++;
}
self.toString = function() {
return "Scope{" + this.name + "(" + this.id + ")}";
}
}
if (!(this instanceof Scope))
return new Scope(name);
this.name = name;
this.id = this.newScopeId();
}
const
scpValue = Scope('Value'), scpOperator = Scope('Operator'), scpFlower = Scope('Flower'), scpInline = Scope('Inline'),
scpQuest = Scope('Quest'), scpBracket = Scope('Bracket'), scpArray = Scope('Array');
function Operator(str, rank, operand, name, fnModifier, fnCalc) {
if (Operator.prototype.modifyStacks == undefined)
{
var scopeId = 0, self = Operator.prototype;
self.newExpr = function() {
return OperatorExpr(this);
};
self.toString = function() {
return 'op' + this.name + '{"' + this.op + '" '+ this.operand + '}';
}
}
if (!(this instanceof Operator))
return new Operator(str, rank, operand, name, fnModifier, fnCalc);
this.op = str;
this.name = name;
this.rank = rank;
this.operand = operand;
this.stackModifier = fnModifier;
this.calc = fnCalc; //function(args, symbols) {};
}
const
fnModifiers = {
gaurd: function (curOp, stackExpr, stackScope)
{ // #GAURD
stackExpr.push(curOp)
stackScope.curScope = scpOperator;
return true;
},
unary: function (curOp, stackExpr, stackScope)
{ // + - ~ !
var stkOp = stackExpr.cur();
stkOp.push(curOp);
stackExpr.push(curOp);
stackScope.curScope = scpOperator;
return true;
},
binary: function (curOp, stackExpr, stackScope)
{ // ** * / % \ + - & | ^ == != > >= > >= && ||
var stkOp = stackExpr.cur(), crank = curOp.op.rank;
while (crank <= stkOp.op.rank)
{
stackExpr.pop();
stkOp = stackExpr.cur();
}
stkOp.changeCurrentParameter(curOp);
stackExpr.push(curOp);
stackScope.curScope = scpOperator;
return true;
},
comma: function (curOp, stackExpr, stackScope)
{ // ,
var scp = stackScope.cur();
if (scp != scpArray && scp != scpBracket)
throw 'Comma "," not in any open bracket range.';
var stkOp = stackExpr.cur(), crank = curOp.op.rank;
while (stkOp.op.rank !== crank )
{
stackExpr.pop();
stkOp = stackExpr.cur();
}
var curOp = stkOp.op;
if ( curOp.op !== '[' && curOp !== operators.OpenFunction )
throw 'Invalid position of ",".';
stackScope.curScope = scpOperator;
return true;
},
quest: function (curOp, stackExpr, stackScope)
{ // ?
var stkOp = stackExpr.cur(), crank = curOp.op.rank;
while (crank < stkOp.op.rank)
{
stackExpr.pop();
stkOp = stackExpr.cur();
}
stkOp.changeCurrentParameter(curOp);
stackExpr.push(curOp);
stackScope.push(scpQuest);
stackScope.curScope = scpOperator;
return true;
},
colon: function (curOp, stackExpr, stackScope)
{ // :
var scp = stackScope.cur();
if (scp !== scpQuest)
throw 'Colon ":" not in a question "?" expression.';
var stkOp = stackExpr.cur();
while (stkOp.op !== operators._Quest)
{
stackExpr.pop();
stkOp = stackExpr.cur();
}
stkOp.op = operators.Quest;
stackScope.pop();
stackScope.curScope = scpOperator;
return true;
},
assign: function (curOp, stackExpr, stackScope)
{ // =
var stkOp = stackExpr.cur(), crank = curOp.op.rank;
while (crank < stkOp.op.rank)
{
stackExpr.pop();
stkOp = stackExpr.cur();
}
stkOp.changeCurrentParameter(curOp);
stackExpr.push(curOp);
stackScope.curScope = scpOperator;
stackExpr.containAssign = true;
return true;
},
},
operators = {
// key = name
// str, rank, operand, name, fnModifier, fnCalc
'Positive': Operator( '+', 45, 1, 'Positive', fnModifiers.unary, function(args, sbt) { return args[0].calc(sbt); } ),
'Negative': Operator( '-', 45, 1, 'Negative', fnModifiers.unary, function(args, sbt) { return CalcLib.negate(args[0].calc(sbt)); } ),
'BitNot': Operator( '~', 43, 1, 'BitNot', fnModifiers.unary, function(args, sbt) { return CalcLib.bitNot(args[0].calc(sbt)); } ),
'LgcNot': Operator( '!', 41, 1, 'LgcNot', fnModifiers.unary, function(args, sbt) { return CalcLib.logicNot(args[0].calc(sbt)); } ),
'OpenBracket': Operator( '(', 1, 1, 'OpenBracket', null, function(args, sbt) { return args[0].calc(sbt); } ),
'OpenArray': Operator( '[', 1, -1, 'OpenArray', null, function(args, sbt) { return CalcLib.arrayValue(args, sbt); } ),
'_OpenFunction': Operator( '(', 81, -1, '_OpenFunction', null, null /* not real op holder */ ),
'_OpenDerefArray': Operator( '[', 81, -1, '_OpenDerefArray', null, null /* not real op holder */ ),
'Property': Operator( '.', 81, 2, 'Property', fnModifiers.binary, function(args, sbt) { return CalcLib.property(args[0], args[1], sbt); } ),
'Power': Operator( '**', 47, 2, 'Power', fnModifiers.binary, function(args, sbt) { return CalcLib.power(args[0].calc(sbt), args[1].calc(sbt)); } ),
'Root': Operator( '*/', 47, 2, 'Root', fnModifiers.binary, function(args, sbt) { return CalcLib.nroot(args[0].calc(sbt), args[1].calc(sbt)); } ),
'Times': Operator( '*', 46, 2, 'Times', fnModifiers.binary, function(args, sbt) { return CalcLib.multiply(args[0].calc(sbt), args[1].calc(sbt)); } ),
'Divide': Operator( '/', 46, 2, 'Divide', fnModifiers.binary, function(args, sbt) { return CalcLib.divide(args[0].calc(sbt), args[1].calc(sbt)); } ),
'Modulo': Operator( '%', 46, 2, 'Modulo', fnModifiers.binary, function(args, sbt) { return CalcLib.modulo(args[0].calc(sbt), args[1].calc(sbt)); } ),
'IntDivide': Operator( '//', 46, 2, 'IntDivide', fnModifiers.binary, function(args, sbt) { return CalcLib.intDivide(args[0].calc(sbt), args[1].calc(sbt)); } ),
'Plus': Operator( '+', 45, 2, 'Plus', fnModifiers.binary, function(args, sbt) { return CalcLib.add(args[0].calc(sbt), args[1].calc(sbt)); } ),
'Minus': Operator( '-', 45, 2, 'Minus', fnModifiers.binary, function(args, sbt) { return CalcLib.sub(args[0].calc(sbt), args[1].calc(sbt)); } ),
'BitAnd': Operator( '&', 43, 2, 'BitAnd', fnModifiers.binary, function(args, sbt) { return CalcLib.bitAnd(args[0].calc(sbt), args[1].calc(sbt)); } ),
'BitOr': Operator( '|', 43, 2, 'BitOr', fnModifiers.binary, function(args, sbt) { return CalcLib.bitOr(args[0].calc(sbt), args[1].calc(sbt)); } ),
'BitXor': Operator( '^', 43, 2, 'BitXor', fnModifiers.binary, function(args, sbt) { return CalcLib.bitXor(args[0].calc(sbt), args[1].calc(sbt)); } ),
'CmpEqual': Operator( '==', 42, 2, 'CmpEqual', fnModifiers.binary, function(args, sbt) { return CalcLib.isEqual(args[0].calc(sbt), args[1].calc(sbt)); } ),
'CmpNotEqual': Operator( '!=', 42, 2, 'CmpNotEqual', fnModifiers.binary, function(args, sbt) { return CalcLib.notEqual(args[0].calc(sbt), args[1].calc(sbt)); } ),
'CmpGreater': Operator( '>', 42, 2, 'CmpGreater', fnModifiers.binary, function(args, sbt) { return CalcLib.isGreater(args[0].calc(sbt), args[1].calc(sbt)); } ),
'CmpGreaterEqual': Operator( '>=', 42, 2, 'CmpGreaterEqual', fnModifiers.binary, function(args, sbt) { return CalcLib.isGreaterEqual(args[0].calc(sbt), args[1].calc(sbt)); } ),
'CmpLess': Operator( '<', 42, 2, 'CmpLess', fnModifiers.binary, function(args, sbt) { return CalcLib.isLess(args[0].calc(sbt), args[1].calc(sbt)); } ),
'CmpLessEqual': Operator( '<=', 42, 2, 'CmpLessEqual', fnModifiers.binary, function(args, sbt) { return CalcLib.isLessEqual(args[0].calc(sbt), args[1].calc(sbt)); } ),
'LgcAnd': Operator( '&&', 41, 2, 'LgcAnd', fnModifiers.binary, function(args, sbt) { return CalcLib.logicAnd(args[0], args[1], sbt); } ),
'LgcOr': Operator( '||', 41, 2, 'LgcOr', fnModifiers.binary, function(args, sbt) { return CalcLib.logicOr(args[0], args[1], sbt); } ),
'_Quest': Operator( '?', 30, 3, '_Quest', fnModifiers.quest, null /* not real op holder */ ),
'Colon': Operator( ':', 30, 0, 'Colon', fnModifiers.colon, null ),
'Unit': Operator( '@', 20, 2, 'Unit', fnModifiers.binary, function(args, sbt) { return CalcLib.setUnit(args[0], args[1], sbt); } ),
'Assign': Operator( '=', 10, 2, 'Assign', fnModifiers.assign, function(args, sbt) { return CalcLib.assign(args[0], args[1].calc(sbt), sbt); } ),
'CloseBracket': Operator( ')', 1, 0, 'CloseBracket', null, null ),
'CloseArray': Operator( ']', 1, 0, 'CloseArray', null, null ),
'Comma': Operator( ',', 1, 0, 'Comma', fnModifiers.comma, null ), | 'OpenDerefArray': Operator( '[', 1, -1, 'OpenDerefArray', null, CalcLib.derefArray ),
// 'Call': Operator( ':', 30, -1, 'Call', null, CalcLib.callFunction ),
}
// ,
;
/*
todo:
@
*/
(function () {
function getUnaryOpenerModifier(scp) { // [ (
return function (curOp, stackExpr, stackScope)
{ // ( [ Bracket Array
var stkOp = stackExpr.cur();
stkOp.push(curOp);
stackExpr.push(curOp);
stackScope.push(scp);
stackScope.curScope = scpOperator;
return true;
};
}
function getBiaryOpenerModifier(scp, realOp) { // [ (
return function (curOp, stackExpr, stackScope)
{ // ( [ Function Dereference
var stkOp = stackExpr.cur(), crank = curOp.op.rank;
while (crank <= stkOp.op.rank)
{
stackExpr.pop();
stkOp = stackExpr.cur();
}
curOp.op = realOp;
stkOp.changeCurrentParameter(curOp);
stackExpr.push(curOp);
stackScope.push(scp);
stackScope.curScope = scpOperator;
return true;
};
}
function getCloserModifier(scp, opstr) { // ] )
return function (curOp, stackExpr, stackScope)
{ // ) ]
if (stackScope.cur() != scp)
throw 'Not matched close bracket ")" or "]"';
var stkOp = stackExpr.cur();
while (stkOp.op.op != opstr)
{
stackExpr.pop();
stkOp = stackExpr.cur();
}
stackExpr.pop();
stackScope.pop();
stackScope.curScope = scpValue;
return true;
};
}
operators.OpenBracket.stackModifier = getUnaryOpenerModifier(scpBracket);
operators.OpenArray.stackModifier = getUnaryOpenerModifier(scpArray);
operators._OpenFunction.stackModifier = getBiaryOpenerModifier(scpBracket, operators.OpenFunction);
operators._OpenDerefArray.stackModifier = getUnaryOpenerModifier(scpArray, operators.OpenDerefArray);
operators.CloseBracket.stackModifier = getCloserModifier(scpBracket, '(');
operators.CloseArray.stackModifier = getCloserModifier(scpBracket, '[');
})(); |
'$GAURD': Operator( '#', -1, 1, '$GAURD', fnModifiers.gaurd, null ),
'Quest': Operator( '?', 30, 3, 'Quest', null, function(args, sbt) { return CalcLib.quest(args[0].calc(sbt), args[1], args[2], sbt); }),
'OpenFunction': Operator( '(', 1, -1, 'OpenFunction', null, CalcLib.callFunction ), |
Engines.py | ## @package Engines
# The superior method to solving complex problems is by easily consumable and scalable design, not complex code.
#
# The engines package consists of virtual classes and methods that define the structure of the engine modules.
#
# New modules are installed simply by dropping a compliant engine module in the Engines package directory.
#
# The virtual classes and methods are what defines compliance with the engine. One could simply build these out
# manually without using these but this is highly discouraged unless you really know what you're doing, so long as
# you're okay with future changes in the engine breaking the functionality of the module you are developing.
#
# Your code scanner is probably going to whine because I deviate from PEP8. That's mostly because the PEP8 is
# worthless bullshit and its evangelical adherents are mostly just eating each others' regurgitations instead of
# thinking.
from abc import ABCMeta
from abc import abstractmethod
import configparser
import requests
## SessionSpec
#
# The SessionSpec class is the core of the module. This contains the structure of the class you must implement,
# prepackaged for you. Exceptions will be thrown as required until you have implemented all the necessary minimum
# pieces in the structure required to be used by a multiplexor, which is not required to utilize a module but forces
# continuity between modules when all modules use it. You are strongly advised not to build a module that does not
# use the base classes defined here if you wish to contribute.
#
# This file also serves as an excellent atomic, academic example of abstract method usage and OOP inheritance in Python.
class SessionSpec:
__metaclass__ = ABCMeta
## Sessionspec.__init__
#
# The initialization method for SessionSpec. It is recommended that you inherit from SessionSpec for your Session
# class and then call the parent initialization method, and then implement your own module-specific calls in your
# Session init. This allows commonalities between modules to be implemented here while also allowing modules to
# have their own, which will be a necessity as you'll notice while you're building.
def __init__( self, config ):
# bind the configuration to the Session object
self.config = config
# handle to use for getting new pages with the Session object
self.client = requests.Session()
# But wait -- there's more!
# Throwing in rudimentary proxy support:
if self.config.proxy_enabled:
proxies = { 'http', self.config.proxy }
self.client.proxies.update( proxies )
## SessionSpec.SessionError
#
# The SessionError subclass defines the Generic exception to be the Session class you are implementing.
#
# In the example modules, we use this for just about everything, but a better practice would be to use it as a base
# class for every TYPE of exception you wish to handle to make your engines more robust in error handling.
class SessionError( Exception ):
def __init__( self, value ):
self.value = value
## SessionSpec.login
#
# The method used to log in to the site your engine module supports. Self-explanatory.
#
# Note: When implementing in your module, do NOT return a boolean or use any other indicator of success. Instead,
# use SessionSpec.Parser.is_logged_in as a conditional in your logic flow for individual actions. This prevents
# your contributors from relying on stateful information in a stateless manner.
@abstractmethod
def login( self ):
pass
## SessionSpec.Config
#
# While the config file can be universal between engines so long as good naming conventions are used by the module
# implementations, each SessionSpec child class will want to import the whole config file and bind to local values
# that the module will want to implement. Here we have some operations related to that which will be common to all
# modules, providing a common set of values that I'd like the modules to have.
#
# You'll want to call the parent class's initialization and expand upon it for module-specific features.
class Config:
|
## SessionSpec.User
#
# The User class must be implemented by the module and must be implemented by all modules, as different sites
# give users different attributes that the module will be interested in.
class User:
@abstractmethod
def __init__(self):
pass
## SessionSpec.Parser
#
# Like all good web browsers, you'll need to interpret the code that the browser retrieves with an engine. Most
# browsers call this something else, but the concept is the same: Code goes in that's served by the endpoint, and
# usable data comes out that the browser decides how to display. This parser is the component that handles the
# conversion of that HTTP response into a usable format for the rest of the engine. The options here are pretty
# limitless to the point that building structure around it can only limit the scope of the module, so, feel free
# to experiment. Efforts were taken to design the structure in a way that allows you to do this.
#
# All methods of the Parser class are static, and extract only one datapoint. As you add more datapoints to
# extract and identifiers, you will need to implement those abstract methods in your Parser class and bind the
# identifier for its dedicated datapoint in the dictionary-based router that associates datapoints with static child
# methods to your Parser.
class Parser:
## SessionSpec.Parser.scrape
# @type datapoint: string
# @param datapoint: Identifier representing a datapoint to be extracted from a larger unprocessed body of data.
#
# @type text: string
# @param text: The unprocessed body of data from which the datapoint should be extracted.
#
# scrape defines and associates datapoint identifiers with their respective static methods that retrieve them.
#
# Returns whatever the helper method returns, which is intended to be either an extracted piece of information
# from the raw response body or an abstracted piece of data, so long as any points of aggregation are done
# statelessly.
@staticmethod
@abstractmethod
def scrape( datapoint, text ):
# this is expected to take in an identifier for the first argument representing a datapoint and the raw page
# source being interpreted from which the datapoint is extracted
pass
## SessionSpec.Parser.is_logged_in
# @type text: string
# @param text: The unprocessed page response to extract information from that identifies whether or not you have
# an active session.
#
# is_logged_in is a vital session management point in the rest of your module. This is a boolean
# return that should be checked ad-hoc any time you perform an action that requires a session.
#
# The manner in which an active session is validated will vary from site to site, so this must be implemented
# per-module but will be needed for any module that interfaces with a site that requires a login.
#
# Returns a boolean value.
@staticmethod
@abstractmethod
def is_logged_in( text ):
pass
## SessionSpec.Parser.send_message_failed
# @type text: string
# @param text: The unprocessed page response to extract information from that identifies whether or not your
# attempt to send a message failed.
#
# Returns a boolean value.
@staticmethod
@abstractmethod
def send_message_failed( text ):
pass
| def __init__( self, config_file ):
settings = configparser.ConfigParser( allow_no_value=True )
settings.read( config_file )
self.useragent = settings.get( "general-client", "user_agent" )
self.proxy_enabled = settings.getboolean( "proxy", "enabled" )
if self.proxy_enabled:
self.proxy = settings.get( "proxy", "proxy" ) |
camera_view.py | #!/usr/bin/python
#
# FishPi - An autonomous drop in the ocean
#
# Simple viewer for onboard camera
#
import argparse
import io
import sys
import socket
import struct
# from StringIO import StringIO
import wx
class CameraPanel(wx.Panel):
def __init__(self, parent, server, port=8001, enabled=True):
wx.Panel.__init__(self, parent,
size=(320, 240), style=wx.SUNKEN_BORDER)
self.enabled = enabled
if self.enabled:
self.client_socket = socket.socket()
self.client_socket.connect((server, port))
# Make a file-like object out of the connection
self.connection = self.client_socket.makefile('wb')
self.update()
def update(self):
""" Update panel with new image. """
if self.enabled:
try:
# Read the length of the image as a 32-bit unsigned int. If the
# length is zero, quit
image_len = struct.unpack('<L', self.connection.read(4))[0]
if not image_len:
print "Could not read image length. Skipping.."
self.enabled = False
return
print("Image length: %s" % image_len)
# Construct a stream to hold the image data and read the image
# data from the connection
image_stream = io.BytesIO()
image_stream.write(self.connection.read(image_len))
# Rewind the stream, open it as an image with PIL and do some
# processing on it
image_stream.seek(0)
# this part is from the previous version of this.
# let's see how it integrates with the new code
# img = wx.ImageFromStream(StringIO(image_stream))
img = wx.ImageFromStream(image_stream)
bmp = wx.BitmapFromImage(img)
ctrl = wx.StaticBitmap(self, -1, bmp)
# image = Image.open(image_stream)
# print('Image is %dx%d' % image.size)
# image.verify()
# print('Image is verified')
except Exception, e:
print("Exception: %s, closing client" % e)
self.shut_down()
def shut_down(self):
self.connection.close()
self.client_socket.close()
class CameraViewer(wx.Frame):
""" Simple Frame containing CameraPanel and timer callback. """
def __init__(self, parent, title, server, port):
# initialise frame
|
def on_timer(self, event):
self.camera_frame.update()
def main():
""" Main entry point for application.
Parses command line args for server and launches wx. """
# parse cmd line args
parser = argparse.ArgumentParser(description="raspberry pi - onboard view")
parser.add_argument("-server", help="server for camera stream",
default="raspberrypi.local", type=str, action='store')
parser.add_argument("-port", help="port for camera stream",
default=8000, type=int, action='store')
selected_args = parser.parse_args()
server = selected_args.server
port = selected_args.port
# run UI loop
app = wx.App(False)
frame = CameraViewer(None, "raspberry pi - onboard view", server, port)
app.MainLoop()
frame.shut_down()
return 0
if __name__ == "__main__":
status = main()
sys.exit(status)
| wx.Frame.__init__(self, parent, title=title, size=(320, 240))
# add camera frame
print "using camera at %s:%s" % (server, port)
self.camera_frame = CameraPanel(self, server, port)
# setup callback timer
interval_time = 250
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.on_timer, self.timer)
self.timer.Start(interval_time, False)
# and go
self.Show() |
onig.rs | use core::mem::size_of;
use onig::{Regex, Syntax};
use std::collections::HashMap;
use std::convert::TryFrom;
use std::fmt;
use std::num::NonZeroUsize;
use std::rc::Rc;
use std::str;
use crate::extn::core::matchdata::MatchData;
use crate::extn::core::regexp::{self, Config, Encoding, Regexp, RegexpType, Scan, Source};
use crate::extn::prelude::*;
use super::{NameToCaptureLocations, NilableString};
// The oniguruma `Regexp` backend requries that `u32` can be widened to `usize`
// losslessly.
//
// This const-evaluated expression ensures that `usize` is always at least as
// wide as `usize`.
const _: () = [()][!(size_of::<usize>() >= size_of::<u32>()) as usize];
#[derive(Debug, Clone)]
pub struct Onig {
source: Source,
config: Config,
encoding: Encoding,
regex: Rc<Regex>,
}
impl Onig {
pub fn new(source: Source, config: Config, encoding: Encoding) -> Result<Self, Error> {
let pattern = str::from_utf8(config.pattern())
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 patterns"))?;
let regex = match Regex::with_options(pattern, config.options().into(), Syntax::ruby()) {
Ok(regex) => regex,
Err(err) if source.is_literal() => return Err(SyntaxError::from(err.description().to_owned()).into()),
Err(err) => return Err(RegexpError::from(err.description().to_owned()).into()),
};
let regexp = Self {
source,
config,
encoding,
regex: Rc::new(regex),
};
Ok(regexp)
}
}
impl fmt::Display for Onig {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let pattern = self.config.pattern();
format_unicode_debug_into(f, pattern).map_err(WriteError::into_inner)
}
}
impl RegexpType for Onig {
fn box_clone(&self) -> Box<dyn RegexpType> {
Box::new(self.clone())
}
fn captures(&self, haystack: &[u8]) -> Result<Option<Vec<NilableString>>, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
if let Some(captures) = self.regex.captures(haystack) {
let mut result = Vec::with_capacity(captures.len());
for capture in captures.iter() {
if let Some(capture) = capture {
result.push(Some(capture.into()));
} else {
result.push(None);
}
}
Ok(Some(result))
} else {
Ok(None)
}
}
fn capture_indexes_for_name(&self, name: &[u8]) -> Result<Option<Vec<usize>>, Error> {
let mut result = None;
self.regex.foreach_name(|group, group_indexes| {
if name != group.as_bytes() {
// Continue searching through named captures.
return true;
}
let mut indexes = Vec::with_capacity(group_indexes.len());
for &index in group_indexes {
indexes.push(index as usize);
}
result = Some(indexes);
false
});
Ok(result)
}
fn captures_len(&self, haystack: Option<&[u8]>) -> Result<usize, Error> {
let result = if let Some(haystack) = haystack {
let haystack = str::from_utf8(haystack).map_err(|_| {
ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks")
})?;
self.regex
.captures(haystack)
.map(|captures| captures.len())
.unwrap_or_default()
} else {
self.regex.captures_len()
};
Ok(result)
}
fn capture0<'a>(&self, haystack: &'a [u8]) -> Result<Option<&'a [u8]>, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
let result = self
.regex
.captures(haystack)
.and_then(|captures| captures.at(0))
.map(str::as_bytes);
Ok(result)
}
fn debug(&self) -> String {
let mut debug = String::from("/");
let mut pattern = String::new();
// Explicitly supress this error because `debug` is infallible and
// cannot panic.
//
// In practice this error will never be triggered since the only
// fallible call in `format_unicode_debug_into` is to `write!` which
// never `panic!`s for a `String` formatter, which we are using here.
let _ = format_unicode_debug_into(&mut pattern, self.source.pattern());
debug.push_str(pattern.replace("/", r"\/").as_str());
debug.push('/');
debug.push_str(self.source.options().as_display_modifier());
debug.push_str(self.encoding.modifier_string());
debug
}
fn source(&self) -> &Source {
&self.source
}
fn config(&self) -> &Config {
&self.config
}
fn encoding(&self) -> &Encoding {
&self.encoding
}
fn inspect(&self) -> Vec<u8> {
// pattern length + 2x '/' + mix + encoding
let mut inspect = Vec::with_capacity(self.source.pattern().len() + 2 + 4);
inspect.push(b'/');
if let Ok(pat) = str::from_utf8(self.source.pattern()) {
inspect.extend_from_slice(pat.replace("/", r"\/").as_bytes());
} else {
inspect.extend_from_slice(self.source.pattern());
}
inspect.push(b'/');
inspect.extend_from_slice(self.source.options().as_display_modifier().as_bytes());
inspect.extend_from_slice(self.encoding.modifier_string().as_bytes());
inspect
}
fn string(&self) -> &[u8] {
self.config.pattern()
}
fn case_match(&self, interp: &mut Artichoke, haystack: &[u8]) -> Result<bool, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
regexp::clear_capture_globals(interp)?;
if let Some(captures) = self.regex.captures(haystack) {
interp.set_active_regexp_globals(captures.len())?;
let value = interp.convert_mut(captures.at(0));
interp.set_global_variable(regexp::LAST_MATCHED_STRING, &value)?;
for group in 0..captures.len() {
let value = interp.convert_mut(captures.at(group));
let group = unsafe { NonZeroUsize::new_unchecked(1 + group) };
interp.set_global_variable(regexp::nth_match_group(group), &value)?;
}
if let Some(match_pos) = captures.pos(0) {
let pre_match = interp.convert_mut(&haystack[..match_pos.0]);
let post_match = interp.convert_mut(&haystack[match_pos.1..]);
interp.set_global_variable(regexp::STRING_LEFT_OF_MATCH, &pre_match)?;
interp.set_global_variable(regexp::STRING_RIGHT_OF_MATCH, &post_match)?;
}
let matchdata = MatchData::new(haystack.into(), Regexp::from(self.box_clone()), ..);
let matchdata = MatchData::alloc_value(matchdata, interp)?;
interp.set_global_variable(regexp::LAST_MATCH, &matchdata)?;
Ok(true)
} else {
interp.unset_global_variable(regexp::STRING_LEFT_OF_MATCH)?;
interp.unset_global_variable(regexp::STRING_RIGHT_OF_MATCH)?;
Ok(false)
}
}
fn is_match(&self, haystack: &[u8], pos: Option<i64>) -> Result<bool, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
let haystack_char_len = haystack.chars().count();
let pos = pos.unwrap_or_default();
let pos = if let Ok(pos) = usize::try_from(pos) {
pos
} else {
let pos = pos
.checked_neg()
.and_then(|pos| usize::try_from(pos).ok())
.and_then(|pos| haystack_char_len.checked_sub(pos));
if let Some(pos) = pos {
pos
} else {
return Ok(false);
}
};
let offset = haystack.chars().take(pos).map(char::len_utf8).sum();
if let Some(haystack) = haystack.get(offset..) {
Ok(self.regex.find(haystack).is_some())
} else {
Ok(false)
}
}
fn match_(
&self,
interp: &mut Artichoke,
haystack: &[u8],
pos: Option<i64>,
block: Option<Block>,
) -> Result<Value, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
regexp::clear_capture_globals(interp)?;
let haystack_char_len = haystack.chars().count();
let pos = pos.unwrap_or_default();
let pos = if let Ok(pos) = usize::try_from(pos) {
pos
} else {
let pos = pos
.checked_neg()
.and_then(|pos| usize::try_from(pos).ok())
.and_then(|pos| haystack_char_len.checked_sub(pos));
if let Some(pos) = pos {
pos
} else {
return Ok(Value::nil());
}
};
let offset = haystack.chars().take(pos).map(char::len_utf8).sum();
let target = if let Some(haystack) = haystack.get(offset..) {
haystack
} else {
interp.unset_global_variable(regexp::LAST_MATCH)?;
interp.unset_global_variable(regexp::STRING_LEFT_OF_MATCH)?;
interp.unset_global_variable(regexp::STRING_RIGHT_OF_MATCH)?;
return Ok(Value::nil());
};
if let Some(captures) = self.regex.captures(target) {
interp.set_active_regexp_globals(captures.len())?;
let value = interp.convert_mut(captures.at(0));
interp.set_global_variable(regexp::LAST_MATCHED_STRING, &value)?;
for group in 0..captures.len() {
let value = interp.convert_mut(captures.at(group));
let group = unsafe { NonZeroUsize::new_unchecked(1 + group) };
interp.set_global_variable(regexp::nth_match_group(group), &value)?;
}
let mut matchdata = MatchData::new(haystack.into(), Regexp::from(self.box_clone()), ..);
if let Some(match_pos) = captures.pos(0) {
let pre_match = interp.convert_mut(&target[..match_pos.0]);
let post_match = interp.convert_mut(&target[match_pos.1..]);
interp.set_global_variable(regexp::STRING_LEFT_OF_MATCH, &pre_match)?;
interp.set_global_variable(regexp::STRING_RIGHT_OF_MATCH, &post_match)?;
matchdata.set_region(offset + match_pos.0..offset + match_pos.1);
}
let data = MatchData::alloc_value(matchdata, interp)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
if let Some(block) = block {
let result = block.yield_arg(interp, &data)?;
Ok(result)
} else {
Ok(data)
}
} else |
}
fn match_operator(&self, interp: &mut Artichoke, haystack: &[u8]) -> Result<Option<usize>, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
regexp::clear_capture_globals(interp)?;
if let Some(captures) = self.regex.captures(haystack) {
interp.set_active_regexp_globals(captures.len())?;
let value = interp.convert_mut(captures.at(0));
interp.set_global_variable(regexp::LAST_MATCHED_STRING, &value)?;
for group in 0..captures.len() {
let value = interp.convert_mut(captures.at(group));
let group = unsafe { NonZeroUsize::new_unchecked(1 + group) };
interp.set_global_variable(regexp::nth_match_group(group), &value)?;
}
let matchdata = MatchData::new(haystack.into(), Regexp::from(self.box_clone()), ..);
let data = MatchData::alloc_value(matchdata, interp)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
if let Some(match_pos) = captures.pos(0) {
let pre_match = interp.convert_mut(&haystack[..match_pos.0]);
let post_match = interp.convert_mut(&haystack[match_pos.1..]);
interp.set_global_variable(regexp::STRING_LEFT_OF_MATCH, &pre_match)?;
interp.set_global_variable(regexp::STRING_RIGHT_OF_MATCH, &post_match)?;
let pos = match_pos.0;
Ok(Some(pos))
} else {
Ok(Some(0))
}
} else {
interp.unset_global_variable(regexp::LAST_MATCH)?;
interp.unset_global_variable(regexp::STRING_LEFT_OF_MATCH)?;
interp.unset_global_variable(regexp::STRING_RIGHT_OF_MATCH)?;
Ok(None)
}
}
fn named_captures(&self) -> Result<NameToCaptureLocations, Error> {
// Use a Vec of key-value pairs because insertion order matters for spec
// compliance.
let mut map = vec![];
self.regex.foreach_name(|group, group_indexes| {
let mut converted = Vec::with_capacity(group_indexes.len());
for &index in group_indexes {
converted.push(index as usize);
}
map.push((group.into(), converted));
true
});
Ok(map)
}
fn named_captures_for_haystack(&self, haystack: &[u8]) -> Result<Option<HashMap<Vec<u8>, NilableString>>, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
if let Some(captures) = self.regex.captures(haystack) {
let mut map = HashMap::with_capacity(captures.len());
self.regex.foreach_name(|group, group_indexes| {
for &index in group_indexes.iter().rev() {
if let Some(capture) = captures.at(index as usize) {
map.insert(group.into(), Some(capture.into()));
return true;
}
}
map.insert(group.into(), None);
true
});
Ok(Some(map))
} else {
Ok(None)
}
}
fn names(&self) -> Vec<Vec<u8>> {
let mut names = vec![];
let mut capture_names = vec![];
self.regex.foreach_name(|group, group_indexes| {
capture_names.push((group.as_bytes().to_vec(), group_indexes.to_vec()));
true
});
capture_names.sort_by(|left, right| {
let left = left.1.iter().min().copied().unwrap_or(u32::MAX);
let right = right.1.iter().min().copied().unwrap_or(u32::MAX);
left.cmp(&right)
});
for (name, _) in capture_names {
if !names.contains(&name) {
names.push(name);
}
}
names
}
fn pos(&self, haystack: &[u8], at: usize) -> Result<Option<(usize, usize)>, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
let pos = self.regex.captures(haystack).and_then(|captures| captures.pos(at));
Ok(pos)
}
fn scan(&self, interp: &mut Artichoke, haystack: &[u8], block: Option<Block>) -> Result<Scan, Error> {
let haystack = str::from_utf8(haystack)
.map_err(|_| ArgumentError::with_message("Oniguruma backend for Regexp only supports UTF-8 haystacks"))?;
regexp::clear_capture_globals(interp)?;
let mut matchdata = MatchData::new(haystack.into(), Regexp::from(self.box_clone()), ..);
let len = NonZeroUsize::new(self.regex.captures_len());
if let Some(block) = block {
if let Some(len) = len {
interp.set_active_regexp_globals(len.get())?;
let mut iter = self.regex.captures_iter(haystack).peekable();
if iter.peek().is_none() {
interp.unset_global_variable(regexp::LAST_MATCH)?;
return Ok(Scan::Haystack);
}
for captures in iter {
let fullcapture = interp.convert_mut(captures.at(0));
interp.set_global_variable(regexp::LAST_MATCHED_STRING, &fullcapture)?;
let mut groups = Vec::with_capacity(len.get());
for group in 1..=len.get() {
let capture = captures.at(group);
groups.push(capture);
let capture = interp.convert_mut(capture);
let group = unsafe { NonZeroUsize::new_unchecked(group) };
interp.set_global_variable(regexp::nth_match_group(group), &capture)?;
}
let matched = interp.try_convert_mut(groups)?;
if let Some(pos) = captures.pos(0) {
matchdata.set_region(pos.0..pos.1);
}
let data = MatchData::alloc_value(matchdata.clone(), interp)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
let _ = block.yield_arg(interp, &matched)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
}
} else {
let mut iter = self.regex.find_iter(haystack).peekable();
if iter.peek().is_none() {
interp.unset_global_variable(regexp::LAST_MATCH)?;
return Ok(Scan::Haystack);
}
for pos in iter {
let scanned = &haystack[pos.0..pos.1];
let matched = interp.convert_mut(scanned);
matchdata.set_region(pos.0..pos.1);
let data = MatchData::alloc_value(matchdata.clone(), interp)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
let _ = block.yield_arg(interp, &matched)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
}
}
Ok(Scan::Haystack)
} else {
let mut last_pos = (0, 0);
if let Some(len) = len {
interp.set_active_regexp_globals(len.get())?;
let mut collected = vec![];
let mut iter = self.regex.captures_iter(haystack).peekable();
if iter.peek().is_none() {
interp.unset_global_variable(regexp::LAST_MATCH)?;
return Ok(Scan::Collected(Vec::new()));
}
for captures in iter {
let mut groups = Vec::with_capacity(len.get());
for group in 1..=len.get() {
groups.push(captures.at(group).map(str::as_bytes).map(Vec::from));
}
if let Some(pos) = captures.pos(0) {
last_pos = pos;
}
collected.push(groups);
}
matchdata.set_region(last_pos.0..last_pos.1);
let data = MatchData::alloc_value(matchdata, interp)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
let mut iter = collected.iter().enumerate();
if let Some((_, fullcapture)) = iter.next() {
let fullcapture = interp.try_convert_mut(fullcapture.as_slice())?;
interp.set_global_variable(regexp::LAST_MATCHED_STRING, &fullcapture)?;
}
for (group, capture) in iter {
let capture = interp.try_convert_mut(capture.as_slice())?;
let group = unsafe { NonZeroUsize::new_unchecked(group) };
interp.set_global_variable(regexp::nth_match_group(group), &capture)?;
}
Ok(Scan::Collected(collected))
} else {
let mut collected = vec![];
let mut iter = self.regex.find_iter(haystack).peekable();
if iter.peek().is_none() {
interp.unset_global_variable(regexp::LAST_MATCH)?;
return Ok(Scan::Patterns(Vec::new()));
}
for pos in iter {
let scanned = &haystack[pos.0..pos.1];
last_pos = pos;
collected.push(Vec::from(scanned.as_bytes()));
}
matchdata.set_region(last_pos.0..last_pos.1);
let data = MatchData::alloc_value(matchdata, interp)?;
interp.set_global_variable(regexp::LAST_MATCH, &data)?;
let last_matched = collected.last().map(Vec::as_slice);
let last_matched = interp.convert_mut(last_matched);
interp.set_global_variable(regexp::LAST_MATCHED_STRING, &last_matched)?;
Ok(Scan::Patterns(collected))
}
}
}
}
| {
interp.unset_global_variable(regexp::LAST_MATCH)?;
interp.unset_global_variable(regexp::STRING_LEFT_OF_MATCH)?;
interp.unset_global_variable(regexp::STRING_RIGHT_OF_MATCH)?;
Ok(Value::nil())
} |
lib.rs | use clap::{App, AppSettings, Arg};
use clap::{crate_version, crate_description, crate_authors};
use core::commands;
use utils::app_config::AppConfig;
use utils::error::Result;
/// Match commands
pub fn cli_match() -> Result<()> {
// Get matches
let cli_matches = cli_config()?;
// Merge clap config file if the value is set
AppConfig::merge_config(cli_matches.value_of("config"))?;
let groupby_path = cli_matches.value_of("groupby-path").unwrap();
let outdir = cli_matches.value_of("out").unwrap();
commands::run_yshard(&outdir, &groupby_path)?;
Ok(())
}
/// Configure Clap
/// This function will configure clap and match arguments
pub fn cli_config() -> Result<clap::ArgMatches> {
let cli_app = App::new("yshard")
.setting(AppSettings::ArgRequiredElseHelp)
.version(crate_version!())
.about(crate_description!())
.arg(
Arg::new("config")
.short('c')
.long("config")
.value_name("FILE")
.about("Set a custom config file")
.takes_value(true)
)
.arg(
Arg::new("out")
.short('o')
.long("output-dir")
.about("Directory to place the output files")
.takes_value(true)
.required(true)
)
.arg(
Arg::new("groupby-path")
.short('g')
.long("groupby-path")
.about("Path to the element of the document to group by (in jq syntax)")
.takes_value(true)
.required(true)
);
// Get matches
let cli_matches = cli_app.get_matches(); | Ok(cli_matches)
} | |
reduce_sum.py | from onnx_tf.handlers.frontend_handler import FrontendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_op
from .math_mixin import ReductionMixin
@onnx_op("ReduceSum")
@tf_op("Sum")
class | (ReductionMixin, FrontendHandler):
@classmethod
def version_1(cls, node, **kwargs):
return cls.reduction_op(node, **kwargs)
| ReduceSum |
thetest.pb.go | // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: combos/marshaler/thetest.proto
/*
Package test is a generated protocol buffer package.
It is generated from these files:
combos/marshaler/thetest.proto
It has these top-level messages:
NidOptNative
NinOptNative
NidRepNative
NinRepNative
NidRepPackedNative
NinRepPackedNative
NidOptStruct
NinOptStruct
NidRepStruct
NinRepStruct
NidEmbeddedStruct
NinEmbeddedStruct
NidNestedStruct
NinNestedStruct
NidOptCustom
CustomDash
NinOptCustom
NidRepCustom
NinRepCustom
NinOptNativeUnion
NinOptStructUnion
NinEmbeddedStructUnion
NinNestedStructUnion
Tree
OrBranch
AndBranch
Leaf
DeepTree
ADeepBranch
AndDeepBranch
DeepLeaf
Nil
NidOptEnum
NinOptEnum
NidRepEnum
NinRepEnum
NinOptEnumDefault
AnotherNinOptEnum
AnotherNinOptEnumDefault
Timer
MyExtendable
OtherExtenable
NestedDefinition
NestedScope
NinOptNativeDefault
CustomContainer
CustomNameNidOptNative
CustomNameNinOptNative
CustomNameNinRepNative
CustomNameNinStruct
CustomNameCustomType
CustomNameNinEmbeddedStructUnion
CustomNameEnum
NoExtensionsMap
Unrecognized
UnrecognizedWithInner
UnrecognizedWithEmbed
Node
NonByteCustomType
NidOptNonByteCustomType
NinOptNonByteCustomType
NidRepNonByteCustomType
NinRepNonByteCustomType
ProtoType
*/
package test
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import github_com_gogo_protobuf_test_custom "github.com/gogo/protobuf/test/custom"
import github_com_gogo_protobuf_test_custom_dash_type "github.com/gogo/protobuf/test/custom-dash-type"
import bytes "bytes"
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
import github_com_gogo_protobuf_protoc_gen_gogo_descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
import compress_gzip "compress/gzip"
import io_ioutil "io/ioutil"
import strconv "strconv"
import strings "strings"
import sort "sort"
import reflect "reflect"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type TheTestEnum int32
const (
A TheTestEnum = 0
B TheTestEnum = 1
C TheTestEnum = 2
)
var TheTestEnum_name = map[int32]string{
0: "A",
1: "B",
2: "C",
}
var TheTestEnum_value = map[string]int32{
"A": 0,
"B": 1,
"C": 2,
}
func (x TheTestEnum) Enum() *TheTestEnum {
p := new(TheTestEnum)
*p = x
return p
}
func (x TheTestEnum) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(TheTestEnum_name, int32(x))
}
func (x *TheTestEnum) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(TheTestEnum_value, data, "TheTestEnum")
if err != nil {
return err
}
*x = TheTestEnum(value)
return nil
}
func (TheTestEnum) EnumDescriptor() ([]byte, []int) { return fileDescriptorThetest, []int{0} }
type AnotherTestEnum int32
const (
D AnotherTestEnum = 10
E AnotherTestEnum = 11
)
var AnotherTestEnum_name = map[int32]string{
10: "D",
11: "E",
}
var AnotherTestEnum_value = map[string]int32{
"D": 10,
"E": 11,
}
func (x AnotherTestEnum) Enum() *AnotherTestEnum {
p := new(AnotherTestEnum)
*p = x
return p
}
func (x AnotherTestEnum) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(AnotherTestEnum_name, int32(x))
}
func (x *AnotherTestEnum) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(AnotherTestEnum_value, data, "AnotherTestEnum")
if err != nil {
return err
}
*x = AnotherTestEnum(value)
return nil
}
func (AnotherTestEnum) EnumDescriptor() ([]byte, []int) { return fileDescriptorThetest, []int{1} }
// YetAnotherTestEnum is used to test cross-package import of custom name
// fields and default resolution.
type YetAnotherTestEnum int32
const (
AA YetAnotherTestEnum = 0
BetterYetBB YetAnotherTestEnum = 1
)
var YetAnotherTestEnum_name = map[int32]string{
0: "AA",
1: "BB",
}
var YetAnotherTestEnum_value = map[string]int32{
"AA": 0,
"BB": 1,
}
func (x YetAnotherTestEnum) Enum() *YetAnotherTestEnum {
p := new(YetAnotherTestEnum)
*p = x
return p
}
func (x YetAnotherTestEnum) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(YetAnotherTestEnum_name, int32(x))
}
func (x *YetAnotherTestEnum) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(YetAnotherTestEnum_value, data, "YetAnotherTestEnum")
if err != nil {
return err
}
*x = YetAnotherTestEnum(value)
return nil
}
func (YetAnotherTestEnum) EnumDescriptor() ([]byte, []int) { return fileDescriptorThetest, []int{2} }
// YetAnotherTestEnum is used to test cross-package import of custom name
// fields and default resolution.
type YetYetAnotherTestEnum int32
const (
YetYetAnotherTestEnum_CC YetYetAnotherTestEnum = 0
YetYetAnotherTestEnum_BetterYetDD YetYetAnotherTestEnum = 1
)
var YetYetAnotherTestEnum_name = map[int32]string{
0: "CC",
1: "DD",
}
var YetYetAnotherTestEnum_value = map[string]int32{
"CC": 0,
"DD": 1,
}
func (x YetYetAnotherTestEnum) Enum() *YetYetAnotherTestEnum {
p := new(YetYetAnotherTestEnum)
*p = x
return p
}
func (x YetYetAnotherTestEnum) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(YetYetAnotherTestEnum_name, int32(x))
}
func (x *YetYetAnotherTestEnum) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(YetYetAnotherTestEnum_value, data, "YetYetAnotherTestEnum")
if err != nil {
return err
}
*x = YetYetAnotherTestEnum(value)
return nil
}
func (YetYetAnotherTestEnum) EnumDescriptor() ([]byte, []int) { return fileDescriptorThetest, []int{3} }
type NestedDefinition_NestedEnum int32
const (
TYPE_NESTED NestedDefinition_NestedEnum = 1
)
var NestedDefinition_NestedEnum_name = map[int32]string{
1: "TYPE_NESTED",
}
var NestedDefinition_NestedEnum_value = map[string]int32{
"TYPE_NESTED": 1,
}
func (x NestedDefinition_NestedEnum) Enum() *NestedDefinition_NestedEnum {
p := new(NestedDefinition_NestedEnum)
*p = x
return p
}
func (x NestedDefinition_NestedEnum) MarshalJSON() ([]byte, error) {
return proto.MarshalJSONEnum(NestedDefinition_NestedEnum_name, int32(x))
}
func (x *NestedDefinition_NestedEnum) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(NestedDefinition_NestedEnum_value, data, "NestedDefinition_NestedEnum")
if err != nil {
return err
}
*x = NestedDefinition_NestedEnum(value)
return nil
}
func (NestedDefinition_NestedEnum) EnumDescriptor() ([]byte, []int) {
return fileDescriptorThetest, []int{42, 0}
}
type NidOptNative struct {
Field1 float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1"`
Field2 float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2"`
Field3 int32 `protobuf:"varint,3,opt,name=Field3" json:"Field3"`
Field4 int64 `protobuf:"varint,4,opt,name=Field4" json:"Field4"`
Field5 uint32 `protobuf:"varint,5,opt,name=Field5" json:"Field5"`
Field6 uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6"`
Field7 int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7"`
Field8 int64 `protobuf:"zigzag64,8,opt,name=Field8" json:"Field8"`
Field9 uint32 `protobuf:"fixed32,9,opt,name=Field9" json:"Field9"`
Field10 int32 `protobuf:"fixed32,10,opt,name=Field10" json:"Field10"`
Field11 uint64 `protobuf:"fixed64,11,opt,name=Field11" json:"Field11"`
Field12 int64 `protobuf:"fixed64,12,opt,name=Field12" json:"Field12"`
Field13 bool `protobuf:"varint,13,opt,name=Field13" json:"Field13"`
Field14 string `protobuf:"bytes,14,opt,name=Field14" json:"Field14"`
Field15 []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidOptNative) Reset() { *m = NidOptNative{} }
func (*NidOptNative) ProtoMessage() {}
func (*NidOptNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{0} }
type NinOptNative struct {
Field1 *float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1,omitempty"`
Field2 *float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2,omitempty"`
Field3 *int32 `protobuf:"varint,3,opt,name=Field3" json:"Field3,omitempty"`
Field4 *int64 `protobuf:"varint,4,opt,name=Field4" json:"Field4,omitempty"`
Field5 *uint32 `protobuf:"varint,5,opt,name=Field5" json:"Field5,omitempty"`
Field6 *uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6,omitempty"`
Field7 *int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7,omitempty"`
Field8 *int64 `protobuf:"zigzag64,8,opt,name=Field8" json:"Field8,omitempty"`
Field9 *uint32 `protobuf:"fixed32,9,opt,name=Field9" json:"Field9,omitempty"`
Field10 *int32 `protobuf:"fixed32,10,opt,name=Field10" json:"Field10,omitempty"`
Field11 *uint64 `protobuf:"fixed64,11,opt,name=Field11" json:"Field11,omitempty"`
Field12 *int64 `protobuf:"fixed64,12,opt,name=Field12" json:"Field12,omitempty"`
Field13 *bool `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"`
Field14 *string `protobuf:"bytes,14,opt,name=Field14" json:"Field14,omitempty"`
Field15 []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptNative) Reset() { *m = NinOptNative{} }
func (*NinOptNative) ProtoMessage() {}
func (*NinOptNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{1} }
type NidRepNative struct {
Field1 []float64 `protobuf:"fixed64,1,rep,name=Field1" json:"Field1,omitempty"`
Field2 []float32 `protobuf:"fixed32,2,rep,name=Field2" json:"Field2,omitempty"`
Field3 []int32 `protobuf:"varint,3,rep,name=Field3" json:"Field3,omitempty"`
Field4 []int64 `protobuf:"varint,4,rep,name=Field4" json:"Field4,omitempty"`
Field5 []uint32 `protobuf:"varint,5,rep,name=Field5" json:"Field5,omitempty"`
Field6 []uint64 `protobuf:"varint,6,rep,name=Field6" json:"Field6,omitempty"`
Field7 []int32 `protobuf:"zigzag32,7,rep,name=Field7" json:"Field7,omitempty"`
Field8 []int64 `protobuf:"zigzag64,8,rep,name=Field8" json:"Field8,omitempty"`
Field9 []uint32 `protobuf:"fixed32,9,rep,name=Field9" json:"Field9,omitempty"`
Field10 []int32 `protobuf:"fixed32,10,rep,name=Field10" json:"Field10,omitempty"`
Field11 []uint64 `protobuf:"fixed64,11,rep,name=Field11" json:"Field11,omitempty"`
Field12 []int64 `protobuf:"fixed64,12,rep,name=Field12" json:"Field12,omitempty"`
Field13 []bool `protobuf:"varint,13,rep,name=Field13" json:"Field13,omitempty"`
Field14 []string `protobuf:"bytes,14,rep,name=Field14" json:"Field14,omitempty"`
Field15 [][]byte `protobuf:"bytes,15,rep,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidRepNative) Reset() { *m = NidRepNative{} }
func (*NidRepNative) ProtoMessage() {}
func (*NidRepNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{2} }
type NinRepNative struct {
Field1 []float64 `protobuf:"fixed64,1,rep,name=Field1" json:"Field1,omitempty"`
Field2 []float32 `protobuf:"fixed32,2,rep,name=Field2" json:"Field2,omitempty"`
Field3 []int32 `protobuf:"varint,3,rep,name=Field3" json:"Field3,omitempty"`
Field4 []int64 `protobuf:"varint,4,rep,name=Field4" json:"Field4,omitempty"`
Field5 []uint32 `protobuf:"varint,5,rep,name=Field5" json:"Field5,omitempty"`
Field6 []uint64 `protobuf:"varint,6,rep,name=Field6" json:"Field6,omitempty"`
Field7 []int32 `protobuf:"zigzag32,7,rep,name=Field7" json:"Field7,omitempty"`
Field8 []int64 `protobuf:"zigzag64,8,rep,name=Field8" json:"Field8,omitempty"`
Field9 []uint32 `protobuf:"fixed32,9,rep,name=Field9" json:"Field9,omitempty"`
Field10 []int32 `protobuf:"fixed32,10,rep,name=Field10" json:"Field10,omitempty"`
Field11 []uint64 `protobuf:"fixed64,11,rep,name=Field11" json:"Field11,omitempty"`
Field12 []int64 `protobuf:"fixed64,12,rep,name=Field12" json:"Field12,omitempty"`
Field13 []bool `protobuf:"varint,13,rep,name=Field13" json:"Field13,omitempty"`
Field14 []string `protobuf:"bytes,14,rep,name=Field14" json:"Field14,omitempty"`
Field15 [][]byte `protobuf:"bytes,15,rep,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinRepNative) Reset() { *m = NinRepNative{} }
func (*NinRepNative) ProtoMessage() {}
func (*NinRepNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{3} }
type NidRepPackedNative struct {
Field1 []float64 `protobuf:"fixed64,1,rep,packed,name=Field1" json:"Field1,omitempty"`
Field2 []float32 `protobuf:"fixed32,2,rep,packed,name=Field2" json:"Field2,omitempty"`
Field3 []int32 `protobuf:"varint,3,rep,packed,name=Field3" json:"Field3,omitempty"`
Field4 []int64 `protobuf:"varint,4,rep,packed,name=Field4" json:"Field4,omitempty"`
Field5 []uint32 `protobuf:"varint,5,rep,packed,name=Field5" json:"Field5,omitempty"`
Field6 []uint64 `protobuf:"varint,6,rep,packed,name=Field6" json:"Field6,omitempty"`
Field7 []int32 `protobuf:"zigzag32,7,rep,packed,name=Field7" json:"Field7,omitempty"`
Field8 []int64 `protobuf:"zigzag64,8,rep,packed,name=Field8" json:"Field8,omitempty"`
Field9 []uint32 `protobuf:"fixed32,9,rep,packed,name=Field9" json:"Field9,omitempty"`
Field10 []int32 `protobuf:"fixed32,10,rep,packed,name=Field10" json:"Field10,omitempty"`
Field11 []uint64 `protobuf:"fixed64,11,rep,packed,name=Field11" json:"Field11,omitempty"`
Field12 []int64 `protobuf:"fixed64,12,rep,packed,name=Field12" json:"Field12,omitempty"`
Field13 []bool `protobuf:"varint,13,rep,packed,name=Field13" json:"Field13,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidRepPackedNative) Reset() { *m = NidRepPackedNative{} }
func (*NidRepPackedNative) ProtoMessage() {}
func (*NidRepPackedNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{4} }
type NinRepPackedNative struct {
Field1 []float64 `protobuf:"fixed64,1,rep,packed,name=Field1" json:"Field1,omitempty"`
Field2 []float32 `protobuf:"fixed32,2,rep,packed,name=Field2" json:"Field2,omitempty"`
Field3 []int32 `protobuf:"varint,3,rep,packed,name=Field3" json:"Field3,omitempty"`
Field4 []int64 `protobuf:"varint,4,rep,packed,name=Field4" json:"Field4,omitempty"`
Field5 []uint32 `protobuf:"varint,5,rep,packed,name=Field5" json:"Field5,omitempty"`
Field6 []uint64 `protobuf:"varint,6,rep,packed,name=Field6" json:"Field6,omitempty"`
Field7 []int32 `protobuf:"zigzag32,7,rep,packed,name=Field7" json:"Field7,omitempty"`
Field8 []int64 `protobuf:"zigzag64,8,rep,packed,name=Field8" json:"Field8,omitempty"`
Field9 []uint32 `protobuf:"fixed32,9,rep,packed,name=Field9" json:"Field9,omitempty"`
Field10 []int32 `protobuf:"fixed32,10,rep,packed,name=Field10" json:"Field10,omitempty"`
Field11 []uint64 `protobuf:"fixed64,11,rep,packed,name=Field11" json:"Field11,omitempty"`
Field12 []int64 `protobuf:"fixed64,12,rep,packed,name=Field12" json:"Field12,omitempty"`
Field13 []bool `protobuf:"varint,13,rep,packed,name=Field13" json:"Field13,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinRepPackedNative) Reset() { *m = NinRepPackedNative{} }
func (*NinRepPackedNative) ProtoMessage() {}
func (*NinRepPackedNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{5} }
type NidOptStruct struct {
Field1 float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1"`
Field2 float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2"`
Field3 NidOptNative `protobuf:"bytes,3,opt,name=Field3" json:"Field3"`
Field4 NinOptNative `protobuf:"bytes,4,opt,name=Field4" json:"Field4"`
Field6 uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6"`
Field7 int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7"`
Field8 NidOptNative `protobuf:"bytes,8,opt,name=Field8" json:"Field8"`
Field13 bool `protobuf:"varint,13,opt,name=Field13" json:"Field13"`
Field14 string `protobuf:"bytes,14,opt,name=Field14" json:"Field14"`
Field15 []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidOptStruct) Reset() { *m = NidOptStruct{} }
func (*NidOptStruct) ProtoMessage() {}
func (*NidOptStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{6} }
type NinOptStruct struct {
Field1 *float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1,omitempty"`
Field2 *float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2,omitempty"`
Field3 *NidOptNative `protobuf:"bytes,3,opt,name=Field3" json:"Field3,omitempty"`
Field4 *NinOptNative `protobuf:"bytes,4,opt,name=Field4" json:"Field4,omitempty"`
Field6 *uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6,omitempty"`
Field7 *int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7,omitempty"`
Field8 *NidOptNative `protobuf:"bytes,8,opt,name=Field8" json:"Field8,omitempty"`
Field13 *bool `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"`
Field14 *string `protobuf:"bytes,14,opt,name=Field14" json:"Field14,omitempty"`
Field15 []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptStruct) Reset() { *m = NinOptStruct{} }
func (*NinOptStruct) ProtoMessage() {}
func (*NinOptStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{7} }
type NidRepStruct struct {
Field1 []float64 `protobuf:"fixed64,1,rep,name=Field1" json:"Field1,omitempty"`
Field2 []float32 `protobuf:"fixed32,2,rep,name=Field2" json:"Field2,omitempty"`
Field3 []NidOptNative `protobuf:"bytes,3,rep,name=Field3" json:"Field3"`
Field4 []NinOptNative `protobuf:"bytes,4,rep,name=Field4" json:"Field4"`
Field6 []uint64 `protobuf:"varint,6,rep,name=Field6" json:"Field6,omitempty"`
Field7 []int32 `protobuf:"zigzag32,7,rep,name=Field7" json:"Field7,omitempty"`
Field8 []NidOptNative `protobuf:"bytes,8,rep,name=Field8" json:"Field8"`
Field13 []bool `protobuf:"varint,13,rep,name=Field13" json:"Field13,omitempty"`
Field14 []string `protobuf:"bytes,14,rep,name=Field14" json:"Field14,omitempty"`
Field15 [][]byte `protobuf:"bytes,15,rep,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidRepStruct) Reset() { *m = NidRepStruct{} }
func (*NidRepStruct) ProtoMessage() {}
func (*NidRepStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{8} }
type NinRepStruct struct {
Field1 []float64 `protobuf:"fixed64,1,rep,name=Field1" json:"Field1,omitempty"`
Field2 []float32 `protobuf:"fixed32,2,rep,name=Field2" json:"Field2,omitempty"`
Field3 []*NidOptNative `protobuf:"bytes,3,rep,name=Field3" json:"Field3,omitempty"`
Field4 []*NinOptNative `protobuf:"bytes,4,rep,name=Field4" json:"Field4,omitempty"`
Field6 []uint64 `protobuf:"varint,6,rep,name=Field6" json:"Field6,omitempty"`
Field7 []int32 `protobuf:"zigzag32,7,rep,name=Field7" json:"Field7,omitempty"`
Field8 []*NidOptNative `protobuf:"bytes,8,rep,name=Field8" json:"Field8,omitempty"`
Field13 []bool `protobuf:"varint,13,rep,name=Field13" json:"Field13,omitempty"`
Field14 []string `protobuf:"bytes,14,rep,name=Field14" json:"Field14,omitempty"`
Field15 [][]byte `protobuf:"bytes,15,rep,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinRepStruct) Reset() { *m = NinRepStruct{} }
func (*NinRepStruct) ProtoMessage() {}
func (*NinRepStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{9} }
type NidEmbeddedStruct struct {
*NidOptNative `protobuf:"bytes,1,opt,name=Field1,embedded=Field1" json:"Field1,omitempty"`
Field200 NidOptNative `protobuf:"bytes,200,opt,name=Field200" json:"Field200"`
Field210 bool `protobuf:"varint,210,opt,name=Field210" json:"Field210"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidEmbeddedStruct) Reset() { *m = NidEmbeddedStruct{} }
func (*NidEmbeddedStruct) ProtoMessage() {}
func (*NidEmbeddedStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{10} }
type NinEmbeddedStruct struct {
*NidOptNative `protobuf:"bytes,1,opt,name=Field1,embedded=Field1" json:"Field1,omitempty"`
Field200 *NidOptNative `protobuf:"bytes,200,opt,name=Field200" json:"Field200,omitempty"`
Field210 *bool `protobuf:"varint,210,opt,name=Field210" json:"Field210,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinEmbeddedStruct) Reset() { *m = NinEmbeddedStruct{} }
func (*NinEmbeddedStruct) ProtoMessage() {}
func (*NinEmbeddedStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{11} }
type NidNestedStruct struct {
Field1 NidOptStruct `protobuf:"bytes,1,opt,name=Field1" json:"Field1"`
Field2 []NidRepStruct `protobuf:"bytes,2,rep,name=Field2" json:"Field2"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidNestedStruct) Reset() { *m = NidNestedStruct{} }
func (*NidNestedStruct) ProtoMessage() {}
func (*NidNestedStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{12} }
type NinNestedStruct struct {
Field1 *NinOptStruct `protobuf:"bytes,1,opt,name=Field1" json:"Field1,omitempty"`
Field2 []*NinRepStruct `protobuf:"bytes,2,rep,name=Field2" json:"Field2,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinNestedStruct) Reset() { *m = NinNestedStruct{} }
func (*NinNestedStruct) ProtoMessage() {}
func (*NinNestedStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{13} }
type NidOptCustom struct {
Id Uuid `protobuf:"bytes,1,opt,name=Id,customtype=Uuid" json:"Id"`
Value github_com_gogo_protobuf_test_custom.Uint128 `protobuf:"bytes,2,opt,name=Value,customtype=github.com/gogo/protobuf/test/custom.Uint128" json:"Value"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidOptCustom) Reset() { *m = NidOptCustom{} }
func (*NidOptCustom) ProtoMessage() {}
func (*NidOptCustom) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{14} }
type CustomDash struct {
Value *github_com_gogo_protobuf_test_custom_dash_type.Bytes `protobuf:"bytes,1,opt,name=Value,customtype=github.com/gogo/protobuf/test/custom-dash-type.Bytes" json:"Value,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomDash) Reset() { *m = CustomDash{} }
func (*CustomDash) ProtoMessage() {}
func (*CustomDash) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{15} }
type NinOptCustom struct {
Id *Uuid `protobuf:"bytes,1,opt,name=Id,customtype=Uuid" json:"Id,omitempty"`
Value *github_com_gogo_protobuf_test_custom.Uint128 `protobuf:"bytes,2,opt,name=Value,customtype=github.com/gogo/protobuf/test/custom.Uint128" json:"Value,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptCustom) Reset() { *m = NinOptCustom{} }
func (*NinOptCustom) ProtoMessage() {}
func (*NinOptCustom) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{16} }
type NidRepCustom struct {
Id []Uuid `protobuf:"bytes,1,rep,name=Id,customtype=Uuid" json:"Id"`
Value []github_com_gogo_protobuf_test_custom.Uint128 `protobuf:"bytes,2,rep,name=Value,customtype=github.com/gogo/protobuf/test/custom.Uint128" json:"Value"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidRepCustom) Reset() { *m = NidRepCustom{} }
func (*NidRepCustom) ProtoMessage() {}
func (*NidRepCustom) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{17} }
type NinRepCustom struct {
Id []Uuid `protobuf:"bytes,1,rep,name=Id,customtype=Uuid" json:"Id,omitempty"`
Value []github_com_gogo_protobuf_test_custom.Uint128 `protobuf:"bytes,2,rep,name=Value,customtype=github.com/gogo/protobuf/test/custom.Uint128" json:"Value,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinRepCustom) Reset() { *m = NinRepCustom{} }
func (*NinRepCustom) ProtoMessage() {}
func (*NinRepCustom) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{18} }
type NinOptNativeUnion struct {
Field1 *float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1,omitempty"`
Field2 *float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2,omitempty"`
Field3 *int32 `protobuf:"varint,3,opt,name=Field3" json:"Field3,omitempty"`
Field4 *int64 `protobuf:"varint,4,opt,name=Field4" json:"Field4,omitempty"`
Field5 *uint32 `protobuf:"varint,5,opt,name=Field5" json:"Field5,omitempty"`
Field6 *uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6,omitempty"`
Field13 *bool `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"`
Field14 *string `protobuf:"bytes,14,opt,name=Field14" json:"Field14,omitempty"`
Field15 []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptNativeUnion) Reset() { *m = NinOptNativeUnion{} }
func (*NinOptNativeUnion) ProtoMessage() {}
func (*NinOptNativeUnion) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{19} }
type NinOptStructUnion struct {
Field1 *float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1,omitempty"`
Field2 *float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2,omitempty"`
Field3 *NidOptNative `protobuf:"bytes,3,opt,name=Field3" json:"Field3,omitempty"`
Field4 *NinOptNative `protobuf:"bytes,4,opt,name=Field4" json:"Field4,omitempty"`
Field6 *uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6,omitempty"`
Field7 *int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7,omitempty"`
Field13 *bool `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"`
Field14 *string `protobuf:"bytes,14,opt,name=Field14" json:"Field14,omitempty"`
Field15 []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptStructUnion) Reset() { *m = NinOptStructUnion{} }
func (*NinOptStructUnion) ProtoMessage() {}
func (*NinOptStructUnion) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{20} }
type NinEmbeddedStructUnion struct {
*NidOptNative `protobuf:"bytes,1,opt,name=Field1,embedded=Field1" json:"Field1,omitempty"`
Field200 *NinOptNative `protobuf:"bytes,200,opt,name=Field200" json:"Field200,omitempty"`
Field210 *bool `protobuf:"varint,210,opt,name=Field210" json:"Field210,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinEmbeddedStructUnion) Reset() { *m = NinEmbeddedStructUnion{} }
func (*NinEmbeddedStructUnion) ProtoMessage() {}
func (*NinEmbeddedStructUnion) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{21} }
type NinNestedStructUnion struct {
Field1 *NinOptNativeUnion `protobuf:"bytes,1,opt,name=Field1" json:"Field1,omitempty"`
Field2 *NinOptStructUnion `protobuf:"bytes,2,opt,name=Field2" json:"Field2,omitempty"`
Field3 *NinEmbeddedStructUnion `protobuf:"bytes,3,opt,name=Field3" json:"Field3,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinNestedStructUnion) Reset() { *m = NinNestedStructUnion{} }
func (*NinNestedStructUnion) ProtoMessage() {}
func (*NinNestedStructUnion) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{22} }
type Tree struct {
Or *OrBranch `protobuf:"bytes,1,opt,name=Or" json:"Or,omitempty"`
And *AndBranch `protobuf:"bytes,2,opt,name=And" json:"And,omitempty"`
Leaf *Leaf `protobuf:"bytes,3,opt,name=Leaf" json:"Leaf,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Tree) Reset() { *m = Tree{} }
func (*Tree) ProtoMessage() {}
func (*Tree) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{23} }
type OrBranch struct {
Left Tree `protobuf:"bytes,1,opt,name=Left" json:"Left"`
Right Tree `protobuf:"bytes,2,opt,name=Right" json:"Right"`
XXX_unrecognized []byte `json:"-"`
}
func (m *OrBranch) Reset() { *m = OrBranch{} }
func (*OrBranch) ProtoMessage() {}
func (*OrBranch) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{24} }
type AndBranch struct {
Left Tree `protobuf:"bytes,1,opt,name=Left" json:"Left"`
Right Tree `protobuf:"bytes,2,opt,name=Right" json:"Right"`
XXX_unrecognized []byte `json:"-"`
}
func (m *AndBranch) Reset() { *m = AndBranch{} }
func (*AndBranch) ProtoMessage() {}
func (*AndBranch) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{25} }
type Leaf struct {
Value int64 `protobuf:"varint,1,opt,name=Value" json:"Value"`
StrValue string `protobuf:"bytes,2,opt,name=StrValue" json:"StrValue"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Leaf) Reset() { *m = Leaf{} }
func (*Leaf) ProtoMessage() {}
func (*Leaf) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{26} }
type DeepTree struct {
Down *ADeepBranch `protobuf:"bytes,1,opt,name=Down" json:"Down,omitempty"`
And *AndDeepBranch `protobuf:"bytes,2,opt,name=And" json:"And,omitempty"`
Leaf *DeepLeaf `protobuf:"bytes,3,opt,name=Leaf" json:"Leaf,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DeepTree) Reset() { *m = DeepTree{} }
func (*DeepTree) ProtoMessage() {}
func (*DeepTree) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{27} }
type ADeepBranch struct {
Down DeepTree `protobuf:"bytes,2,opt,name=Down" json:"Down"`
XXX_unrecognized []byte `json:"-"`
}
func (m *ADeepBranch) Reset() { *m = ADeepBranch{} }
func (*ADeepBranch) ProtoMessage() {}
func (*ADeepBranch) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{28} }
type AndDeepBranch struct {
Left DeepTree `protobuf:"bytes,1,opt,name=Left" json:"Left"`
Right DeepTree `protobuf:"bytes,2,opt,name=Right" json:"Right"`
XXX_unrecognized []byte `json:"-"`
}
func (m *AndDeepBranch) Reset() { *m = AndDeepBranch{} }
func (*AndDeepBranch) ProtoMessage() {}
func (*AndDeepBranch) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{29} }
type DeepLeaf struct {
Tree Tree `protobuf:"bytes,1,opt,name=Tree" json:"Tree"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DeepLeaf) Reset() { *m = DeepLeaf{} }
func (*DeepLeaf) ProtoMessage() {}
func (*DeepLeaf) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{30} }
type Nil struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *Nil) Reset() { *m = Nil{} }
func (*Nil) ProtoMessage() {}
func (*Nil) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{31} }
type NidOptEnum struct {
Field1 TheTestEnum `protobuf:"varint,1,opt,name=Field1,enum=test.TheTestEnum" json:"Field1"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidOptEnum) Reset() { *m = NidOptEnum{} }
func (*NidOptEnum) ProtoMessage() {}
func (*NidOptEnum) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{32} }
type NinOptEnum struct {
Field1 *TheTestEnum `protobuf:"varint,1,opt,name=Field1,enum=test.TheTestEnum" json:"Field1,omitempty"`
Field2 *YetAnotherTestEnum `protobuf:"varint,2,opt,name=Field2,enum=test.YetAnotherTestEnum" json:"Field2,omitempty"`
Field3 *YetYetAnotherTestEnum `protobuf:"varint,3,opt,name=Field3,enum=test.YetYetAnotherTestEnum" json:"Field3,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptEnum) Reset() { *m = NinOptEnum{} }
func (*NinOptEnum) ProtoMessage() {}
func (*NinOptEnum) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{33} }
type NidRepEnum struct {
Field1 []TheTestEnum `protobuf:"varint,1,rep,name=Field1,enum=test.TheTestEnum" json:"Field1,omitempty"`
Field2 []YetAnotherTestEnum `protobuf:"varint,2,rep,name=Field2,enum=test.YetAnotherTestEnum" json:"Field2,omitempty"`
Field3 []YetYetAnotherTestEnum `protobuf:"varint,3,rep,name=Field3,enum=test.YetYetAnotherTestEnum" json:"Field3,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidRepEnum) Reset() { *m = NidRepEnum{} }
func (*NidRepEnum) ProtoMessage() {}
func (*NidRepEnum) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{34} }
type NinRepEnum struct {
Field1 []TheTestEnum `protobuf:"varint,1,rep,name=Field1,enum=test.TheTestEnum" json:"Field1,omitempty"`
Field2 []YetAnotherTestEnum `protobuf:"varint,2,rep,name=Field2,enum=test.YetAnotherTestEnum" json:"Field2,omitempty"`
Field3 []YetYetAnotherTestEnum `protobuf:"varint,3,rep,name=Field3,enum=test.YetYetAnotherTestEnum" json:"Field3,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinRepEnum) Reset() { *m = NinRepEnum{} }
func (*NinRepEnum) ProtoMessage() {}
func (*NinRepEnum) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{35} }
type NinOptEnumDefault struct {
Field1 *TheTestEnum `protobuf:"varint,1,opt,name=Field1,enum=test.TheTestEnum,def=2" json:"Field1,omitempty"`
Field2 *YetAnotherTestEnum `protobuf:"varint,2,opt,name=Field2,enum=test.YetAnotherTestEnum,def=1" json:"Field2,omitempty"`
Field3 *YetYetAnotherTestEnum `protobuf:"varint,3,opt,name=Field3,enum=test.YetYetAnotherTestEnum,def=0" json:"Field3,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptEnumDefault) Reset() { *m = NinOptEnumDefault{} }
func (*NinOptEnumDefault) ProtoMessage() {}
func (*NinOptEnumDefault) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{36} }
const Default_NinOptEnumDefault_Field1 TheTestEnum = C
const Default_NinOptEnumDefault_Field2 YetAnotherTestEnum = BetterYetBB
const Default_NinOptEnumDefault_Field3 YetYetAnotherTestEnum = YetYetAnotherTestEnum_CC
func (m *NinOptEnumDefault) GetField1() TheTestEnum {
if m != nil && m.Field1 != nil {
return *m.Field1
}
return Default_NinOptEnumDefault_Field1
}
func (m *NinOptEnumDefault) GetField2() YetAnotherTestEnum {
if m != nil && m.Field2 != nil {
return *m.Field2
}
return Default_NinOptEnumDefault_Field2
}
func (m *NinOptEnumDefault) GetField3() YetYetAnotherTestEnum {
if m != nil && m.Field3 != nil {
return *m.Field3
}
return Default_NinOptEnumDefault_Field3
}
type AnotherNinOptEnum struct {
Field1 *AnotherTestEnum `protobuf:"varint,1,opt,name=Field1,enum=test.AnotherTestEnum" json:"Field1,omitempty"`
Field2 *YetAnotherTestEnum `protobuf:"varint,2,opt,name=Field2,enum=test.YetAnotherTestEnum" json:"Field2,omitempty"`
Field3 *YetYetAnotherTestEnum `protobuf:"varint,3,opt,name=Field3,enum=test.YetYetAnotherTestEnum" json:"Field3,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *AnotherNinOptEnum) Reset() { *m = AnotherNinOptEnum{} }
func (*AnotherNinOptEnum) ProtoMessage() {}
func (*AnotherNinOptEnum) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{37} }
type AnotherNinOptEnumDefault struct {
Field1 *AnotherTestEnum `protobuf:"varint,1,opt,name=Field1,enum=test.AnotherTestEnum,def=11" json:"Field1,omitempty"`
Field2 *YetAnotherTestEnum `protobuf:"varint,2,opt,name=Field2,enum=test.YetAnotherTestEnum,def=1" json:"Field2,omitempty"`
Field3 *YetYetAnotherTestEnum `protobuf:"varint,3,opt,name=Field3,enum=test.YetYetAnotherTestEnum,def=0" json:"Field3,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *AnotherNinOptEnumDefault) Reset() { *m = AnotherNinOptEnumDefault{} }
func (*AnotherNinOptEnumDefault) ProtoMessage() {}
func (*AnotherNinOptEnumDefault) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{38} }
const Default_AnotherNinOptEnumDefault_Field1 AnotherTestEnum = E
const Default_AnotherNinOptEnumDefault_Field2 YetAnotherTestEnum = BetterYetBB
const Default_AnotherNinOptEnumDefault_Field3 YetYetAnotherTestEnum = YetYetAnotherTestEnum_CC
func (m *AnotherNinOptEnumDefault) GetField1() AnotherTestEnum {
if m != nil && m.Field1 != nil {
return *m.Field1
}
return Default_AnotherNinOptEnumDefault_Field1
}
func (m *AnotherNinOptEnumDefault) GetField2() YetAnotherTestEnum {
if m != nil && m.Field2 != nil {
return *m.Field2
}
return Default_AnotherNinOptEnumDefault_Field2
}
func (m *AnotherNinOptEnumDefault) GetField3() YetYetAnotherTestEnum {
if m != nil && m.Field3 != nil {
return *m.Field3
}
return Default_AnotherNinOptEnumDefault_Field3
}
type Timer struct {
Time1 int64 `protobuf:"fixed64,1,opt,name=Time1" json:"Time1"`
Time2 int64 `protobuf:"fixed64,2,opt,name=Time2" json:"Time2"`
Data []byte `protobuf:"bytes,3,opt,name=Data" json:"Data"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Timer) Reset() { *m = Timer{} }
func (*Timer) ProtoMessage() {}
func (*Timer) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{39} }
type MyExtendable struct {
Field1 *int64 `protobuf:"varint,1,opt,name=Field1" json:"Field1,omitempty"`
proto.XXX_InternalExtensions `json:"-"`
XXX_unrecognized []byte `json:"-"`
}
func (m *MyExtendable) Reset() { *m = MyExtendable{} }
func (*MyExtendable) ProtoMessage() {}
func (*MyExtendable) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{40} }
var extRange_MyExtendable = []proto.ExtensionRange{
{Start: 100, End: 199},
}
func (*MyExtendable) ExtensionRangeArray() []proto.ExtensionRange {
return extRange_MyExtendable
}
type OtherExtenable struct {
Field2 *int64 `protobuf:"varint,2,opt,name=Field2" json:"Field2,omitempty"`
Field13 *int64 `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"`
M *MyExtendable `protobuf:"bytes,1,opt,name=M" json:"M,omitempty"`
proto.XXX_InternalExtensions `json:"-"`
XXX_unrecognized []byte `json:"-"`
}
func (m *OtherExtenable) Reset() { *m = OtherExtenable{} }
func (*OtherExtenable) ProtoMessage() {}
func (*OtherExtenable) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{41} }
var extRange_OtherExtenable = []proto.ExtensionRange{
{Start: 14, End: 16},
{Start: 10, End: 12},
}
func (*OtherExtenable) ExtensionRangeArray() []proto.ExtensionRange {
return extRange_OtherExtenable
}
type NestedDefinition struct {
Field1 *int64 `protobuf:"varint,1,opt,name=Field1" json:"Field1,omitempty"`
EnumField *NestedDefinition_NestedEnum `protobuf:"varint,2,opt,name=EnumField,enum=test.NestedDefinition_NestedEnum" json:"EnumField,omitempty"`
NNM *NestedDefinition_NestedMessage_NestedNestedMsg `protobuf:"bytes,3,opt,name=NNM" json:"NNM,omitempty"`
NM *NestedDefinition_NestedMessage `protobuf:"bytes,4,opt,name=NM" json:"NM,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NestedDefinition) Reset() { *m = NestedDefinition{} }
func (*NestedDefinition) ProtoMessage() {}
func (*NestedDefinition) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{42} }
type NestedDefinition_NestedMessage struct {
NestedField1 *uint64 `protobuf:"fixed64,1,opt,name=NestedField1" json:"NestedField1,omitempty"`
NNM *NestedDefinition_NestedMessage_NestedNestedMsg `protobuf:"bytes,2,opt,name=NNM" json:"NNM,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NestedDefinition_NestedMessage) Reset() { *m = NestedDefinition_NestedMessage{} }
func (*NestedDefinition_NestedMessage) ProtoMessage() {}
func (*NestedDefinition_NestedMessage) Descriptor() ([]byte, []int) {
return fileDescriptorThetest, []int{42, 0}
}
type NestedDefinition_NestedMessage_NestedNestedMsg struct {
NestedNestedField1 *string `protobuf:"bytes,10,opt,name=NestedNestedField1" json:"NestedNestedField1,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NestedDefinition_NestedMessage_NestedNestedMsg) Reset() {
*m = NestedDefinition_NestedMessage_NestedNestedMsg{}
}
func (*NestedDefinition_NestedMessage_NestedNestedMsg) ProtoMessage() {}
func (*NestedDefinition_NestedMessage_NestedNestedMsg) Descriptor() ([]byte, []int) {
return fileDescriptorThetest, []int{42, 0, 0}
}
type NestedScope struct {
A *NestedDefinition_NestedMessage_NestedNestedMsg `protobuf:"bytes,1,opt,name=A" json:"A,omitempty"`
B *NestedDefinition_NestedEnum `protobuf:"varint,2,opt,name=B,enum=test.NestedDefinition_NestedEnum" json:"B,omitempty"`
C *NestedDefinition_NestedMessage `protobuf:"bytes,3,opt,name=C" json:"C,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NestedScope) Reset() { *m = NestedScope{} }
func (*NestedScope) ProtoMessage() {}
func (*NestedScope) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{43} }
type NinOptNativeDefault struct {
Field1 *float64 `protobuf:"fixed64,1,opt,name=Field1,def=1234.1234" json:"Field1,omitempty"`
Field2 *float32 `protobuf:"fixed32,2,opt,name=Field2,def=1234.1234" json:"Field2,omitempty"`
Field3 *int32 `protobuf:"varint,3,opt,name=Field3,def=1234" json:"Field3,omitempty"`
Field4 *int64 `protobuf:"varint,4,opt,name=Field4,def=1234" json:"Field4,omitempty"`
Field5 *uint32 `protobuf:"varint,5,opt,name=Field5,def=1234" json:"Field5,omitempty"`
Field6 *uint64 `protobuf:"varint,6,opt,name=Field6,def=1234" json:"Field6,omitempty"`
Field7 *int32 `protobuf:"zigzag32,7,opt,name=Field7,def=1234" json:"Field7,omitempty"`
Field8 *int64 `protobuf:"zigzag64,8,opt,name=Field8,def=1234" json:"Field8,omitempty"`
Field9 *uint32 `protobuf:"fixed32,9,opt,name=Field9,def=1234" json:"Field9,omitempty"`
Field10 *int32 `protobuf:"fixed32,10,opt,name=Field10,def=1234" json:"Field10,omitempty"`
Field11 *uint64 `protobuf:"fixed64,11,opt,name=Field11,def=1234" json:"Field11,omitempty"`
Field12 *int64 `protobuf:"fixed64,12,opt,name=Field12,def=1234" json:"Field12,omitempty"`
Field13 *bool `protobuf:"varint,13,opt,name=Field13,def=1" json:"Field13,omitempty"`
Field14 *string `protobuf:"bytes,14,opt,name=Field14,def=1234" json:"Field14,omitempty"`
Field15 []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptNativeDefault) Reset() { *m = NinOptNativeDefault{} }
func (*NinOptNativeDefault) ProtoMessage() {}
func (*NinOptNativeDefault) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{44} }
const Default_NinOptNativeDefault_Field1 float64 = 1234.1234
const Default_NinOptNativeDefault_Field2 float32 = 1234.1234
const Default_NinOptNativeDefault_Field3 int32 = 1234
const Default_NinOptNativeDefault_Field4 int64 = 1234
const Default_NinOptNativeDefault_Field5 uint32 = 1234
const Default_NinOptNativeDefault_Field6 uint64 = 1234
const Default_NinOptNativeDefault_Field7 int32 = 1234
const Default_NinOptNativeDefault_Field8 int64 = 1234
const Default_NinOptNativeDefault_Field9 uint32 = 1234
const Default_NinOptNativeDefault_Field10 int32 = 1234
const Default_NinOptNativeDefault_Field11 uint64 = 1234
const Default_NinOptNativeDefault_Field12 int64 = 1234
const Default_NinOptNativeDefault_Field13 bool = true
const Default_NinOptNativeDefault_Field14 string = "1234"
func (m *NinOptNativeDefault) GetField1() float64 {
if m != nil && m.Field1 != nil {
return *m.Field1
}
return Default_NinOptNativeDefault_Field1
}
func (m *NinOptNativeDefault) GetField2() float32 {
if m != nil && m.Field2 != nil {
return *m.Field2
}
return Default_NinOptNativeDefault_Field2
}
func (m *NinOptNativeDefault) GetField3() int32 {
if m != nil && m.Field3 != nil {
return *m.Field3
}
return Default_NinOptNativeDefault_Field3
}
func (m *NinOptNativeDefault) GetField4() int64 {
if m != nil && m.Field4 != nil {
return *m.Field4
}
return Default_NinOptNativeDefault_Field4
}
func (m *NinOptNativeDefault) GetField5() uint32 {
if m != nil && m.Field5 != nil {
return *m.Field5
}
return Default_NinOptNativeDefault_Field5
}
func (m *NinOptNativeDefault) GetField6() uint64 {
if m != nil && m.Field6 != nil {
return *m.Field6
}
return Default_NinOptNativeDefault_Field6
}
func (m *NinOptNativeDefault) GetField7() int32 {
if m != nil && m.Field7 != nil {
return *m.Field7
}
return Default_NinOptNativeDefault_Field7
}
func (m *NinOptNativeDefault) GetField8() int64 {
if m != nil && m.Field8 != nil {
return *m.Field8
}
return Default_NinOptNativeDefault_Field8
}
func (m *NinOptNativeDefault) GetField9() uint32 {
if m != nil && m.Field9 != nil {
return *m.Field9
}
return Default_NinOptNativeDefault_Field9
}
func (m *NinOptNativeDefault) GetField10() int32 {
if m != nil && m.Field10 != nil {
return *m.Field10
}
return Default_NinOptNativeDefault_Field10
}
func (m *NinOptNativeDefault) GetField11() uint64 {
if m != nil && m.Field11 != nil {
return *m.Field11
}
return Default_NinOptNativeDefault_Field11
}
func (m *NinOptNativeDefault) GetField12() int64 {
if m != nil && m.Field12 != nil {
return *m.Field12
}
return Default_NinOptNativeDefault_Field12
}
func (m *NinOptNativeDefault) GetField13() bool {
if m != nil && m.Field13 != nil {
return *m.Field13
}
return Default_NinOptNativeDefault_Field13
}
func (m *NinOptNativeDefault) GetField14() string {
if m != nil && m.Field14 != nil {
return *m.Field14
}
return Default_NinOptNativeDefault_Field14
}
func (m *NinOptNativeDefault) GetField15() []byte {
if m != nil {
return m.Field15
}
return nil
}
type CustomContainer struct {
CustomStruct NidOptCustom `protobuf:"bytes,1,opt,name=CustomStruct" json:"CustomStruct"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomContainer) Reset() { *m = CustomContainer{} }
func (*CustomContainer) ProtoMessage() {}
func (*CustomContainer) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{45} }
type CustomNameNidOptNative struct {
FieldA float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1"`
FieldB float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2"`
FieldC int32 `protobuf:"varint,3,opt,name=Field3" json:"Field3"`
FieldD int64 `protobuf:"varint,4,opt,name=Field4" json:"Field4"`
FieldE uint32 `protobuf:"varint,5,opt,name=Field5" json:"Field5"`
FieldF uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6"`
FieldG int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7"`
FieldH int64 `protobuf:"zigzag64,8,opt,name=Field8" json:"Field8"`
FieldI uint32 `protobuf:"fixed32,9,opt,name=Field9" json:"Field9"`
FieldJ int32 `protobuf:"fixed32,10,opt,name=Field10" json:"Field10"`
FieldK uint64 `protobuf:"fixed64,11,opt,name=Field11" json:"Field11"`
FieldL int64 `protobuf:"fixed64,12,opt,name=Field12" json:"Field12"`
FieldM bool `protobuf:"varint,13,opt,name=Field13" json:"Field13"`
FieldN string `protobuf:"bytes,14,opt,name=Field14" json:"Field14"`
FieldO []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomNameNidOptNative) Reset() { *m = CustomNameNidOptNative{} }
func (*CustomNameNidOptNative) ProtoMessage() {}
func (*CustomNameNidOptNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{46} }
type CustomNameNinOptNative struct {
FieldA *float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1,omitempty"`
FieldB *float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2,omitempty"`
FieldC *int32 `protobuf:"varint,3,opt,name=Field3" json:"Field3,omitempty"`
FieldD *int64 `protobuf:"varint,4,opt,name=Field4" json:"Field4,omitempty"`
FieldE *uint32 `protobuf:"varint,5,opt,name=Field5" json:"Field5,omitempty"`
FieldF *uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6,omitempty"`
FieldG *int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7,omitempty"`
FieldH *int64 `protobuf:"zigzag64,8,opt,name=Field8" json:"Field8,omitempty"`
FieldI *uint32 `protobuf:"fixed32,9,opt,name=Field9" json:"Field9,omitempty"`
FieldJ *int32 `protobuf:"fixed32,10,opt,name=Field10" json:"Field10,omitempty"`
FieldK *uint64 `protobuf:"fixed64,11,opt,name=Field11" json:"Field11,omitempty"`
FielL *int64 `protobuf:"fixed64,12,opt,name=Field12" json:"Field12,omitempty"`
FieldM *bool `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"`
FieldN *string `protobuf:"bytes,14,opt,name=Field14" json:"Field14,omitempty"`
FieldO []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomNameNinOptNative) Reset() { *m = CustomNameNinOptNative{} }
func (*CustomNameNinOptNative) ProtoMessage() {}
func (*CustomNameNinOptNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{47} }
type CustomNameNinRepNative struct {
FieldA []float64 `protobuf:"fixed64,1,rep,name=Field1" json:"Field1,omitempty"`
FieldB []float32 `protobuf:"fixed32,2,rep,name=Field2" json:"Field2,omitempty"`
FieldC []int32 `protobuf:"varint,3,rep,name=Field3" json:"Field3,omitempty"`
FieldD []int64 `protobuf:"varint,4,rep,name=Field4" json:"Field4,omitempty"`
FieldE []uint32 `protobuf:"varint,5,rep,name=Field5" json:"Field5,omitempty"`
FieldF []uint64 `protobuf:"varint,6,rep,name=Field6" json:"Field6,omitempty"`
FieldG []int32 `protobuf:"zigzag32,7,rep,name=Field7" json:"Field7,omitempty"`
FieldH []int64 `protobuf:"zigzag64,8,rep,name=Field8" json:"Field8,omitempty"`
FieldI []uint32 `protobuf:"fixed32,9,rep,name=Field9" json:"Field9,omitempty"`
FieldJ []int32 `protobuf:"fixed32,10,rep,name=Field10" json:"Field10,omitempty"`
FieldK []uint64 `protobuf:"fixed64,11,rep,name=Field11" json:"Field11,omitempty"`
FieldL []int64 `protobuf:"fixed64,12,rep,name=Field12" json:"Field12,omitempty"`
FieldM []bool `protobuf:"varint,13,rep,name=Field13" json:"Field13,omitempty"`
FieldN []string `protobuf:"bytes,14,rep,name=Field14" json:"Field14,omitempty"`
FieldO [][]byte `protobuf:"bytes,15,rep,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomNameNinRepNative) Reset() { *m = CustomNameNinRepNative{} }
func (*CustomNameNinRepNative) ProtoMessage() {}
func (*CustomNameNinRepNative) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{48} }
type CustomNameNinStruct struct {
FieldA *float64 `protobuf:"fixed64,1,opt,name=Field1" json:"Field1,omitempty"`
FieldB *float32 `protobuf:"fixed32,2,opt,name=Field2" json:"Field2,omitempty"`
FieldC *NidOptNative `protobuf:"bytes,3,opt,name=Field3" json:"Field3,omitempty"`
FieldD []*NinOptNative `protobuf:"bytes,4,rep,name=Field4" json:"Field4,omitempty"`
FieldE *uint64 `protobuf:"varint,6,opt,name=Field6" json:"Field6,omitempty"`
FieldF *int32 `protobuf:"zigzag32,7,opt,name=Field7" json:"Field7,omitempty"`
FieldG *NidOptNative `protobuf:"bytes,8,opt,name=Field8" json:"Field8,omitempty"`
FieldH *bool `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"`
FieldI *string `protobuf:"bytes,14,opt,name=Field14" json:"Field14,omitempty"`
FieldJ []byte `protobuf:"bytes,15,opt,name=Field15" json:"Field15,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomNameNinStruct) Reset() { *m = CustomNameNinStruct{} }
func (*CustomNameNinStruct) ProtoMessage() {}
func (*CustomNameNinStruct) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{49} }
type CustomNameCustomType struct {
FieldA *Uuid `protobuf:"bytes,1,opt,name=Id,customtype=Uuid" json:"Id,omitempty"`
FieldB *github_com_gogo_protobuf_test_custom.Uint128 `protobuf:"bytes,2,opt,name=Value,customtype=github.com/gogo/protobuf/test/custom.Uint128" json:"Value,omitempty"`
FieldC []Uuid `protobuf:"bytes,3,rep,name=Ids,customtype=Uuid" json:"Ids,omitempty"`
FieldD []github_com_gogo_protobuf_test_custom.Uint128 `protobuf:"bytes,4,rep,name=Values,customtype=github.com/gogo/protobuf/test/custom.Uint128" json:"Values,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomNameCustomType) Reset() { *m = CustomNameCustomType{} }
func (*CustomNameCustomType) ProtoMessage() {}
func (*CustomNameCustomType) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{50} }
type CustomNameNinEmbeddedStructUnion struct {
*NidOptNative `protobuf:"bytes,1,opt,name=Field1,embedded=Field1" json:"Field1,omitempty"`
FieldA *NinOptNative `protobuf:"bytes,200,opt,name=Field200" json:"Field200,omitempty"`
FieldB *bool `protobuf:"varint,210,opt,name=Field210" json:"Field210,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomNameNinEmbeddedStructUnion) Reset() { *m = CustomNameNinEmbeddedStructUnion{} }
func (*CustomNameNinEmbeddedStructUnion) ProtoMessage() {}
func (*CustomNameNinEmbeddedStructUnion) Descriptor() ([]byte, []int) {
return fileDescriptorThetest, []int{51}
}
type CustomNameEnum struct {
FieldA *TheTestEnum `protobuf:"varint,1,opt,name=Field1,enum=test.TheTestEnum" json:"Field1,omitempty"`
FieldB []TheTestEnum `protobuf:"varint,2,rep,name=Field2,enum=test.TheTestEnum" json:"Field2,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CustomNameEnum) Reset() { *m = CustomNameEnum{} }
func (*CustomNameEnum) ProtoMessage() {}
func (*CustomNameEnum) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{52} }
type NoExtensionsMap struct {
Field1 *int64 `protobuf:"varint,1,opt,name=Field1" json:"Field1,omitempty"`
XXX_extensions []byte `protobuf:"bytes,0,opt" json:"-"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NoExtensionsMap) Reset() { *m = NoExtensionsMap{} }
func (*NoExtensionsMap) ProtoMessage() {}
func (*NoExtensionsMap) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{53} }
var extRange_NoExtensionsMap = []proto.ExtensionRange{
{Start: 100, End: 199},
}
func (*NoExtensionsMap) ExtensionRangeArray() []proto.ExtensionRange {
return extRange_NoExtensionsMap
}
func (m *NoExtensionsMap) GetExtensions() *[]byte {
if m.XXX_extensions == nil {
m.XXX_extensions = make([]byte, 0)
}
return &m.XXX_extensions
}
type Unrecognized struct {
Field1 *string `protobuf:"bytes,1,opt,name=Field1" json:"Field1,omitempty"`
}
func (m *Unrecognized) Reset() { *m = Unrecognized{} }
func (*Unrecognized) ProtoMessage() {}
func (*Unrecognized) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{54} }
type UnrecognizedWithInner struct {
Embedded []*UnrecognizedWithInner_Inner `protobuf:"bytes,1,rep,name=embedded" json:"embedded,omitempty"`
Field2 *string `protobuf:"bytes,2,opt,name=Field2" json:"Field2,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *UnrecognizedWithInner) Reset() { *m = UnrecognizedWithInner{} }
func (*UnrecognizedWithInner) ProtoMessage() {}
func (*UnrecognizedWithInner) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{55} }
type UnrecognizedWithInner_Inner struct {
Field1 *uint32 `protobuf:"varint,1,opt,name=Field1" json:"Field1,omitempty"`
}
func (m *UnrecognizedWithInner_Inner) Reset() { *m = UnrecognizedWithInner_Inner{} }
func (*UnrecognizedWithInner_Inner) ProtoMessage() {}
func (*UnrecognizedWithInner_Inner) Descriptor() ([]byte, []int) {
return fileDescriptorThetest, []int{55, 0}
}
type UnrecognizedWithEmbed struct {
UnrecognizedWithEmbed_Embedded `protobuf:"bytes,1,opt,name=embedded,embedded=embedded" json:"embedded"`
Field2 *string `protobuf:"bytes,2,opt,name=Field2" json:"Field2,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *UnrecognizedWithEmbed) Reset() { *m = UnrecognizedWithEmbed{} }
func (*UnrecognizedWithEmbed) ProtoMessage() {}
func (*UnrecognizedWithEmbed) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{56} }
type UnrecognizedWithEmbed_Embedded struct {
Field1 *uint32 `protobuf:"varint,1,opt,name=Field1" json:"Field1,omitempty"`
}
func (m *UnrecognizedWithEmbed_Embedded) Reset() { *m = UnrecognizedWithEmbed_Embedded{} }
func (*UnrecognizedWithEmbed_Embedded) ProtoMessage() {}
func (*UnrecognizedWithEmbed_Embedded) Descriptor() ([]byte, []int) {
return fileDescriptorThetest, []int{56, 0}
}
type Node struct {
Label *string `protobuf:"bytes,1,opt,name=Label" json:"Label,omitempty"`
Children []*Node `protobuf:"bytes,2,rep,name=Children" json:"Children,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Node) Reset() { *m = Node{} }
func (*Node) ProtoMessage() {}
func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{57} }
type NonByteCustomType struct {
Field1 *T `protobuf:"bytes,1,opt,name=Field1,customtype=T" json:"Field1,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NonByteCustomType) Reset() { *m = NonByteCustomType{} }
func (*NonByteCustomType) ProtoMessage() {}
func (*NonByteCustomType) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{58} }
type NidOptNonByteCustomType struct {
Field1 T `protobuf:"bytes,1,opt,name=Field1,customtype=T" json:"Field1"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidOptNonByteCustomType) Reset() { *m = NidOptNonByteCustomType{} }
func (*NidOptNonByteCustomType) ProtoMessage() {}
func (*NidOptNonByteCustomType) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{59} }
type NinOptNonByteCustomType struct {
Field1 *T `protobuf:"bytes,1,opt,name=Field1,customtype=T" json:"Field1,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinOptNonByteCustomType) Reset() { *m = NinOptNonByteCustomType{} }
func (*NinOptNonByteCustomType) ProtoMessage() {}
func (*NinOptNonByteCustomType) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{60} }
type NidRepNonByteCustomType struct {
Field1 []T `protobuf:"bytes,1,rep,name=Field1,customtype=T" json:"Field1"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NidRepNonByteCustomType) Reset() { *m = NidRepNonByteCustomType{} }
func (*NidRepNonByteCustomType) ProtoMessage() {}
func (*NidRepNonByteCustomType) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{61} }
type NinRepNonByteCustomType struct {
Field1 []T `protobuf:"bytes,1,rep,name=Field1,customtype=T" json:"Field1,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *NinRepNonByteCustomType) Reset() { *m = NinRepNonByteCustomType{} }
func (*NinRepNonByteCustomType) ProtoMessage() {}
func (*NinRepNonByteCustomType) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{62} }
type ProtoType struct {
Field2 *string `protobuf:"bytes,1,opt,name=Field2" json:"Field2,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *ProtoType) Reset() { *m = ProtoType{} }
func (*ProtoType) ProtoMessage() {}
func (*ProtoType) Descriptor() ([]byte, []int) { return fileDescriptorThetest, []int{63} }
var E_FieldA = &proto.ExtensionDesc{
ExtendedType: (*MyExtendable)(nil),
ExtensionType: (*float64)(nil),
Field: 100,
Name: "test.FieldA",
Tag: "fixed64,100,opt,name=FieldA",
Filename: "combos/marshaler/thetest.proto",
}
var E_FieldB = &proto.ExtensionDesc{
ExtendedType: (*MyExtendable)(nil),
ExtensionType: (*NinOptNative)(nil),
Field: 101,
Name: "test.FieldB",
Tag: "bytes,101,opt,name=FieldB",
Filename: "combos/marshaler/thetest.proto",
}
var E_FieldC = &proto.ExtensionDesc{
ExtendedType: (*MyExtendable)(nil),
ExtensionType: (*NinEmbeddedStruct)(nil),
Field: 102,
Name: "test.FieldC",
Tag: "bytes,102,opt,name=FieldC",
Filename: "combos/marshaler/thetest.proto",
}
var E_FieldD = &proto.ExtensionDesc{
ExtendedType: (*MyExtendable)(nil),
ExtensionType: ([]int64)(nil),
Field: 104,
Name: "test.FieldD",
Tag: "varint,104,rep,name=FieldD",
Filename: "combos/marshaler/thetest.proto",
}
var E_FieldE = &proto.ExtensionDesc{
ExtendedType: (*MyExtendable)(nil),
ExtensionType: ([]*NinOptNative)(nil),
Field: 105,
Name: "test.FieldE",
Tag: "bytes,105,rep,name=FieldE",
Filename: "combos/marshaler/thetest.proto",
}
var E_FieldA1 = &proto.ExtensionDesc{
ExtendedType: (*NoExtensionsMap)(nil),
ExtensionType: (*float64)(nil),
Field: 100,
Name: "test.FieldA1",
Tag: "fixed64,100,opt,name=FieldA1",
Filename: "combos/marshaler/thetest.proto",
}
var E_FieldB1 = &proto.ExtensionDesc{
ExtendedType: (*NoExtensionsMap)(nil),
ExtensionType: (*NinOptNative)(nil),
Field: 101,
Name: "test.FieldB1",
Tag: "bytes,101,opt,name=FieldB1",
Filename: "combos/marshaler/thetest.proto",
}
var E_FieldC1 = &proto.ExtensionDesc{
ExtendedType: (*NoExtensionsMap)(nil),
ExtensionType: (*NinEmbeddedStruct)(nil),
Field: 102,
Name: "test.FieldC1",
Tag: "bytes,102,opt,name=FieldC1",
Filename: "combos/marshaler/thetest.proto",
}
func init() {
proto.RegisterType((*NidOptNative)(nil), "test.NidOptNative")
proto.RegisterType((*NinOptNative)(nil), "test.NinOptNative")
proto.RegisterType((*NidRepNative)(nil), "test.NidRepNative")
proto.RegisterType((*NinRepNative)(nil), "test.NinRepNative")
proto.RegisterType((*NidRepPackedNative)(nil), "test.NidRepPackedNative")
proto.RegisterType((*NinRepPackedNative)(nil), "test.NinRepPackedNative")
proto.RegisterType((*NidOptStruct)(nil), "test.NidOptStruct")
proto.RegisterType((*NinOptStruct)(nil), "test.NinOptStruct")
proto.RegisterType((*NidRepStruct)(nil), "test.NidRepStruct")
proto.RegisterType((*NinRepStruct)(nil), "test.NinRepStruct")
proto.RegisterType((*NidEmbeddedStruct)(nil), "test.NidEmbeddedStruct")
proto.RegisterType((*NinEmbeddedStruct)(nil), "test.NinEmbeddedStruct")
proto.RegisterType((*NidNestedStruct)(nil), "test.NidNestedStruct")
proto.RegisterType((*NinNestedStruct)(nil), "test.NinNestedStruct")
proto.RegisterType((*NidOptCustom)(nil), "test.NidOptCustom")
proto.RegisterType((*CustomDash)(nil), "test.CustomDash")
proto.RegisterType((*NinOptCustom)(nil), "test.NinOptCustom")
proto.RegisterType((*NidRepCustom)(nil), "test.NidRepCustom")
proto.RegisterType((*NinRepCustom)(nil), "test.NinRepCustom")
proto.RegisterType((*NinOptNativeUnion)(nil), "test.NinOptNativeUnion")
proto.RegisterType((*NinOptStructUnion)(nil), "test.NinOptStructUnion")
proto.RegisterType((*NinEmbeddedStructUnion)(nil), "test.NinEmbeddedStructUnion")
proto.RegisterType((*NinNestedStructUnion)(nil), "test.NinNestedStructUnion")
proto.RegisterType((*Tree)(nil), "test.Tree")
proto.RegisterType((*OrBranch)(nil), "test.OrBranch")
proto.RegisterType((*AndBranch)(nil), "test.AndBranch")
proto.RegisterType((*Leaf)(nil), "test.Leaf")
proto.RegisterType((*DeepTree)(nil), "test.DeepTree")
proto.RegisterType((*ADeepBranch)(nil), "test.ADeepBranch")
proto.RegisterType((*AndDeepBranch)(nil), "test.AndDeepBranch")
proto.RegisterType((*DeepLeaf)(nil), "test.DeepLeaf")
proto.RegisterType((*Nil)(nil), "test.Nil")
proto.RegisterType((*NidOptEnum)(nil), "test.NidOptEnum")
proto.RegisterType((*NinOptEnum)(nil), "test.NinOptEnum")
proto.RegisterType((*NidRepEnum)(nil), "test.NidRepEnum")
proto.RegisterType((*NinRepEnum)(nil), "test.NinRepEnum")
proto.RegisterType((*NinOptEnumDefault)(nil), "test.NinOptEnumDefault")
proto.RegisterType((*AnotherNinOptEnum)(nil), "test.AnotherNinOptEnum")
proto.RegisterType((*AnotherNinOptEnumDefault)(nil), "test.AnotherNinOptEnumDefault")
proto.RegisterType((*Timer)(nil), "test.Timer")
proto.RegisterType((*MyExtendable)(nil), "test.MyExtendable")
proto.RegisterType((*OtherExtenable)(nil), "test.OtherExtenable")
proto.RegisterType((*NestedDefinition)(nil), "test.NestedDefinition")
proto.RegisterType((*NestedDefinition_NestedMessage)(nil), "test.NestedDefinition.NestedMessage")
proto.RegisterType((*NestedDefinition_NestedMessage_NestedNestedMsg)(nil), "test.NestedDefinition.NestedMessage.NestedNestedMsg")
proto.RegisterType((*NestedScope)(nil), "test.NestedScope")
proto.RegisterType((*NinOptNativeDefault)(nil), "test.NinOptNativeDefault")
proto.RegisterType((*CustomContainer)(nil), "test.CustomContainer")
proto.RegisterType((*CustomNameNidOptNative)(nil), "test.CustomNameNidOptNative")
proto.RegisterType((*CustomNameNinOptNative)(nil), "test.CustomNameNinOptNative")
proto.RegisterType((*CustomNameNinRepNative)(nil), "test.CustomNameNinRepNative")
proto.RegisterType((*CustomNameNinStruct)(nil), "test.CustomNameNinStruct")
proto.RegisterType((*CustomNameCustomType)(nil), "test.CustomNameCustomType")
proto.RegisterType((*CustomNameNinEmbeddedStructUnion)(nil), "test.CustomNameNinEmbeddedStructUnion")
proto.RegisterType((*CustomNameEnum)(nil), "test.CustomNameEnum")
proto.RegisterType((*NoExtensionsMap)(nil), "test.NoExtensionsMap")
proto.RegisterType((*Unrecognized)(nil), "test.Unrecognized")
proto.RegisterType((*UnrecognizedWithInner)(nil), "test.UnrecognizedWithInner")
proto.RegisterType((*UnrecognizedWithInner_Inner)(nil), "test.UnrecognizedWithInner.Inner")
proto.RegisterType((*UnrecognizedWithEmbed)(nil), "test.UnrecognizedWithEmbed")
proto.RegisterType((*UnrecognizedWithEmbed_Embedded)(nil), "test.UnrecognizedWithEmbed.Embedded")
proto.RegisterType((*Node)(nil), "test.Node")
proto.RegisterType((*NonByteCustomType)(nil), "test.NonByteCustomType")
proto.RegisterType((*NidOptNonByteCustomType)(nil), "test.NidOptNonByteCustomType")
proto.RegisterType((*NinOptNonByteCustomType)(nil), "test.NinOptNonByteCustomType")
proto.RegisterType((*NidRepNonByteCustomType)(nil), "test.NidRepNonByteCustomType")
proto.RegisterType((*NinRepNonByteCustomType)(nil), "test.NinRepNonByteCustomType")
proto.RegisterType((*ProtoType)(nil), "test.ProtoType")
proto.RegisterEnum("test.TheTestEnum", TheTestEnum_name, TheTestEnum_value)
proto.RegisterEnum("test.AnotherTestEnum", AnotherTestEnum_name, AnotherTestEnum_value)
proto.RegisterEnum("test.YetAnotherTestEnum", YetAnotherTestEnum_name, YetAnotherTestEnum_value)
proto.RegisterEnum("test.YetYetAnotherTestEnum", YetYetAnotherTestEnum_name, YetYetAnotherTestEnum_value)
proto.RegisterEnum("test.NestedDefinition_NestedEnum", NestedDefinition_NestedEnum_name, NestedDefinition_NestedEnum_value)
proto.RegisterExtension(E_FieldA)
proto.RegisterExtension(E_FieldB)
proto.RegisterExtension(E_FieldC)
proto.RegisterExtension(E_FieldD)
proto.RegisterExtension(E_FieldE)
proto.RegisterExtension(E_FieldA1)
proto.RegisterExtension(E_FieldB1)
proto.RegisterExtension(E_FieldC1)
}
func (this *NidOptNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidOptNative)
if !ok {
that2, ok := that.(NidOptNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != that1.Field1 {
if this.Field1 < that1.Field1 {
return -1
}
return 1
}
if this.Field2 != that1.Field2 {
if this.Field2 < that1.Field2 {
return -1
}
return 1
}
if this.Field3 != that1.Field3 {
if this.Field3 < that1.Field3 {
return -1
}
return 1
}
if this.Field4 != that1.Field4 {
if this.Field4 < that1.Field4 {
return -1
}
return 1
}
if this.Field5 != that1.Field5 {
if this.Field5 < that1.Field5 {
return -1
}
return 1
}
if this.Field6 != that1.Field6 {
if this.Field6 < that1.Field6 {
return -1
}
return 1
}
if this.Field7 != that1.Field7 {
if this.Field7 < that1.Field7 {
return -1
}
return 1
}
if this.Field8 != that1.Field8 {
if this.Field8 < that1.Field8 {
return -1
}
return 1
}
if this.Field9 != that1.Field9 {
if this.Field9 < that1.Field9 {
return -1
}
return 1
}
if this.Field10 != that1.Field10 {
if this.Field10 < that1.Field10 {
return -1
}
return 1
}
if this.Field11 != that1.Field11 {
if this.Field11 < that1.Field11 {
return -1
}
return 1
}
if this.Field12 != that1.Field12 {
if this.Field12 < that1.Field12 {
return -1
}
return 1
}
if this.Field13 != that1.Field13 {
if !this.Field13 {
return -1
}
return 1
}
if this.Field14 != that1.Field14 {
if this.Field14 < that1.Field14 {
return -1
}
return 1
}
if c := bytes.Compare(this.Field15, that1.Field15); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptNative)
if !ok {
that2, ok := that.(NinOptNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
if *this.Field3 < *that1.Field3 {
return -1
}
return 1
}
} else if this.Field3 != nil {
return 1
} else if that1.Field3 != nil {
return -1
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
if *this.Field4 < *that1.Field4 {
return -1
}
return 1
}
} else if this.Field4 != nil {
return 1
} else if that1.Field4 != nil {
return -1
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
if *this.Field5 < *that1.Field5 {
return -1
}
return 1
}
} else if this.Field5 != nil {
return 1
} else if that1.Field5 != nil {
return -1
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
if *this.Field6 < *that1.Field6 {
return -1
}
return 1
}
} else if this.Field6 != nil {
return 1
} else if that1.Field6 != nil {
return -1
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
if *this.Field7 < *that1.Field7 {
return -1
}
return 1
}
} else if this.Field7 != nil {
return 1
} else if that1.Field7 != nil {
return -1
}
if this.Field8 != nil && that1.Field8 != nil {
if *this.Field8 != *that1.Field8 {
if *this.Field8 < *that1.Field8 {
return -1
}
return 1
}
} else if this.Field8 != nil {
return 1
} else if that1.Field8 != nil {
return -1
}
if this.Field9 != nil && that1.Field9 != nil {
if *this.Field9 != *that1.Field9 {
if *this.Field9 < *that1.Field9 {
return -1
}
return 1
}
} else if this.Field9 != nil {
return 1
} else if that1.Field9 != nil {
return -1
}
if this.Field10 != nil && that1.Field10 != nil {
if *this.Field10 != *that1.Field10 {
if *this.Field10 < *that1.Field10 {
return -1
}
return 1
}
} else if this.Field10 != nil {
return 1
} else if that1.Field10 != nil {
return -1
}
if this.Field11 != nil && that1.Field11 != nil {
if *this.Field11 != *that1.Field11 {
if *this.Field11 < *that1.Field11 {
return -1
}
return 1
}
} else if this.Field11 != nil {
return 1
} else if that1.Field11 != nil {
return -1
}
if this.Field12 != nil && that1.Field12 != nil {
if *this.Field12 != *that1.Field12 {
if *this.Field12 < *that1.Field12 {
return -1
}
return 1
}
} else if this.Field12 != nil {
return 1
} else if that1.Field12 != nil {
return -1
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
if !*this.Field13 {
return -1
}
return 1
}
} else if this.Field13 != nil {
return 1
} else if that1.Field13 != nil {
return -1
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
if *this.Field14 < *that1.Field14 {
return -1
}
return 1
}
} else if this.Field14 != nil {
return 1
} else if that1.Field14 != nil {
return -1
}
if c := bytes.Compare(this.Field15, that1.Field15); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidRepNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidRepNative)
if !ok {
that2, ok := that.(NidRepNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
if this.Field3[i] < that1.Field3[i] {
return -1
}
return 1
}
}
if len(this.Field4) != len(that1.Field4) {
if len(this.Field4) < len(that1.Field4) {
return -1
}
return 1
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
if this.Field4[i] < that1.Field4[i] {
return -1
}
return 1
}
}
if len(this.Field5) != len(that1.Field5) {
if len(this.Field5) < len(that1.Field5) {
return -1
}
return 1
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
if this.Field5[i] < that1.Field5[i] {
return -1
}
return 1
}
}
if len(this.Field6) != len(that1.Field6) {
if len(this.Field6) < len(that1.Field6) {
return -1
}
return 1
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
if this.Field6[i] < that1.Field6[i] {
return -1
}
return 1
}
}
if len(this.Field7) != len(that1.Field7) {
if len(this.Field7) < len(that1.Field7) {
return -1
}
return 1
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
if this.Field7[i] < that1.Field7[i] {
return -1
}
return 1
}
}
if len(this.Field8) != len(that1.Field8) {
if len(this.Field8) < len(that1.Field8) {
return -1
}
return 1
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
if this.Field8[i] < that1.Field8[i] {
return -1
}
return 1
}
}
if len(this.Field9) != len(that1.Field9) {
if len(this.Field9) < len(that1.Field9) {
return -1
}
return 1
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
if this.Field9[i] < that1.Field9[i] {
return -1
}
return 1
}
}
if len(this.Field10) != len(that1.Field10) {
if len(this.Field10) < len(that1.Field10) {
return -1
}
return 1
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
if this.Field10[i] < that1.Field10[i] {
return -1
}
return 1
}
}
if len(this.Field11) != len(that1.Field11) {
if len(this.Field11) < len(that1.Field11) {
return -1
}
return 1
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
if this.Field11[i] < that1.Field11[i] {
return -1
}
return 1
}
}
if len(this.Field12) != len(that1.Field12) {
if len(this.Field12) < len(that1.Field12) {
return -1
}
return 1
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
if this.Field12[i] < that1.Field12[i] {
return -1
}
return 1
}
}
if len(this.Field13) != len(that1.Field13) {
if len(this.Field13) < len(that1.Field13) {
return -1
}
return 1
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
if !this.Field13[i] {
return -1
}
return 1
}
}
if len(this.Field14) != len(that1.Field14) {
if len(this.Field14) < len(that1.Field14) {
return -1
}
return 1
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
if this.Field14[i] < that1.Field14[i] {
return -1
}
return 1
}
}
if len(this.Field15) != len(that1.Field15) {
if len(this.Field15) < len(that1.Field15) {
return -1
}
return 1
}
for i := range this.Field15 {
if c := bytes.Compare(this.Field15[i], that1.Field15[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinRepNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinRepNative)
if !ok {
that2, ok := that.(NinRepNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
if this.Field3[i] < that1.Field3[i] {
return -1
}
return 1
}
}
if len(this.Field4) != len(that1.Field4) {
if len(this.Field4) < len(that1.Field4) {
return -1
}
return 1
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
if this.Field4[i] < that1.Field4[i] {
return -1
}
return 1
}
}
if len(this.Field5) != len(that1.Field5) {
if len(this.Field5) < len(that1.Field5) {
return -1
}
return 1
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
if this.Field5[i] < that1.Field5[i] {
return -1
}
return 1
}
}
if len(this.Field6) != len(that1.Field6) {
if len(this.Field6) < len(that1.Field6) {
return -1
}
return 1
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
if this.Field6[i] < that1.Field6[i] {
return -1
}
return 1
}
}
if len(this.Field7) != len(that1.Field7) {
if len(this.Field7) < len(that1.Field7) {
return -1
}
return 1
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
if this.Field7[i] < that1.Field7[i] {
return -1
}
return 1
}
}
if len(this.Field8) != len(that1.Field8) {
if len(this.Field8) < len(that1.Field8) {
return -1
}
return 1
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
if this.Field8[i] < that1.Field8[i] {
return -1
}
return 1
}
}
if len(this.Field9) != len(that1.Field9) {
if len(this.Field9) < len(that1.Field9) {
return -1
}
return 1
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
if this.Field9[i] < that1.Field9[i] {
return -1
}
return 1
}
}
if len(this.Field10) != len(that1.Field10) {
if len(this.Field10) < len(that1.Field10) {
return -1
}
return 1
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
if this.Field10[i] < that1.Field10[i] {
return -1
}
return 1
}
}
if len(this.Field11) != len(that1.Field11) {
if len(this.Field11) < len(that1.Field11) {
return -1
}
return 1
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
if this.Field11[i] < that1.Field11[i] {
return -1
}
return 1
}
}
if len(this.Field12) != len(that1.Field12) {
if len(this.Field12) < len(that1.Field12) {
return -1
}
return 1
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
if this.Field12[i] < that1.Field12[i] {
return -1
}
return 1
}
}
if len(this.Field13) != len(that1.Field13) {
if len(this.Field13) < len(that1.Field13) {
return -1
}
return 1
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
if !this.Field13[i] {
return -1
}
return 1
}
}
if len(this.Field14) != len(that1.Field14) {
if len(this.Field14) < len(that1.Field14) {
return -1
}
return 1
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
if this.Field14[i] < that1.Field14[i] {
return -1
}
return 1
}
}
if len(this.Field15) != len(that1.Field15) {
if len(this.Field15) < len(that1.Field15) {
return -1
}
return 1
}
for i := range this.Field15 {
if c := bytes.Compare(this.Field15[i], that1.Field15[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidRepPackedNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidRepPackedNative)
if !ok {
that2, ok := that.(NidRepPackedNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
if this.Field3[i] < that1.Field3[i] {
return -1
}
return 1
}
}
if len(this.Field4) != len(that1.Field4) {
if len(this.Field4) < len(that1.Field4) {
return -1
}
return 1
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
if this.Field4[i] < that1.Field4[i] {
return -1
}
return 1
}
}
if len(this.Field5) != len(that1.Field5) {
if len(this.Field5) < len(that1.Field5) {
return -1
}
return 1
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
if this.Field5[i] < that1.Field5[i] {
return -1
}
return 1
}
}
if len(this.Field6) != len(that1.Field6) {
if len(this.Field6) < len(that1.Field6) {
return -1
}
return 1
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
if this.Field6[i] < that1.Field6[i] {
return -1
}
return 1
}
}
if len(this.Field7) != len(that1.Field7) {
if len(this.Field7) < len(that1.Field7) {
return -1
}
return 1
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
if this.Field7[i] < that1.Field7[i] {
return -1
}
return 1
}
}
if len(this.Field8) != len(that1.Field8) {
if len(this.Field8) < len(that1.Field8) {
return -1
}
return 1
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
if this.Field8[i] < that1.Field8[i] {
return -1
}
return 1
}
}
if len(this.Field9) != len(that1.Field9) {
if len(this.Field9) < len(that1.Field9) {
return -1
}
return 1
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
if this.Field9[i] < that1.Field9[i] {
return -1
}
return 1
}
}
if len(this.Field10) != len(that1.Field10) {
if len(this.Field10) < len(that1.Field10) {
return -1
}
return 1
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
if this.Field10[i] < that1.Field10[i] {
return -1
}
return 1
}
}
if len(this.Field11) != len(that1.Field11) {
if len(this.Field11) < len(that1.Field11) {
return -1
}
return 1
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
if this.Field11[i] < that1.Field11[i] {
return -1
}
return 1
}
}
if len(this.Field12) != len(that1.Field12) {
if len(this.Field12) < len(that1.Field12) {
return -1
}
return 1
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
if this.Field12[i] < that1.Field12[i] {
return -1
}
return 1
}
}
if len(this.Field13) != len(that1.Field13) {
if len(this.Field13) < len(that1.Field13) {
return -1
}
return 1
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
if !this.Field13[i] {
return -1
}
return 1
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinRepPackedNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinRepPackedNative)
if !ok {
that2, ok := that.(NinRepPackedNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
if this.Field3[i] < that1.Field3[i] {
return -1
}
return 1
}
}
if len(this.Field4) != len(that1.Field4) {
if len(this.Field4) < len(that1.Field4) {
return -1
}
return 1
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
if this.Field4[i] < that1.Field4[i] {
return -1
}
return 1
}
}
if len(this.Field5) != len(that1.Field5) {
if len(this.Field5) < len(that1.Field5) {
return -1
}
return 1
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
if this.Field5[i] < that1.Field5[i] {
return -1
}
return 1
}
}
if len(this.Field6) != len(that1.Field6) {
if len(this.Field6) < len(that1.Field6) {
return -1
}
return 1
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
if this.Field6[i] < that1.Field6[i] {
return -1
}
return 1
}
}
if len(this.Field7) != len(that1.Field7) {
if len(this.Field7) < len(that1.Field7) {
return -1
}
return 1
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
if this.Field7[i] < that1.Field7[i] {
return -1
}
return 1
}
}
if len(this.Field8) != len(that1.Field8) {
if len(this.Field8) < len(that1.Field8) {
return -1
}
return 1
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
if this.Field8[i] < that1.Field8[i] {
return -1
}
return 1
}
}
if len(this.Field9) != len(that1.Field9) {
if len(this.Field9) < len(that1.Field9) {
return -1
}
return 1
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
if this.Field9[i] < that1.Field9[i] {
return -1
}
return 1
}
}
if len(this.Field10) != len(that1.Field10) {
if len(this.Field10) < len(that1.Field10) {
return -1
}
return 1
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
if this.Field10[i] < that1.Field10[i] {
return -1
}
return 1
}
}
if len(this.Field11) != len(that1.Field11) {
if len(this.Field11) < len(that1.Field11) {
return -1
}
return 1
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
if this.Field11[i] < that1.Field11[i] {
return -1
}
return 1
}
}
if len(this.Field12) != len(that1.Field12) {
if len(this.Field12) < len(that1.Field12) {
return -1
}
return 1
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
if this.Field12[i] < that1.Field12[i] {
return -1
}
return 1
}
}
if len(this.Field13) != len(that1.Field13) {
if len(this.Field13) < len(that1.Field13) {
return -1
}
return 1
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
if !this.Field13[i] {
return -1
}
return 1
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidOptStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidOptStruct)
if !ok {
that2, ok := that.(NidOptStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != that1.Field1 {
if this.Field1 < that1.Field1 {
return -1
}
return 1
}
if this.Field2 != that1.Field2 {
if this.Field2 < that1.Field2 {
return -1
}
return 1
}
if c := this.Field3.Compare(&that1.Field3); c != 0 {
return c
}
if c := this.Field4.Compare(&that1.Field4); c != 0 {
return c
}
if this.Field6 != that1.Field6 {
if this.Field6 < that1.Field6 {
return -1
}
return 1
}
if this.Field7 != that1.Field7 {
if this.Field7 < that1.Field7 {
return -1
}
return 1
}
if c := this.Field8.Compare(&that1.Field8); c != 0 {
return c
}
if this.Field13 != that1.Field13 {
if !this.Field13 {
return -1
}
return 1
}
if this.Field14 != that1.Field14 {
if this.Field14 < that1.Field14 {
return -1
}
return 1
}
if c := bytes.Compare(this.Field15, that1.Field15); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptStruct)
if !ok {
that2, ok := that.(NinOptStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if c := this.Field3.Compare(that1.Field3); c != 0 {
return c
}
if c := this.Field4.Compare(that1.Field4); c != 0 {
return c
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
if *this.Field6 < *that1.Field6 {
return -1
}
return 1
}
} else if this.Field6 != nil {
return 1
} else if that1.Field6 != nil {
return -1
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
if *this.Field7 < *that1.Field7 {
return -1
}
return 1
}
} else if this.Field7 != nil {
return 1
} else if that1.Field7 != nil {
return -1
}
if c := this.Field8.Compare(that1.Field8); c != 0 {
return c
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
if !*this.Field13 {
return -1
}
return 1
}
} else if this.Field13 != nil {
return 1
} else if that1.Field13 != nil {
return -1
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
if *this.Field14 < *that1.Field14 {
return -1
}
return 1
}
} else if this.Field14 != nil {
return 1
} else if that1.Field14 != nil {
return -1
}
if c := bytes.Compare(this.Field15, that1.Field15); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidRepStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidRepStruct)
if !ok {
that2, ok := that.(NidRepStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if c := this.Field3[i].Compare(&that1.Field3[i]); c != 0 {
return c
}
}
if len(this.Field4) != len(that1.Field4) {
if len(this.Field4) < len(that1.Field4) {
return -1
}
return 1
}
for i := range this.Field4 {
if c := this.Field4[i].Compare(&that1.Field4[i]); c != 0 {
return c
}
}
if len(this.Field6) != len(that1.Field6) {
if len(this.Field6) < len(that1.Field6) {
return -1
}
return 1
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
if this.Field6[i] < that1.Field6[i] {
return -1
}
return 1
}
}
if len(this.Field7) != len(that1.Field7) {
if len(this.Field7) < len(that1.Field7) {
return -1
}
return 1
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
if this.Field7[i] < that1.Field7[i] {
return -1
}
return 1
}
}
if len(this.Field8) != len(that1.Field8) {
if len(this.Field8) < len(that1.Field8) {
return -1
}
return 1
}
for i := range this.Field8 {
if c := this.Field8[i].Compare(&that1.Field8[i]); c != 0 {
return c
}
}
if len(this.Field13) != len(that1.Field13) {
if len(this.Field13) < len(that1.Field13) {
return -1
}
return 1
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
if !this.Field13[i] {
return -1
}
return 1
}
}
if len(this.Field14) != len(that1.Field14) {
if len(this.Field14) < len(that1.Field14) {
return -1
}
return 1
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
if this.Field14[i] < that1.Field14[i] {
return -1
}
return 1
}
}
if len(this.Field15) != len(that1.Field15) {
if len(this.Field15) < len(that1.Field15) {
return -1
}
return 1
}
for i := range this.Field15 {
if c := bytes.Compare(this.Field15[i], that1.Field15[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinRepStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinRepStruct)
if !ok {
that2, ok := that.(NinRepStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if c := this.Field3[i].Compare(that1.Field3[i]); c != 0 {
return c
}
}
if len(this.Field4) != len(that1.Field4) {
if len(this.Field4) < len(that1.Field4) {
return -1
}
return 1
}
for i := range this.Field4 {
if c := this.Field4[i].Compare(that1.Field4[i]); c != 0 {
return c
}
}
if len(this.Field6) != len(that1.Field6) {
if len(this.Field6) < len(that1.Field6) {
return -1
}
return 1
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
if this.Field6[i] < that1.Field6[i] {
return -1
}
return 1
}
}
if len(this.Field7) != len(that1.Field7) {
if len(this.Field7) < len(that1.Field7) {
return -1
}
return 1
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
if this.Field7[i] < that1.Field7[i] {
return -1
}
return 1
}
}
if len(this.Field8) != len(that1.Field8) {
if len(this.Field8) < len(that1.Field8) {
return -1
}
return 1
}
for i := range this.Field8 {
if c := this.Field8[i].Compare(that1.Field8[i]); c != 0 {
return c
}
}
if len(this.Field13) != len(that1.Field13) {
if len(this.Field13) < len(that1.Field13) {
return -1
}
return 1
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
if !this.Field13[i] {
return -1
}
return 1
}
}
if len(this.Field14) != len(that1.Field14) {
if len(this.Field14) < len(that1.Field14) {
return -1
}
return 1
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
if this.Field14[i] < that1.Field14[i] {
return -1
}
return 1
}
}
if len(this.Field15) != len(that1.Field15) {
if len(this.Field15) < len(that1.Field15) {
return -1
}
return 1
}
for i := range this.Field15 {
if c := bytes.Compare(this.Field15[i], that1.Field15[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidEmbeddedStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidEmbeddedStruct)
if !ok {
that2, ok := that.(NidEmbeddedStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.NidOptNative.Compare(that1.NidOptNative); c != 0 {
return c
}
if c := this.Field200.Compare(&that1.Field200); c != 0 {
return c
}
if this.Field210 != that1.Field210 {
if !this.Field210 {
return -1
}
return 1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinEmbeddedStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinEmbeddedStruct)
if !ok {
that2, ok := that.(NinEmbeddedStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.NidOptNative.Compare(that1.NidOptNative); c != 0 {
return c
}
if c := this.Field200.Compare(that1.Field200); c != 0 {
return c
}
if this.Field210 != nil && that1.Field210 != nil {
if *this.Field210 != *that1.Field210 {
if !*this.Field210 {
return -1
}
return 1
}
} else if this.Field210 != nil {
return 1
} else if that1.Field210 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidNestedStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidNestedStruct)
if !ok {
that2, ok := that.(NidNestedStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Field1.Compare(&that1.Field1); c != 0 {
return c
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if c := this.Field2[i].Compare(&that1.Field2[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinNestedStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinNestedStruct)
if !ok {
that2, ok := that.(NinNestedStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Field1.Compare(that1.Field1); c != 0 {
return c
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if c := this.Field2[i].Compare(that1.Field2[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidOptCustom) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidOptCustom)
if !ok {
that2, ok := that.(NidOptCustom)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Id.Compare(that1.Id); c != 0 {
return c
}
if c := this.Value.Compare(that1.Value); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomDash) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomDash)
if !ok {
that2, ok := that.(CustomDash)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if that1.Value == nil {
if this.Value != nil {
return 1
}
} else if this.Value == nil {
return -1
} else if c := this.Value.Compare(*that1.Value); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptCustom) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptCustom)
if !ok {
that2, ok := that.(NinOptCustom)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if that1.Id == nil {
if this.Id != nil {
return 1
}
} else if this.Id == nil {
return -1
} else if c := this.Id.Compare(*that1.Id); c != 0 {
return c
}
if that1.Value == nil {
if this.Value != nil {
return 1
}
} else if this.Value == nil {
return -1
} else if c := this.Value.Compare(*that1.Value); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidRepCustom) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidRepCustom)
if !ok {
that2, ok := that.(NidRepCustom)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Id) != len(that1.Id) {
if len(this.Id) < len(that1.Id) {
return -1
}
return 1
}
for i := range this.Id {
if c := this.Id[i].Compare(that1.Id[i]); c != 0 {
return c
}
}
if len(this.Value) != len(that1.Value) {
if len(this.Value) < len(that1.Value) {
return -1
}
return 1
}
for i := range this.Value {
if c := this.Value[i].Compare(that1.Value[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinRepCustom) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinRepCustom)
if !ok {
that2, ok := that.(NinRepCustom)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Id) != len(that1.Id) {
if len(this.Id) < len(that1.Id) {
return -1
}
return 1
}
for i := range this.Id {
if c := this.Id[i].Compare(that1.Id[i]); c != 0 {
return c
}
}
if len(this.Value) != len(that1.Value) {
if len(this.Value) < len(that1.Value) {
return -1
}
return 1
}
for i := range this.Value {
if c := this.Value[i].Compare(that1.Value[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptNativeUnion) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptNativeUnion)
if !ok {
that2, ok := that.(NinOptNativeUnion)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
if *this.Field3 < *that1.Field3 {
return -1
}
return 1
}
} else if this.Field3 != nil {
return 1
} else if that1.Field3 != nil {
return -1
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
if *this.Field4 < *that1.Field4 {
return -1
}
return 1
}
} else if this.Field4 != nil {
return 1
} else if that1.Field4 != nil {
return -1
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
if *this.Field5 < *that1.Field5 {
return -1
}
return 1
}
} else if this.Field5 != nil {
return 1
} else if that1.Field5 != nil {
return -1
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
if *this.Field6 < *that1.Field6 {
return -1
}
return 1
}
} else if this.Field6 != nil {
return 1
} else if that1.Field6 != nil {
return -1
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
if !*this.Field13 {
return -1
}
return 1
}
} else if this.Field13 != nil {
return 1
} else if that1.Field13 != nil {
return -1
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
if *this.Field14 < *that1.Field14 {
return -1
}
return 1
}
} else if this.Field14 != nil {
return 1
} else if that1.Field14 != nil {
return -1
}
if c := bytes.Compare(this.Field15, that1.Field15); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptStructUnion) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptStructUnion)
if !ok {
that2, ok := that.(NinOptStructUnion)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if c := this.Field3.Compare(that1.Field3); c != 0 {
return c
}
if c := this.Field4.Compare(that1.Field4); c != 0 {
return c
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
if *this.Field6 < *that1.Field6 {
return -1
}
return 1
}
} else if this.Field6 != nil {
return 1
} else if that1.Field6 != nil {
return -1
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
if *this.Field7 < *that1.Field7 {
return -1
}
return 1
}
} else if this.Field7 != nil {
return 1
} else if that1.Field7 != nil {
return -1
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
if !*this.Field13 {
return -1
}
return 1
}
} else if this.Field13 != nil {
return 1
} else if that1.Field13 != nil {
return -1
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
if *this.Field14 < *that1.Field14 {
return -1
}
return 1
}
} else if this.Field14 != nil {
return 1
} else if that1.Field14 != nil {
return -1
}
if c := bytes.Compare(this.Field15, that1.Field15); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinEmbeddedStructUnion) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinEmbeddedStructUnion)
if !ok {
that2, ok := that.(NinEmbeddedStructUnion)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.NidOptNative.Compare(that1.NidOptNative); c != 0 {
return c
}
if c := this.Field200.Compare(that1.Field200); c != 0 {
return c
}
if this.Field210 != nil && that1.Field210 != nil {
if *this.Field210 != *that1.Field210 {
if !*this.Field210 {
return -1
}
return 1
}
} else if this.Field210 != nil {
return 1
} else if that1.Field210 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinNestedStructUnion) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinNestedStructUnion)
if !ok {
that2, ok := that.(NinNestedStructUnion)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Field1.Compare(that1.Field1); c != 0 {
return c
}
if c := this.Field2.Compare(that1.Field2); c != 0 {
return c
}
if c := this.Field3.Compare(that1.Field3); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *Tree) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*Tree)
if !ok {
that2, ok := that.(Tree)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Or.Compare(that1.Or); c != 0 {
return c
}
if c := this.And.Compare(that1.And); c != 0 {
return c
}
if c := this.Leaf.Compare(that1.Leaf); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *OrBranch) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*OrBranch)
if !ok {
that2, ok := that.(OrBranch)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Left.Compare(&that1.Left); c != 0 {
return c
}
if c := this.Right.Compare(&that1.Right); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *AndBranch) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*AndBranch)
if !ok {
that2, ok := that.(AndBranch)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Left.Compare(&that1.Left); c != 0 {
return c
}
if c := this.Right.Compare(&that1.Right); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *Leaf) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*Leaf)
if !ok {
that2, ok := that.(Leaf)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Value != that1.Value {
if this.Value < that1.Value {
return -1
}
return 1
}
if this.StrValue != that1.StrValue {
if this.StrValue < that1.StrValue {
return -1
}
return 1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *DeepTree) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*DeepTree)
if !ok {
that2, ok := that.(DeepTree)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Down.Compare(that1.Down); c != 0 {
return c
}
if c := this.And.Compare(that1.And); c != 0 {
return c
}
if c := this.Leaf.Compare(that1.Leaf); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *ADeepBranch) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*ADeepBranch)
if !ok {
that2, ok := that.(ADeepBranch)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Down.Compare(&that1.Down); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *AndDeepBranch) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*AndDeepBranch)
if !ok {
that2, ok := that.(AndDeepBranch)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Left.Compare(&that1.Left); c != 0 {
return c
}
if c := this.Right.Compare(&that1.Right); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *DeepLeaf) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*DeepLeaf)
if !ok {
that2, ok := that.(DeepLeaf)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Tree.Compare(&that1.Tree); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *Nil) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*Nil)
if !ok {
that2, ok := that.(Nil)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidOptEnum) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidOptEnum)
if !ok {
that2, ok := that.(NidOptEnum)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != that1.Field1 {
if this.Field1 < that1.Field1 {
return -1
}
return 1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptEnum) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptEnum)
if !ok {
that2, ok := that.(NinOptEnum)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
if *this.Field3 < *that1.Field3 {
return -1
}
return 1
}
} else if this.Field3 != nil {
return 1
} else if that1.Field3 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidRepEnum) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidRepEnum)
if !ok {
that2, ok := that.(NidRepEnum)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
if this.Field3[i] < that1.Field3[i] {
return -1
}
return 1
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinRepEnum) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinRepEnum)
if !ok {
that2, ok := that.(NinRepEnum)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
if this.Field1[i] < that1.Field1[i] {
return -1
}
return 1
}
}
if len(this.Field2) != len(that1.Field2) {
if len(this.Field2) < len(that1.Field2) {
return -1
}
return 1
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
if this.Field2[i] < that1.Field2[i] {
return -1
}
return 1
}
}
if len(this.Field3) != len(that1.Field3) {
if len(this.Field3) < len(that1.Field3) {
return -1
}
return 1
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
if this.Field3[i] < that1.Field3[i] {
return -1
}
return 1
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptEnumDefault) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptEnumDefault)
if !ok {
that2, ok := that.(NinOptEnumDefault)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
if *this.Field3 < *that1.Field3 {
return -1
}
return 1
}
} else if this.Field3 != nil {
return 1
} else if that1.Field3 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *AnotherNinOptEnum) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*AnotherNinOptEnum)
if !ok {
that2, ok := that.(AnotherNinOptEnum)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
if *this.Field3 < *that1.Field3 {
return -1
}
return 1
}
} else if this.Field3 != nil {
return 1
} else if that1.Field3 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *AnotherNinOptEnumDefault) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*AnotherNinOptEnumDefault)
if !ok {
that2, ok := that.(AnotherNinOptEnumDefault)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
if *this.Field3 < *that1.Field3 {
return -1
}
return 1
}
} else if this.Field3 != nil {
return 1
} else if that1.Field3 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *Timer) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*Timer)
if !ok {
that2, ok := that.(Timer)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Time1 != that1.Time1 {
if this.Time1 < that1.Time1 {
return -1
}
return 1
}
if this.Time2 != that1.Time2 {
if this.Time2 < that1.Time2 {
return -1
}
return 1
}
if c := bytes.Compare(this.Data, that1.Data); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *MyExtendable) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*MyExtendable)
if !ok {
that2, ok := that.(MyExtendable)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
thismap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(this)
thatmap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(that1)
extkeys := make([]int32, 0, len(thismap)+len(thatmap))
for k := range thismap {
extkeys = append(extkeys, k)
}
for k := range thatmap {
if _, ok := thismap[k]; !ok {
extkeys = append(extkeys, k)
}
}
github_com_gogo_protobuf_sortkeys.Int32s(extkeys)
for _, k := range extkeys {
if v, ok := thismap[k]; ok {
if v2, ok := thatmap[k]; ok {
if c := v.Compare(&v2); c != 0 {
return c
}
} else {
return 1
}
} else {
return -1
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *OtherExtenable) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*OtherExtenable)
if !ok {
that2, ok := that.(OtherExtenable)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
if *this.Field13 < *that1.Field13 {
return -1
}
return 1
}
} else if this.Field13 != nil {
return 1
} else if that1.Field13 != nil {
return -1
}
if c := this.M.Compare(that1.M); c != 0 {
return c
}
thismap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(this)
thatmap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(that1)
extkeys := make([]int32, 0, len(thismap)+len(thatmap))
for k := range thismap {
extkeys = append(extkeys, k)
}
for k := range thatmap {
if _, ok := thismap[k]; !ok {
extkeys = append(extkeys, k)
}
}
github_com_gogo_protobuf_sortkeys.Int32s(extkeys)
for _, k := range extkeys {
if v, ok := thismap[k]; ok {
if v2, ok := thatmap[k]; ok {
if c := v.Compare(&v2); c != 0 {
return c
}
} else {
return 1
}
} else {
return -1
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NestedDefinition) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NestedDefinition)
if !ok {
that2, ok := that.(NestedDefinition)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.EnumField != nil && that1.EnumField != nil {
if *this.EnumField != *that1.EnumField {
if *this.EnumField < *that1.EnumField {
return -1
}
return 1
}
} else if this.EnumField != nil {
return 1
} else if that1.EnumField != nil {
return -1
}
if c := this.NNM.Compare(that1.NNM); c != 0 {
return c
}
if c := this.NM.Compare(that1.NM); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NestedDefinition_NestedMessage) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NestedDefinition_NestedMessage)
if !ok {
that2, ok := that.(NestedDefinition_NestedMessage)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.NestedField1 != nil && that1.NestedField1 != nil {
if *this.NestedField1 != *that1.NestedField1 {
if *this.NestedField1 < *that1.NestedField1 {
return -1
}
return 1
}
} else if this.NestedField1 != nil {
return 1
} else if that1.NestedField1 != nil {
return -1
}
if c := this.NNM.Compare(that1.NNM); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NestedDefinition_NestedMessage_NestedNestedMsg)
if !ok {
that2, ok := that.(NestedDefinition_NestedMessage_NestedNestedMsg)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.NestedNestedField1 != nil && that1.NestedNestedField1 != nil {
if *this.NestedNestedField1 != *that1.NestedNestedField1 {
if *this.NestedNestedField1 < *that1.NestedNestedField1 {
return -1
}
return 1
}
} else if this.NestedNestedField1 != nil {
return 1
} else if that1.NestedNestedField1 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NestedScope) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NestedScope)
if !ok {
that2, ok := that.(NestedScope)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.A.Compare(that1.A); c != 0 {
return c
}
if this.B != nil && that1.B != nil {
if *this.B != *that1.B {
if *this.B < *that1.B {
return -1
}
return 1
}
} else if this.B != nil {
return 1
} else if that1.B != nil {
return -1
}
if c := this.C.Compare(that1.C); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptNativeDefault) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptNativeDefault)
if !ok {
that2, ok := that.(NinOptNativeDefault)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
if *this.Field3 < *that1.Field3 {
return -1
}
return 1
}
} else if this.Field3 != nil {
return 1
} else if that1.Field3 != nil {
return -1
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
if *this.Field4 < *that1.Field4 {
return -1
}
return 1
}
} else if this.Field4 != nil {
return 1
} else if that1.Field4 != nil {
return -1
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
if *this.Field5 < *that1.Field5 {
return -1
}
return 1
}
} else if this.Field5 != nil {
return 1
} else if that1.Field5 != nil {
return -1
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
if *this.Field6 < *that1.Field6 {
return -1
}
return 1
}
} else if this.Field6 != nil {
return 1
} else if that1.Field6 != nil {
return -1
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
if *this.Field7 < *that1.Field7 {
return -1
}
return 1
}
} else if this.Field7 != nil {
return 1
} else if that1.Field7 != nil {
return -1
}
if this.Field8 != nil && that1.Field8 != nil {
if *this.Field8 != *that1.Field8 {
if *this.Field8 < *that1.Field8 {
return -1
}
return 1
}
} else if this.Field8 != nil {
return 1
} else if that1.Field8 != nil {
return -1
}
if this.Field9 != nil && that1.Field9 != nil {
if *this.Field9 != *that1.Field9 {
if *this.Field9 < *that1.Field9 {
return -1
}
return 1
}
} else if this.Field9 != nil {
return 1
} else if that1.Field9 != nil {
return -1
}
if this.Field10 != nil && that1.Field10 != nil {
if *this.Field10 != *that1.Field10 {
if *this.Field10 < *that1.Field10 {
return -1
}
return 1
}
} else if this.Field10 != nil {
return 1
} else if that1.Field10 != nil {
return -1
}
if this.Field11 != nil && that1.Field11 != nil {
if *this.Field11 != *that1.Field11 {
if *this.Field11 < *that1.Field11 {
return -1
}
return 1
}
} else if this.Field11 != nil {
return 1
} else if that1.Field11 != nil {
return -1
}
if this.Field12 != nil && that1.Field12 != nil {
if *this.Field12 != *that1.Field12 {
if *this.Field12 < *that1.Field12 {
return -1
}
return 1
}
} else if this.Field12 != nil {
return 1
} else if that1.Field12 != nil {
return -1
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
if !*this.Field13 {
return -1
}
return 1
}
} else if this.Field13 != nil {
return 1
} else if that1.Field13 != nil {
return -1
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
if *this.Field14 < *that1.Field14 {
return -1
}
return 1
}
} else if this.Field14 != nil {
return 1
} else if that1.Field14 != nil {
return -1
}
if c := bytes.Compare(this.Field15, that1.Field15); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomContainer) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomContainer)
if !ok {
that2, ok := that.(CustomContainer)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.CustomStruct.Compare(&that1.CustomStruct); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomNameNidOptNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomNameNidOptNative)
if !ok {
that2, ok := that.(CustomNameNidOptNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.FieldA != that1.FieldA {
if this.FieldA < that1.FieldA {
return -1
}
return 1
}
if this.FieldB != that1.FieldB {
if this.FieldB < that1.FieldB {
return -1
}
return 1
}
if this.FieldC != that1.FieldC {
if this.FieldC < that1.FieldC {
return -1
}
return 1
}
if this.FieldD != that1.FieldD {
if this.FieldD < that1.FieldD {
return -1
}
return 1
}
if this.FieldE != that1.FieldE {
if this.FieldE < that1.FieldE {
return -1
}
return 1
}
if this.FieldF != that1.FieldF {
if this.FieldF < that1.FieldF {
return -1
}
return 1
}
if this.FieldG != that1.FieldG {
if this.FieldG < that1.FieldG {
return -1
}
return 1
}
if this.FieldH != that1.FieldH {
if this.FieldH < that1.FieldH {
return -1
}
return 1
}
if this.FieldI != that1.FieldI {
if this.FieldI < that1.FieldI {
return -1
}
return 1
}
if this.FieldJ != that1.FieldJ {
if this.FieldJ < that1.FieldJ {
return -1
}
return 1
}
if this.FieldK != that1.FieldK {
if this.FieldK < that1.FieldK {
return -1
}
return 1
}
if this.FieldL != that1.FieldL {
if this.FieldL < that1.FieldL {
return -1
}
return 1
}
if this.FieldM != that1.FieldM {
if !this.FieldM {
return -1
}
return 1
}
if this.FieldN != that1.FieldN {
if this.FieldN < that1.FieldN {
return -1
}
return 1
}
if c := bytes.Compare(this.FieldO, that1.FieldO); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomNameNinOptNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomNameNinOptNative)
if !ok {
that2, ok := that.(CustomNameNinOptNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
if *this.FieldA < *that1.FieldA {
return -1
}
return 1
}
} else if this.FieldA != nil {
return 1
} else if that1.FieldA != nil {
return -1
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
if *this.FieldB < *that1.FieldB {
return -1
}
return 1
}
} else if this.FieldB != nil {
return 1
} else if that1.FieldB != nil {
return -1
}
if this.FieldC != nil && that1.FieldC != nil {
if *this.FieldC != *that1.FieldC {
if *this.FieldC < *that1.FieldC {
return -1
}
return 1
}
} else if this.FieldC != nil {
return 1
} else if that1.FieldC != nil {
return -1
}
if this.FieldD != nil && that1.FieldD != nil {
if *this.FieldD != *that1.FieldD {
if *this.FieldD < *that1.FieldD {
return -1
}
return 1
}
} else if this.FieldD != nil {
return 1
} else if that1.FieldD != nil {
return -1
}
if this.FieldE != nil && that1.FieldE != nil {
if *this.FieldE != *that1.FieldE {
if *this.FieldE < *that1.FieldE {
return -1
}
return 1
}
} else if this.FieldE != nil {
return 1
} else if that1.FieldE != nil {
return -1
}
if this.FieldF != nil && that1.FieldF != nil {
if *this.FieldF != *that1.FieldF {
if *this.FieldF < *that1.FieldF {
return -1
}
return 1
}
} else if this.FieldF != nil {
return 1
} else if that1.FieldF != nil {
return -1
}
if this.FieldG != nil && that1.FieldG != nil {
if *this.FieldG != *that1.FieldG {
if *this.FieldG < *that1.FieldG {
return -1
}
return 1
}
} else if this.FieldG != nil {
return 1
} else if that1.FieldG != nil {
return -1
}
if this.FieldH != nil && that1.FieldH != nil {
if *this.FieldH != *that1.FieldH {
if *this.FieldH < *that1.FieldH {
return -1
}
return 1
}
} else if this.FieldH != nil {
return 1
} else if that1.FieldH != nil {
return -1
}
if this.FieldI != nil && that1.FieldI != nil {
if *this.FieldI != *that1.FieldI {
if *this.FieldI < *that1.FieldI {
return -1
}
return 1
}
} else if this.FieldI != nil {
return 1
} else if that1.FieldI != nil {
return -1
}
if this.FieldJ != nil && that1.FieldJ != nil {
if *this.FieldJ != *that1.FieldJ {
if *this.FieldJ < *that1.FieldJ {
return -1
}
return 1
}
} else if this.FieldJ != nil {
return 1
} else if that1.FieldJ != nil {
return -1
}
if this.FieldK != nil && that1.FieldK != nil {
if *this.FieldK != *that1.FieldK {
if *this.FieldK < *that1.FieldK {
return -1
}
return 1
}
} else if this.FieldK != nil {
return 1
} else if that1.FieldK != nil {
return -1
}
if this.FielL != nil && that1.FielL != nil {
if *this.FielL != *that1.FielL {
if *this.FielL < *that1.FielL {
return -1
}
return 1
}
} else if this.FielL != nil {
return 1
} else if that1.FielL != nil {
return -1
}
if this.FieldM != nil && that1.FieldM != nil {
if *this.FieldM != *that1.FieldM {
if !*this.FieldM {
return -1
}
return 1
}
} else if this.FieldM != nil {
return 1
} else if that1.FieldM != nil {
return -1
}
if this.FieldN != nil && that1.FieldN != nil {
if *this.FieldN != *that1.FieldN {
if *this.FieldN < *that1.FieldN {
return -1
}
return 1
}
} else if this.FieldN != nil {
return 1
} else if that1.FieldN != nil {
return -1
}
if c := bytes.Compare(this.FieldO, that1.FieldO); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomNameNinRepNative) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomNameNinRepNative)
if !ok {
that2, ok := that.(CustomNameNinRepNative)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.FieldA) != len(that1.FieldA) {
if len(this.FieldA) < len(that1.FieldA) {
return -1
}
return 1
}
for i := range this.FieldA {
if this.FieldA[i] != that1.FieldA[i] {
if this.FieldA[i] < that1.FieldA[i] {
return -1
}
return 1
}
}
if len(this.FieldB) != len(that1.FieldB) {
if len(this.FieldB) < len(that1.FieldB) {
return -1
}
return 1
}
for i := range this.FieldB {
if this.FieldB[i] != that1.FieldB[i] {
if this.FieldB[i] < that1.FieldB[i] {
return -1
}
return 1
}
}
if len(this.FieldC) != len(that1.FieldC) {
if len(this.FieldC) < len(that1.FieldC) {
return -1
}
return 1
}
for i := range this.FieldC {
if this.FieldC[i] != that1.FieldC[i] {
if this.FieldC[i] < that1.FieldC[i] {
return -1
}
return 1
}
}
if len(this.FieldD) != len(that1.FieldD) {
if len(this.FieldD) < len(that1.FieldD) {
return -1
}
return 1
}
for i := range this.FieldD {
if this.FieldD[i] != that1.FieldD[i] {
if this.FieldD[i] < that1.FieldD[i] {
return -1
}
return 1
}
}
if len(this.FieldE) != len(that1.FieldE) {
if len(this.FieldE) < len(that1.FieldE) {
return -1
}
return 1
}
for i := range this.FieldE {
if this.FieldE[i] != that1.FieldE[i] {
if this.FieldE[i] < that1.FieldE[i] {
return -1
}
return 1
}
}
if len(this.FieldF) != len(that1.FieldF) {
if len(this.FieldF) < len(that1.FieldF) {
return -1
}
return 1
}
for i := range this.FieldF {
if this.FieldF[i] != that1.FieldF[i] {
if this.FieldF[i] < that1.FieldF[i] {
return -1
}
return 1
}
}
if len(this.FieldG) != len(that1.FieldG) {
if len(this.FieldG) < len(that1.FieldG) {
return -1
}
return 1
}
for i := range this.FieldG {
if this.FieldG[i] != that1.FieldG[i] {
if this.FieldG[i] < that1.FieldG[i] {
return -1
}
return 1
}
}
if len(this.FieldH) != len(that1.FieldH) {
if len(this.FieldH) < len(that1.FieldH) {
return -1
}
return 1
}
for i := range this.FieldH {
if this.FieldH[i] != that1.FieldH[i] {
if this.FieldH[i] < that1.FieldH[i] {
return -1
}
return 1
}
}
if len(this.FieldI) != len(that1.FieldI) {
if len(this.FieldI) < len(that1.FieldI) {
return -1
}
return 1
}
for i := range this.FieldI {
if this.FieldI[i] != that1.FieldI[i] {
if this.FieldI[i] < that1.FieldI[i] {
return -1
}
return 1
}
}
if len(this.FieldJ) != len(that1.FieldJ) {
if len(this.FieldJ) < len(that1.FieldJ) {
return -1
}
return 1
}
for i := range this.FieldJ {
if this.FieldJ[i] != that1.FieldJ[i] {
if this.FieldJ[i] < that1.FieldJ[i] {
return -1
}
return 1
}
}
if len(this.FieldK) != len(that1.FieldK) {
if len(this.FieldK) < len(that1.FieldK) {
return -1
}
return 1
}
for i := range this.FieldK {
if this.FieldK[i] != that1.FieldK[i] {
if this.FieldK[i] < that1.FieldK[i] {
return -1
}
return 1
}
}
if len(this.FieldL) != len(that1.FieldL) {
if len(this.FieldL) < len(that1.FieldL) {
return -1
}
return 1
}
for i := range this.FieldL {
if this.FieldL[i] != that1.FieldL[i] {
if this.FieldL[i] < that1.FieldL[i] {
return -1
}
return 1
}
}
if len(this.FieldM) != len(that1.FieldM) {
if len(this.FieldM) < len(that1.FieldM) {
return -1
}
return 1
}
for i := range this.FieldM {
if this.FieldM[i] != that1.FieldM[i] {
if !this.FieldM[i] {
return -1
}
return 1
}
}
if len(this.FieldN) != len(that1.FieldN) {
if len(this.FieldN) < len(that1.FieldN) {
return -1
}
return 1
}
for i := range this.FieldN {
if this.FieldN[i] != that1.FieldN[i] {
if this.FieldN[i] < that1.FieldN[i] {
return -1
}
return 1
}
}
if len(this.FieldO) != len(that1.FieldO) {
if len(this.FieldO) < len(that1.FieldO) {
return -1
}
return 1
}
for i := range this.FieldO {
if c := bytes.Compare(this.FieldO[i], that1.FieldO[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomNameNinStruct) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomNameNinStruct)
if !ok {
that2, ok := that.(CustomNameNinStruct)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
if *this.FieldA < *that1.FieldA {
return -1
}
return 1
}
} else if this.FieldA != nil {
return 1
} else if that1.FieldA != nil {
return -1
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
if *this.FieldB < *that1.FieldB {
return -1
}
return 1
}
} else if this.FieldB != nil {
return 1
} else if that1.FieldB != nil {
return -1
}
if c := this.FieldC.Compare(that1.FieldC); c != 0 {
return c
}
if len(this.FieldD) != len(that1.FieldD) {
if len(this.FieldD) < len(that1.FieldD) {
return -1
}
return 1
}
for i := range this.FieldD {
if c := this.FieldD[i].Compare(that1.FieldD[i]); c != 0 {
return c
}
}
if this.FieldE != nil && that1.FieldE != nil {
if *this.FieldE != *that1.FieldE {
if *this.FieldE < *that1.FieldE {
return -1
}
return 1
}
} else if this.FieldE != nil {
return 1
} else if that1.FieldE != nil {
return -1
}
if this.FieldF != nil && that1.FieldF != nil {
if *this.FieldF != *that1.FieldF {
if *this.FieldF < *that1.FieldF {
return -1
}
return 1
}
} else if this.FieldF != nil {
return 1
} else if that1.FieldF != nil {
return -1
}
if c := this.FieldG.Compare(that1.FieldG); c != 0 {
return c
}
if this.FieldH != nil && that1.FieldH != nil {
if *this.FieldH != *that1.FieldH {
if !*this.FieldH {
return -1
}
return 1
}
} else if this.FieldH != nil {
return 1
} else if that1.FieldH != nil {
return -1
}
if this.FieldI != nil && that1.FieldI != nil {
if *this.FieldI != *that1.FieldI {
if *this.FieldI < *that1.FieldI {
return -1
}
return 1
}
} else if this.FieldI != nil {
return 1
} else if that1.FieldI != nil {
return -1
}
if c := bytes.Compare(this.FieldJ, that1.FieldJ); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomNameCustomType) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomNameCustomType)
if !ok {
that2, ok := that.(CustomNameCustomType)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if that1.FieldA == nil {
if this.FieldA != nil {
return 1
}
} else if this.FieldA == nil {
return -1
} else if c := this.FieldA.Compare(*that1.FieldA); c != 0 {
return c
}
if that1.FieldB == nil {
if this.FieldB != nil {
return 1
}
} else if this.FieldB == nil {
return -1
} else if c := this.FieldB.Compare(*that1.FieldB); c != 0 {
return c
}
if len(this.FieldC) != len(that1.FieldC) {
if len(this.FieldC) < len(that1.FieldC) {
return -1
}
return 1
}
for i := range this.FieldC {
if c := this.FieldC[i].Compare(that1.FieldC[i]); c != 0 {
return c
}
}
if len(this.FieldD) != len(that1.FieldD) {
if len(this.FieldD) < len(that1.FieldD) {
return -1
}
return 1
}
for i := range this.FieldD {
if c := this.FieldD[i].Compare(that1.FieldD[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomNameNinEmbeddedStructUnion) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomNameNinEmbeddedStructUnion)
if !ok {
that2, ok := that.(CustomNameNinEmbeddedStructUnion)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.NidOptNative.Compare(that1.NidOptNative); c != 0 {
return c
}
if c := this.FieldA.Compare(that1.FieldA); c != 0 {
return c
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
if !*this.FieldB {
return -1
}
return 1
}
} else if this.FieldB != nil {
return 1
} else if that1.FieldB != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *CustomNameEnum) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*CustomNameEnum)
if !ok {
that2, ok := that.(CustomNameEnum)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
if *this.FieldA < *that1.FieldA {
return -1
}
return 1
}
} else if this.FieldA != nil {
return 1
} else if that1.FieldA != nil {
return -1
}
if len(this.FieldB) != len(that1.FieldB) {
if len(this.FieldB) < len(that1.FieldB) {
return -1
}
return 1
}
for i := range this.FieldB {
if this.FieldB[i] != that1.FieldB[i] {
if this.FieldB[i] < that1.FieldB[i] {
return -1
}
return 1
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NoExtensionsMap) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NoExtensionsMap)
if !ok {
that2, ok := that.(NoExtensionsMap)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
if c := bytes.Compare(this.XXX_extensions, that1.XXX_extensions); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *Unrecognized) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*Unrecognized)
if !ok {
that2, ok := that.(Unrecognized)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
return 0
}
func (this *UnrecognizedWithInner) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*UnrecognizedWithInner)
if !ok {
that2, ok := that.(UnrecognizedWithInner)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Embedded) != len(that1.Embedded) {
if len(this.Embedded) < len(that1.Embedded) {
return -1
}
return 1
}
for i := range this.Embedded {
if c := this.Embedded[i].Compare(that1.Embedded[i]); c != 0 {
return c
}
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *UnrecognizedWithInner_Inner) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*UnrecognizedWithInner_Inner)
if !ok {
that2, ok := that.(UnrecognizedWithInner_Inner)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
return 0
}
func (this *UnrecognizedWithEmbed) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*UnrecognizedWithEmbed)
if !ok {
that2, ok := that.(UnrecognizedWithEmbed)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.UnrecognizedWithEmbed_Embedded.Compare(&that1.UnrecognizedWithEmbed_Embedded); c != 0 {
return c
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *UnrecognizedWithEmbed_Embedded) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*UnrecognizedWithEmbed_Embedded)
if !ok {
that2, ok := that.(UnrecognizedWithEmbed_Embedded)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
if *this.Field1 < *that1.Field1 {
return -1
}
return 1
}
} else if this.Field1 != nil {
return 1
} else if that1.Field1 != nil {
return -1
}
return 0
}
func (this *Node) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*Node)
if !ok {
that2, ok := that.(Node)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Label != nil && that1.Label != nil {
if *this.Label != *that1.Label {
if *this.Label < *that1.Label {
return -1
}
return 1
}
} else if this.Label != nil {
return 1
} else if that1.Label != nil {
return -1
}
if len(this.Children) != len(that1.Children) {
if len(this.Children) < len(that1.Children) {
return -1
}
return 1
}
for i := range this.Children {
if c := this.Children[i].Compare(that1.Children[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NonByteCustomType) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NonByteCustomType)
if !ok {
that2, ok := that.(NonByteCustomType)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if that1.Field1 == nil {
if this.Field1 != nil {
return 1
}
} else if this.Field1 == nil {
return -1
} else if c := this.Field1.Compare(*that1.Field1); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidOptNonByteCustomType) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidOptNonByteCustomType)
if !ok {
that2, ok := that.(NidOptNonByteCustomType)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if c := this.Field1.Compare(that1.Field1); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinOptNonByteCustomType) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinOptNonByteCustomType)
if !ok {
that2, ok := that.(NinOptNonByteCustomType)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if that1.Field1 == nil {
if this.Field1 != nil {
return 1
}
} else if this.Field1 == nil {
return -1
} else if c := this.Field1.Compare(*that1.Field1); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidRepNonByteCustomType) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NidRepNonByteCustomType)
if !ok {
that2, ok := that.(NidRepNonByteCustomType)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if c := this.Field1[i].Compare(that1.Field1[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NinRepNonByteCustomType) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*NinRepNonByteCustomType)
if !ok {
that2, ok := that.(NinRepNonByteCustomType)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if len(this.Field1) != len(that1.Field1) {
if len(this.Field1) < len(that1.Field1) {
return -1
}
return 1
}
for i := range this.Field1 {
if c := this.Field1[i].Compare(that1.Field1[i]); c != 0 {
return c
}
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *ProtoType) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*ProtoType)
if !ok {
that2, ok := that.(ProtoType)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
if *this.Field2 < *that1.Field2 {
return -1
}
return 1
}
} else if this.Field2 != nil {
return 1
} else if that1.Field2 != nil {
return -1
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *NidOptNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidRepNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinRepNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidRepPackedNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinRepPackedNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidOptStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidRepStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinRepStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidEmbeddedStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinEmbeddedStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidNestedStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinNestedStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidOptCustom) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomDash) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptCustom) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidRepCustom) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinRepCustom) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptNativeUnion) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptStructUnion) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinEmbeddedStructUnion) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinNestedStructUnion) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *Tree) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *OrBranch) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *AndBranch) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *Leaf) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *DeepTree) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *ADeepBranch) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *AndDeepBranch) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *DeepLeaf) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *Nil) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidOptEnum) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptEnum) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidRepEnum) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinRepEnum) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptEnumDefault) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *AnotherNinOptEnum) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *AnotherNinOptEnumDefault) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *Timer) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *MyExtendable) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *OtherExtenable) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NestedDefinition) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NestedDefinition_NestedMessage) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NestedScope) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptNativeDefault) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomContainer) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomNameNidOptNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomNameNinOptNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomNameNinRepNative) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomNameNinStruct) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomNameCustomType) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomNameNinEmbeddedStructUnion) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *CustomNameEnum) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NoExtensionsMap) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *Unrecognized) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *UnrecognizedWithInner) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *UnrecognizedWithInner_Inner) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *UnrecognizedWithEmbed) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *UnrecognizedWithEmbed_Embedded) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *Node) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NonByteCustomType) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidOptNonByteCustomType) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinOptNonByteCustomType) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NidRepNonByteCustomType) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *NinRepNonByteCustomType) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func (this *ProtoType) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return ThetestDescription()
}
func ThetestDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{}
var gzipped = []byte{
// 6526 bytes of a gzipped FileDescriptorSet
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x7c, 0x7b, 0x6c, 0x1c, 0xd7,
0x75, 0x37, 0x67, 0x67, 0x49, 0x2d, 0x0f, 0x5f, 0xc3, 0xa1, 0x4c, 0xad, 0x69, 0x79, 0x49, 0xad,
0x65, 0x99, 0x66, 0x6c, 0x8a, 0xa2, 0xa8, 0xd7, 0x2a, 0xb6, 0xb1, 0x2f, 0xc9, 0x54, 0xc8, 0x25,
0x33, 0x24, 0x63, 0x2b, 0xdf, 0x07, 0x2c, 0x46, 0xbb, 0x97, 0xe4, 0xda, 0xbb, 0x33, 0x9b, 0x9d,
0xa1, 0x6d, 0xfa, 0x8f, 0x0f, 0xfe, 0x92, 0xef, 0x4b, 0x93, 0x16, 0xe9, 0x2b, 0x2d, 0x9a, 0xa4,
0x89, 0xe3, 0xa4, 0x48, 0xe3, 0xa4, 0xaf, 0xa4, 0x4d, 0xd3, 0x20, 0x28, 0x1a, 0xff, 0x93, 0x56,
0x45, 0x81, 0xc2, 0x29, 0x50, 0xa0, 0x08, 0x0a, 0x23, 0x56, 0x02, 0x34, 0x6d, 0xdd, 0x36, 0x69,
0x0c, 0x24, 0x80, 0xf3, 0x47, 0x71, 0x5f, 0x33, 0x73, 0xef, 0xce, 0x72, 0x86, 0x96, 0x9d, 0xe4,
0x1f, 0x69, 0xf7, 0x9e, 0xf3, 0x3b, 0x73, 0xee, 0x79, 0xdd, 0x33, 0xf7, 0x5e, 0x2e, 0x7c, 0xe4,
0x3c, 0xcc, 0xec, 0xd8, 0xf6, 0x4e, 0x13, 0x9d, 0x6e, 0x77, 0x6c, 0xd7, 0xbe, 0xb1, 0xb7, 0x7d,
0xba, 0x8e, 0x9c, 0x5a, 0xa7, 0xd1, 0x76, 0xed, 0xce, 0x3c, 0x19, 0xd3, 0xc7, 0x28, 0xc7, 0x3c,
0xe7, 0xc8, 0xae, 0xc2, 0xf8, 0x95, 0x46, 0x13, 0x95, 0x3c, 0xc6, 0x0d, 0xe4, 0xea, 0x17, 0x21,
0xb9, 0xdd, 0x68, 0xa2, 0xb4, 0x32, 0xa3, 0xce, 0x0e, 0x2d, 0x9e, 0x9c, 0x97, 0x40, 0xf3, 0x22,
0x62, 0x1d, 0x0f, 0x1b, 0x04, 0x91, 0xfd, 0x5e, 0x12, 0x26, 0x42, 0xa8, 0xba, 0x0e, 0x49, 0xcb,
0x6c, 0x61, 0x89, 0xca, 0xec, 0xa0, 0x41, 0x3e, 0xeb, 0x69, 0x38, 0xd2, 0x36, 0x6b, 0x4f, 0x9a,
0x3b, 0x28, 0x9d, 0x20, 0xc3, 0xfc, 0xab, 0x9e, 0x01, 0xa8, 0xa3, 0x36, 0xb2, 0xea, 0xc8, 0xaa,
0xed, 0xa7, 0xd5, 0x19, 0x75, 0x76, 0xd0, 0x08, 0x8c, 0xe8, 0xef, 0x80, 0xf1, 0xf6, 0xde, 0x8d,
0x66, 0xa3, 0x56, 0x0d, 0xb0, 0xc1, 0x8c, 0x3a, 0xdb, 0x6f, 0x68, 0x94, 0x50, 0xf2, 0x99, 0xef,
0x83, 0xb1, 0xa7, 0x91, 0xf9, 0x64, 0x90, 0x75, 0x88, 0xb0, 0x8e, 0xe2, 0xe1, 0x00, 0x63, 0x11,
0x86, 0x5b, 0xc8, 0x71, 0xcc, 0x1d, 0x54, 0x75, 0xf7, 0xdb, 0x28, 0x9d, 0x24, 0xb3, 0x9f, 0xe9,
0x9a, 0xbd, 0x3c, 0xf3, 0x21, 0x86, 0xda, 0xdc, 0x6f, 0x23, 0x3d, 0x0f, 0x83, 0xc8, 0xda, 0x6b,
0x51, 0x09, 0xfd, 0x3d, 0xec, 0x57, 0xb6, 0xf6, 0x5a, 0xb2, 0x94, 0x14, 0x86, 0x31, 0x11, 0x47,
0x1c, 0xd4, 0x79, 0xaa, 0x51, 0x43, 0xe9, 0x01, 0x22, 0xe0, 0xbe, 0x2e, 0x01, 0x1b, 0x94, 0x2e,
0xcb, 0xe0, 0x38, 0xbd, 0x08, 0x83, 0xe8, 0x19, 0x17, 0x59, 0x4e, 0xc3, 0xb6, 0xd2, 0x47, 0x88,
0x90, 0x7b, 0x43, 0xbc, 0x88, 0x9a, 0x75, 0x59, 0x84, 0x8f, 0xd3, 0xcf, 0xc3, 0x11, 0xbb, 0xed,
0x36, 0x6c, 0xcb, 0x49, 0xa7, 0x66, 0x94, 0xd9, 0xa1, 0xc5, 0xe3, 0xa1, 0x81, 0xb0, 0x46, 0x79,
0x0c, 0xce, 0xac, 0x2f, 0x83, 0xe6, 0xd8, 0x7b, 0x9d, 0x1a, 0xaa, 0xd6, 0xec, 0x3a, 0xaa, 0x36,
0xac, 0x6d, 0x3b, 0x3d, 0x48, 0x04, 0x4c, 0x77, 0x4f, 0x84, 0x30, 0x16, 0xed, 0x3a, 0x5a, 0xb6,
0xb6, 0x6d, 0x63, 0xd4, 0x11, 0xbe, 0xeb, 0x93, 0x30, 0xe0, 0xec, 0x5b, 0xae, 0xf9, 0x4c, 0x7a,
0x98, 0x44, 0x08, 0xfb, 0x96, 0xfd, 0x71, 0x3f, 0x8c, 0xc5, 0x09, 0xb1, 0xcb, 0xd0, 0xbf, 0x8d,
0x67, 0x99, 0x4e, 0x1c, 0xc6, 0x06, 0x14, 0x23, 0x1a, 0x71, 0xe0, 0x4d, 0x1a, 0x31, 0x0f, 0x43,
0x16, 0x72, 0x5c, 0x54, 0xa7, 0x11, 0xa1, 0xc6, 0x8c, 0x29, 0xa0, 0xa0, 0xee, 0x90, 0x4a, 0xbe,
0xa9, 0x90, 0x7a, 0x1c, 0xc6, 0x3c, 0x95, 0xaa, 0x1d, 0xd3, 0xda, 0xe1, 0xb1, 0x79, 0x3a, 0x4a,
0x93, 0xf9, 0x32, 0xc7, 0x19, 0x18, 0x66, 0x8c, 0x22, 0xe1, 0xbb, 0x5e, 0x02, 0xb0, 0x2d, 0x64,
0x6f, 0x57, 0xeb, 0xa8, 0xd6, 0x4c, 0xa7, 0x7a, 0x58, 0x69, 0x0d, 0xb3, 0x74, 0x59, 0xc9, 0xa6,
0xa3, 0xb5, 0xa6, 0x7e, 0xc9, 0x0f, 0xb5, 0x23, 0x3d, 0x22, 0x65, 0x95, 0x26, 0x59, 0x57, 0xb4,
0x6d, 0xc1, 0x68, 0x07, 0xe1, 0xb8, 0x47, 0x75, 0x36, 0xb3, 0x41, 0xa2, 0xc4, 0x7c, 0xe4, 0xcc,
0x0c, 0x06, 0xa3, 0x13, 0x1b, 0xe9, 0x04, 0xbf, 0xea, 0xf7, 0x80, 0x37, 0x50, 0x25, 0x61, 0x05,
0xa4, 0x0a, 0x0d, 0xf3, 0xc1, 0x8a, 0xd9, 0x42, 0x53, 0x17, 0x61, 0x54, 0x34, 0x8f, 0x7e, 0x14,
0xfa, 0x1d, 0xd7, 0xec, 0xb8, 0x24, 0x0a, 0xfb, 0x0d, 0xfa, 0x45, 0xd7, 0x40, 0x45, 0x56, 0x9d,
0x54, 0xb9, 0x7e, 0x03, 0x7f, 0x9c, 0xba, 0x00, 0x23, 0xc2, 0xe3, 0xe3, 0x02, 0xb3, 0x1f, 0x1b,
0x80, 0xa3, 0x61, 0x31, 0x17, 0x1a, 0xfe, 0x93, 0x30, 0x60, 0xed, 0xb5, 0x6e, 0xa0, 0x4e, 0x5a,
0x25, 0x12, 0xd8, 0x37, 0x3d, 0x0f, 0xfd, 0x4d, 0xf3, 0x06, 0x6a, 0xa6, 0x93, 0x33, 0xca, 0xec,
0xe8, 0xe2, 0x3b, 0x62, 0x45, 0xf5, 0xfc, 0x0a, 0x86, 0x18, 0x14, 0xa9, 0x3f, 0x0c, 0x49, 0x56,
0xe2, 0xb0, 0x84, 0xb9, 0x78, 0x12, 0x70, 0x2c, 0x1a, 0x04, 0xa7, 0xdf, 0x05, 0x83, 0xf8, 0x7f,
0x6a, 0xdb, 0x01, 0xa2, 0x73, 0x0a, 0x0f, 0x60, 0xbb, 0xea, 0x53, 0x90, 0x22, 0x61, 0x56, 0x47,
0x7c, 0x69, 0xf0, 0xbe, 0x63, 0xc7, 0xd4, 0xd1, 0xb6, 0xb9, 0xd7, 0x74, 0xab, 0x4f, 0x99, 0xcd,
0x3d, 0x44, 0x02, 0x66, 0xd0, 0x18, 0x66, 0x83, 0xef, 0xc1, 0x63, 0xfa, 0x34, 0x0c, 0xd1, 0xa8,
0x6c, 0x58, 0x75, 0xf4, 0x0c, 0xa9, 0x3e, 0xfd, 0x06, 0x0d, 0xd4, 0x65, 0x3c, 0x82, 0x1f, 0xff,
0x84, 0x63, 0x5b, 0xdc, 0xb5, 0xe4, 0x11, 0x78, 0x80, 0x3c, 0xfe, 0x82, 0x5c, 0xf8, 0xee, 0x0e,
0x9f, 0x9e, 0x1c, 0x8b, 0xd9, 0xaf, 0x26, 0x20, 0x49, 0xf2, 0x6d, 0x0c, 0x86, 0x36, 0xaf, 0xaf,
0x97, 0xab, 0xa5, 0xb5, 0xad, 0xc2, 0x4a, 0x59, 0x53, 0xf4, 0x51, 0x00, 0x32, 0x70, 0x65, 0x65,
0x2d, 0xbf, 0xa9, 0x25, 0xbc, 0xef, 0xcb, 0x95, 0xcd, 0xf3, 0x4b, 0x9a, 0xea, 0x01, 0xb6, 0xe8,
0x40, 0x32, 0xc8, 0x70, 0x76, 0x51, 0xeb, 0xd7, 0x35, 0x18, 0xa6, 0x02, 0x96, 0x1f, 0x2f, 0x97,
0xce, 0x2f, 0x69, 0x03, 0xe2, 0xc8, 0xd9, 0x45, 0xed, 0x88, 0x3e, 0x02, 0x83, 0x64, 0xa4, 0xb0,
0xb6, 0xb6, 0xa2, 0xa5, 0x3c, 0x99, 0x1b, 0x9b, 0xc6, 0x72, 0xe5, 0xaa, 0x36, 0xe8, 0xc9, 0xbc,
0x6a, 0xac, 0x6d, 0xad, 0x6b, 0xe0, 0x49, 0x58, 0x2d, 0x6f, 0x6c, 0xe4, 0xaf, 0x96, 0xb5, 0x21,
0x8f, 0xa3, 0x70, 0x7d, 0xb3, 0xbc, 0xa1, 0x0d, 0x0b, 0x6a, 0x9d, 0x5d, 0xd4, 0x46, 0xbc, 0x47,
0x94, 0x2b, 0x5b, 0xab, 0xda, 0xa8, 0x3e, 0x0e, 0x23, 0xf4, 0x11, 0x5c, 0x89, 0x31, 0x69, 0xe8,
0xfc, 0x92, 0xa6, 0xf9, 0x8a, 0x50, 0x29, 0xe3, 0xc2, 0xc0, 0xf9, 0x25, 0x4d, 0xcf, 0x16, 0xa1,
0x9f, 0x44, 0x97, 0xae, 0xc3, 0xe8, 0x4a, 0xbe, 0x50, 0x5e, 0xa9, 0xae, 0xad, 0x6f, 0x2e, 0xaf,
0x55, 0xf2, 0x2b, 0x9a, 0xe2, 0x8f, 0x19, 0xe5, 0x77, 0x6f, 0x2d, 0x1b, 0xe5, 0x92, 0x96, 0x08,
0x8e, 0xad, 0x97, 0xf3, 0x9b, 0xe5, 0x92, 0xa6, 0x66, 0x6b, 0x70, 0x34, 0xac, 0xce, 0x84, 0x66,
0x46, 0xc0, 0xc5, 0x89, 0x1e, 0x2e, 0x26, 0xb2, 0xba, 0x5c, 0xfc, 0x59, 0x05, 0x26, 0x42, 0x6a,
0x6d, 0xe8, 0x43, 0x1e, 0x81, 0x7e, 0x1a, 0xa2, 0x74, 0xf5, 0xb9, 0x3f, 0xb4, 0x68, 0x93, 0x80,
0xed, 0x5a, 0x81, 0x08, 0x2e, 0xb8, 0x02, 0xab, 0x3d, 0x56, 0x60, 0x2c, 0xa2, 0x4b, 0xc9, 0x0f,
0x28, 0x90, 0xee, 0x25, 0x3b, 0xa2, 0x50, 0x24, 0x84, 0x42, 0x71, 0x59, 0x56, 0xe0, 0x44, 0xef,
0x39, 0x74, 0x69, 0xf1, 0x79, 0x05, 0x26, 0xc3, 0x1b, 0x95, 0x50, 0x1d, 0x1e, 0x86, 0x81, 0x16,
0x72, 0x77, 0x6d, 0xbe, 0x58, 0x9f, 0x0a, 0x59, 0x02, 0x30, 0x59, 0xb6, 0x15, 0x43, 0x05, 0xd7,
0x10, 0xb5, 0x57, 0xb7, 0x41, 0xb5, 0xe9, 0xd2, 0xf4, 0xc3, 0x09, 0xb8, 0x23, 0x54, 0x78, 0xa8,
0xa2, 0x77, 0x03, 0x34, 0xac, 0xf6, 0x9e, 0x4b, 0x17, 0x64, 0x5a, 0x9f, 0x06, 0xc9, 0x08, 0xc9,
0x7d, 0x5c, 0x7b, 0xf6, 0x5c, 0x8f, 0xae, 0x12, 0x3a, 0xd0, 0x21, 0xc2, 0x70, 0xd1, 0x57, 0x34,
0x49, 0x14, 0xcd, 0xf4, 0x98, 0x69, 0xd7, 0x5a, 0xb7, 0x00, 0x5a, 0xad, 0xd9, 0x40, 0x96, 0x5b,
0x75, 0xdc, 0x0e, 0x32, 0x5b, 0x0d, 0x6b, 0x87, 0x14, 0xe0, 0x54, 0xae, 0x7f, 0xdb, 0x6c, 0x3a,
0xc8, 0x18, 0xa3, 0xe4, 0x0d, 0x4e, 0xc5, 0x08, 0xb2, 0xca, 0x74, 0x02, 0x88, 0x01, 0x01, 0x41,
0xc9, 0x1e, 0x22, 0xfb, 0x8f, 0x47, 0x60, 0x28, 0xd0, 0xd6, 0xe9, 0x27, 0x60, 0xf8, 0x09, 0xf3,
0x29, 0xb3, 0xca, 0x5b, 0x75, 0x6a, 0x89, 0x21, 0x3c, 0xb6, 0xce, 0xda, 0xf5, 0x05, 0x38, 0x4a,
0x58, 0xec, 0x3d, 0x17, 0x75, 0xaa, 0xb5, 0xa6, 0xe9, 0x38, 0xc4, 0x68, 0x29, 0xc2, 0xaa, 0x63,
0xda, 0x1a, 0x26, 0x15, 0x39, 0x45, 0x3f, 0x07, 0x13, 0x04, 0xd1, 0xda, 0x6b, 0xba, 0x8d, 0x76,
0x13, 0x55, 0xf1, 0xcb, 0x83, 0x43, 0x0a, 0xb1, 0xa7, 0xd9, 0x38, 0xe6, 0x58, 0x65, 0x0c, 0x58,
0x23, 0x47, 0x2f, 0xc1, 0xdd, 0x04, 0xb6, 0x83, 0x2c, 0xd4, 0x31, 0x5d, 0x54, 0x45, 0xef, 0xdb,
0x33, 0x9b, 0x4e, 0xd5, 0xb4, 0xea, 0xd5, 0x5d, 0xd3, 0xd9, 0x4d, 0x1f, 0xc5, 0x02, 0x0a, 0x89,
0xb4, 0x62, 0xdc, 0x89, 0x19, 0xaf, 0x32, 0xbe, 0x32, 0x61, 0xcb, 0x5b, 0xf5, 0x47, 0x4d, 0x67,
0x57, 0xcf, 0xc1, 0x24, 0x91, 0xe2, 0xb8, 0x9d, 0x86, 0xb5, 0x53, 0xad, 0xed, 0xa2, 0xda, 0x93,
0xd5, 0x3d, 0x77, 0xfb, 0x62, 0xfa, 0xae, 0xe0, 0xf3, 0x89, 0x86, 0x1b, 0x84, 0xa7, 0x88, 0x59,
0xb6, 0xdc, 0xed, 0x8b, 0xfa, 0x06, 0x0c, 0x63, 0x67, 0xb4, 0x1a, 0xcf, 0xa2, 0xea, 0xb6, 0xdd,
0x21, 0x2b, 0xcb, 0x68, 0x48, 0x66, 0x07, 0x2c, 0x38, 0xbf, 0xc6, 0x00, 0xab, 0x76, 0x1d, 0xe5,
0xfa, 0x37, 0xd6, 0xcb, 0xe5, 0x92, 0x31, 0xc4, 0xa5, 0x5c, 0xb1, 0x3b, 0x38, 0xa0, 0x76, 0x6c,
0xcf, 0xc0, 0x43, 0x34, 0xa0, 0x76, 0x6c, 0x6e, 0xde, 0x73, 0x30, 0x51, 0xab, 0xd1, 0x39, 0x37,
0x6a, 0x55, 0xd6, 0xe2, 0x3b, 0x69, 0x4d, 0x30, 0x56, 0xad, 0x76, 0x95, 0x32, 0xb0, 0x18, 0x77,
0xf4, 0x4b, 0x70, 0x87, 0x6f, 0xac, 0x20, 0x70, 0xbc, 0x6b, 0x96, 0x32, 0xf4, 0x1c, 0x4c, 0xb4,
0xf7, 0xbb, 0x81, 0xba, 0xf0, 0xc4, 0xf6, 0xbe, 0x0c, 0xbb, 0x97, 0xbc, 0xb6, 0x75, 0x50, 0xcd,
0x74, 0x51, 0x3d, 0x7d, 0x2c, 0xc8, 0x1d, 0x20, 0xe8, 0xa7, 0x41, 0xab, 0xd5, 0xaa, 0xc8, 0x32,
0x6f, 0x34, 0x51, 0xd5, 0xec, 0x20, 0xcb, 0x74, 0xd2, 0xd3, 0x41, 0xe6, 0xd1, 0x5a, 0xad, 0x4c,
0xa8, 0x79, 0x42, 0xd4, 0xe7, 0x60, 0xdc, 0xbe, 0xf1, 0x44, 0x8d, 0x46, 0x56, 0xb5, 0xdd, 0x41,
0xdb, 0x8d, 0x67, 0xd2, 0x27, 0x89, 0x99, 0xc6, 0x30, 0x81, 0xc4, 0xd5, 0x3a, 0x19, 0xd6, 0xef,
0x07, 0xad, 0xe6, 0xec, 0x9a, 0x9d, 0x36, 0x59, 0xda, 0x9d, 0xb6, 0x59, 0x43, 0xe9, 0x7b, 0x29,
0x2b, 0x1d, 0xaf, 0xf0, 0x61, 0x1c, 0xd9, 0xce, 0xd3, 0x8d, 0x6d, 0x97, 0x4b, 0xbc, 0x8f, 0x46,
0x36, 0x19, 0x63, 0xd2, 0x66, 0x41, 0x6b, 0xef, 0xb6, 0xc5, 0x07, 0xcf, 0x12, 0xb6, 0xd1, 0xf6,
0x6e, 0x3b, 0xf8, 0xdc, 0xc7, 0xe1, 0xe8, 0x9e, 0xd5, 0xb0, 0x5c, 0xd4, 0x69, 0x77, 0x10, 0x6e,
0xf7, 0x69, 0xce, 0xa6, 0xff, 0xe5, 0x48, 0x8f, 0x86, 0x7d, 0x2b, 0xc8, 0x4d, 0x43, 0xc5, 0x98,
0xd8, 0xeb, 0x1e, 0xcc, 0xe6, 0x60, 0x38, 0x18, 0x41, 0xfa, 0x20, 0xd0, 0x18, 0xd2, 0x14, 0xbc,
0x1a, 0x17, 0xd7, 0x4a, 0x78, 0x1d, 0x7d, 0x6f, 0x59, 0x4b, 0xe0, 0xf5, 0x7c, 0x65, 0x79, 0xb3,
0x5c, 0x35, 0xb6, 0x2a, 0x9b, 0xcb, 0xab, 0x65, 0x4d, 0x9d, 0x1b, 0x4c, 0x7d, 0xff, 0x88, 0xf6,
0xdc, 0x73, 0xcf, 0x3d, 0x97, 0xc8, 0x7e, 0x33, 0x01, 0xa3, 0x62, 0x0f, 0xad, 0xbf, 0x13, 0x8e,
0xf1, 0x17, 0x5e, 0x07, 0xb9, 0xd5, 0xa7, 0x1b, 0x1d, 0x12, 0xd4, 0x2d, 0x93, 0x76, 0xa1, 0x9e,
0x3f, 0x8e, 0x32, 0xae, 0x0d, 0xe4, 0x3e, 0xd6, 0xe8, 0xe0, 0x90, 0x6d, 0x99, 0xae, 0xbe, 0x02,
0xd3, 0x96, 0x5d, 0x75, 0x5c, 0xd3, 0xaa, 0x9b, 0x9d, 0x7a, 0xd5, 0xdf, 0x6a, 0xa8, 0x9a, 0xb5,
0x1a, 0x72, 0x1c, 0x9b, 0x2e, 0x26, 0x9e, 0x94, 0xe3, 0x96, 0xbd, 0xc1, 0x98, 0xfd, 0x2a, 0x9b,
0x67, 0xac, 0x52, 0xec, 0xa8, 0xbd, 0x62, 0xe7, 0x2e, 0x18, 0x6c, 0x99, 0xed, 0x2a, 0xb2, 0xdc,
0xce, 0x3e, 0xe9, 0xfc, 0x52, 0x46, 0xaa, 0x65, 0xb6, 0xcb, 0xf8, 0xfb, 0xdb, 0xe7, 0x83, 0xa0,
0x1d, 0xff, 0x59, 0x85, 0xe1, 0x60, 0xf7, 0x87, 0x9b, 0xe9, 0x1a, 0xa9, 0xf4, 0x0a, 0xa9, 0x05,
0xf7, 0x1c, 0xd8, 0x2b, 0xce, 0x17, 0xf1, 0x12, 0x90, 0x1b, 0xa0, 0x3d, 0x99, 0x41, 0x91, 0x78,
0xf9, 0xc5, 0xd9, 0x8f, 0x68, 0xa7, 0x9f, 0x32, 0xd8, 0x37, 0xfd, 0x2a, 0x0c, 0x3c, 0xe1, 0x10,
0xd9, 0x03, 0x44, 0xf6, 0xc9, 0x83, 0x65, 0x5f, 0xdb, 0x20, 0xc2, 0x07, 0xaf, 0x6d, 0x54, 0x2b,
0x6b, 0xc6, 0x6a, 0x7e, 0xc5, 0x60, 0x70, 0xfd, 0x4e, 0x48, 0x36, 0xcd, 0x67, 0xf7, 0xc5, 0xc5,
0x82, 0x0c, 0xc5, 0x35, 0xfc, 0x9d, 0x90, 0x7c, 0x1a, 0x99, 0x4f, 0x8a, 0x25, 0x9a, 0x0c, 0xbd,
0x8d, 0xa1, 0x7f, 0x1a, 0xfa, 0x89, 0xbd, 0x74, 0x00, 0x66, 0x31, 0xad, 0x4f, 0x4f, 0x41, 0xb2,
0xb8, 0x66, 0xe0, 0xf0, 0xd7, 0x60, 0x98, 0x8e, 0x56, 0xd7, 0x97, 0xcb, 0xc5, 0xb2, 0x96, 0xc8,
0x9e, 0x83, 0x01, 0x6a, 0x04, 0x9c, 0x1a, 0x9e, 0x19, 0xb4, 0x3e, 0xf6, 0x95, 0xc9, 0x50, 0x38,
0x75, 0x6b, 0xb5, 0x50, 0x36, 0xb4, 0x44, 0xd0, 0xbd, 0x0e, 0x0c, 0x07, 0x1b, 0xbf, 0x9f, 0x4d,
0x4c, 0x7d, 0x5d, 0x81, 0xa1, 0x40, 0x23, 0x87, 0x5b, 0x08, 0xb3, 0xd9, 0xb4, 0x9f, 0xae, 0x9a,
0xcd, 0x86, 0xe9, 0xb0, 0xa0, 0x00, 0x32, 0x94, 0xc7, 0x23, 0x71, 0x9d, 0xf6, 0x33, 0x51, 0xfe,
0x79, 0x05, 0x34, 0xb9, 0x09, 0x94, 0x14, 0x54, 0x7e, 0xae, 0x0a, 0x7e, 0x52, 0x81, 0x51, 0xb1,
0xf3, 0x93, 0xd4, 0x3b, 0xf1, 0x73, 0x55, 0xef, 0x3b, 0x09, 0x18, 0x11, 0xfa, 0xbd, 0xb8, 0xda,
0xbd, 0x0f, 0xc6, 0x1b, 0x75, 0xd4, 0x6a, 0xdb, 0x2e, 0xb2, 0x6a, 0xfb, 0xd5, 0x26, 0x7a, 0x0a,
0x35, 0xd3, 0x59, 0x52, 0x28, 0x4e, 0x1f, 0xdc, 0x51, 0xce, 0x2f, 0xfb, 0xb8, 0x15, 0x0c, 0xcb,
0x4d, 0x2c, 0x97, 0xca, 0xab, 0xeb, 0x6b, 0x9b, 0xe5, 0x4a, 0xf1, 0x7a, 0x75, 0xab, 0xf2, 0xae,
0xca, 0xda, 0x63, 0x15, 0x43, 0x6b, 0x48, 0x6c, 0x6f, 0x63, 0xaa, 0xaf, 0x83, 0x26, 0x2b, 0xa5,
0x1f, 0x83, 0x30, 0xb5, 0xb4, 0x3e, 0x7d, 0x02, 0xc6, 0x2a, 0x6b, 0xd5, 0x8d, 0xe5, 0x52, 0xb9,
0x5a, 0xbe, 0x72, 0xa5, 0x5c, 0xdc, 0xdc, 0xa0, 0xaf, 0xd8, 0x1e, 0xf7, 0xa6, 0x98, 0xd4, 0x9f,
0x50, 0x61, 0x22, 0x44, 0x13, 0x3d, 0xcf, 0xba, 0x7b, 0xfa, 0xc2, 0xf1, 0x60, 0x1c, 0xed, 0xe7,
0x71, 0xff, 0xb0, 0x6e, 0x76, 0x5c, 0xf6, 0x32, 0x70, 0x3f, 0x60, 0x2b, 0x59, 0x6e, 0x63, 0xbb,
0x81, 0x3a, 0x6c, 0x47, 0x82, 0xb6, 0xfc, 0x63, 0xfe, 0x38, 0xdd, 0x94, 0x78, 0x00, 0xf4, 0xb6,
0xed, 0x34, 0xdc, 0xc6, 0x53, 0xa8, 0xda, 0xb0, 0xf8, 0xf6, 0x05, 0x7e, 0x05, 0x48, 0x1a, 0x1a,
0xa7, 0x2c, 0x5b, 0xae, 0xc7, 0x6d, 0xa1, 0x1d, 0x53, 0xe2, 0xc6, 0x05, 0x5c, 0x35, 0x34, 0x4e,
0xf1, 0xb8, 0x4f, 0xc0, 0x70, 0xdd, 0xde, 0xc3, 0x0d, 0x15, 0xe5, 0xc3, 0xeb, 0x85, 0x62, 0x0c,
0xd1, 0x31, 0x8f, 0x85, 0x75, 0xbc, 0xfe, 0xbe, 0xc9, 0xb0, 0x31, 0x44, 0xc7, 0x28, 0xcb, 0x7d,
0x30, 0x66, 0xee, 0xec, 0x74, 0xb0, 0x70, 0x2e, 0x88, 0xf6, 0xf0, 0xa3, 0xde, 0x30, 0x61, 0x9c,
0xba, 0x06, 0x29, 0x6e, 0x07, 0xbc, 0x24, 0x63, 0x4b, 0x54, 0xdb, 0x74, 0xf7, 0x2a, 0x31, 0x3b,
0x68, 0xa4, 0x2c, 0x4e, 0x3c, 0x01, 0xc3, 0x0d, 0xa7, 0xea, 0x6f, 0xa3, 0x26, 0x66, 0x12, 0xb3,
0x29, 0x63, 0xa8, 0xe1, 0x78, 0xfb, 0x66, 0xd9, 0xcf, 0x27, 0x60, 0x54, 0xdc, 0x06, 0xd6, 0x4b,
0x90, 0x6a, 0xda, 0x35, 0x93, 0x84, 0x16, 0x3d, 0x83, 0x98, 0x8d, 0xd8, 0x39, 0x9e, 0x5f, 0x61,
0xfc, 0x86, 0x87, 0x9c, 0xfa, 0x7b, 0x05, 0x52, 0x7c, 0x58, 0x9f, 0x84, 0x64, 0xdb, 0x74, 0x77,
0x89, 0xb8, 0xfe, 0x42, 0x42, 0x53, 0x0c, 0xf2, 0x1d, 0x8f, 0x3b, 0x6d, 0xd3, 0x22, 0x21, 0xc0,
0xc6, 0xf1, 0x77, 0xec, 0xd7, 0x26, 0x32, 0xeb, 0xe4, 0x05, 0xc1, 0x6e, 0xb5, 0x90, 0xe5, 0x3a,
0xdc, 0xaf, 0x6c, 0xbc, 0xc8, 0x86, 0xf5, 0x77, 0xc0, 0xb8, 0xdb, 0x31, 0x1b, 0x4d, 0x81, 0x37,
0x49, 0x78, 0x35, 0x4e, 0xf0, 0x98, 0x73, 0x70, 0x27, 0x97, 0x5b, 0x47, 0xae, 0x59, 0xdb, 0x45,
0x75, 0x1f, 0x34, 0x40, 0xf6, 0x18, 0x8f, 0x31, 0x86, 0x12, 0xa3, 0x73, 0x6c, 0xf6, 0x5b, 0x0a,
0x8c, 0xf3, 0x57, 0x9a, 0xba, 0x67, 0xac, 0x55, 0x00, 0xd3, 0xb2, 0x6c, 0x37, 0x68, 0xae, 0xee,
0x50, 0xee, 0xc2, 0xcd, 0xe7, 0x3d, 0x90, 0x11, 0x10, 0x30, 0xd5, 0x02, 0xf0, 0x29, 0x3d, 0xcd,
0x36, 0x0d, 0x43, 0x6c, 0x8f, 0x9f, 0x1c, 0x14, 0xd1, 0x97, 0x60, 0xa0, 0x43, 0xf8, 0xdd, 0x47,
0x3f, 0x0a, 0xfd, 0x37, 0xd0, 0x4e, 0xc3, 0x62, 0x3b, 0x8f, 0xf4, 0x0b, 0xdf, 0xcf, 0x4c, 0x7a,
0xfb, 0x99, 0x85, 0xc7, 0x61, 0xa2, 0x66, 0xb7, 0x64, 0x75, 0x0b, 0x9a, 0xf4, 0x22, 0xee, 0x3c,
0xaa, 0xbc, 0x17, 0xfc, 0x16, 0xf3, 0xb3, 0x09, 0xf5, 0xea, 0x7a, 0xe1, 0x8b, 0x89, 0xa9, 0xab,
0x14, 0xb7, 0xce, 0xa7, 0x69, 0xa0, 0xed, 0x26, 0xaa, 0x61, 0xd5, 0xe1, 0x47, 0xa7, 0xe0, 0xc1,
0x9d, 0x86, 0xbb, 0xbb, 0x77, 0x63, 0xbe, 0x66, 0xb7, 0x4e, 0xef, 0xd8, 0x3b, 0xb6, 0x7f, 0x30,
0x86, 0xbf, 0x91, 0x2f, 0xe4, 0x13, 0x3b, 0x1c, 0x1b, 0xf4, 0x46, 0xa7, 0x22, 0x4f, 0xd2, 0x72,
0x15, 0x98, 0x60, 0xcc, 0x55, 0xb2, 0x3b, 0x4f, 0xdf, 0x0e, 0xf4, 0x03, 0x77, 0x68, 0xd2, 0x5f,
0xfe, 0x1e, 0x59, 0xab, 0x8d, 0x71, 0x06, 0xc5, 0x34, 0xfa, 0x02, 0x91, 0x33, 0xe0, 0x0e, 0x41,
0x1e, 0xcd, 0x4b, 0xd4, 0x89, 0x90, 0xf8, 0x4d, 0x26, 0x71, 0x22, 0x20, 0x71, 0x83, 0x41, 0x73,
0x45, 0x18, 0x39, 0x8c, 0xac, 0xbf, 0x66, 0xb2, 0x86, 0x51, 0x50, 0xc8, 0x55, 0x18, 0x23, 0x42,
0x6a, 0x7b, 0x8e, 0x6b, 0xb7, 0x48, 0xd1, 0x3b, 0x58, 0xcc, 0xdf, 0x7c, 0x8f, 0x26, 0xca, 0x28,
0x86, 0x15, 0x3d, 0x54, 0x2e, 0x07, 0xe4, 0x40, 0xa2, 0x8e, 0x6a, 0xcd, 0x08, 0x09, 0x37, 0x99,
0x22, 0x1e, 0x7f, 0xee, 0x3d, 0x70, 0x14, 0x7f, 0x26, 0x35, 0x29, 0xa8, 0x49, 0xf4, 0x7e, 0x54,
0xfa, 0x5b, 0x1f, 0xa0, 0xb9, 0x38, 0xe1, 0x09, 0x08, 0xe8, 0x14, 0xf0, 0xe2, 0x0e, 0x72, 0x5d,
0xd4, 0x71, 0xaa, 0x66, 0x33, 0x4c, 0xbd, 0xc0, 0x0b, 0x7d, 0xfa, 0xe3, 0xaf, 0x89, 0x5e, 0xbc,
0x4a, 0x91, 0xf9, 0x66, 0x33, 0xb7, 0x05, 0xc7, 0x42, 0xa2, 0x22, 0x86, 0xcc, 0x4f, 0x30, 0x99,
0x47, 0xbb, 0x22, 0x03, 0x8b, 0x5d, 0x07, 0x3e, 0xee, 0xf9, 0x32, 0x86, 0xcc, 0xdf, 0x65, 0x32,
0x75, 0x86, 0xe5, 0x2e, 0xc5, 0x12, 0xaf, 0xc1, 0xf8, 0x53, 0xa8, 0x73, 0xc3, 0x76, 0xd8, 0x26,
0x4a, 0x0c, 0x71, 0x9f, 0x64, 0xe2, 0xc6, 0x18, 0x90, 0xec, 0xaa, 0x60, 0x59, 0x97, 0x20, 0xb5,
0x6d, 0xd6, 0x50, 0x0c, 0x11, 0x9f, 0x62, 0x22, 0x8e, 0x60, 0x7e, 0x0c, 0xcd, 0xc3, 0xf0, 0x8e,
0xcd, 0x96, 0xa5, 0x68, 0xf8, 0xf3, 0x0c, 0x3e, 0xc4, 0x31, 0x4c, 0x44, 0xdb, 0x6e, 0xef, 0x35,
0xf1, 0x9a, 0x15, 0x2d, 0xe2, 0xd3, 0x5c, 0x04, 0xc7, 0x30, 0x11, 0x87, 0x30, 0xeb, 0x0b, 0x5c,
0x84, 0x13, 0xb0, 0xe7, 0x23, 0x30, 0x64, 0x5b, 0xcd, 0x7d, 0xdb, 0x8a, 0xa3, 0xc4, 0x67, 0x98,
0x04, 0x60, 0x10, 0x2c, 0xe0, 0x32, 0x0c, 0xc6, 0x75, 0xc4, 0xe7, 0x5e, 0xe3, 0xe9, 0xc1, 0x3d,
0x70, 0x15, 0xc6, 0x78, 0x81, 0x6a, 0xd8, 0x56, 0x0c, 0x11, 0xbf, 0xcf, 0x44, 0x8c, 0x06, 0x60,
0x6c, 0x1a, 0x2e, 0x72, 0xdc, 0x1d, 0x14, 0x47, 0xc8, 0xe7, 0xf9, 0x34, 0x18, 0x84, 0x99, 0xf2,
0x06, 0xb2, 0x6a, 0xbb, 0xf1, 0x24, 0xbc, 0xc8, 0x4d, 0xc9, 0x31, 0x58, 0x44, 0x11, 0x46, 0x5a,
0x66, 0xc7, 0xd9, 0x35, 0x9b, 0xb1, 0xdc, 0xf1, 0x05, 0x26, 0x63, 0xd8, 0x03, 0x31, 0x8b, 0xec,
0x59, 0x87, 0x11, 0xf3, 0x45, 0x6e, 0x91, 0x00, 0x8c, 0xa5, 0x9e, 0xe3, 0x92, 0xad, 0xaa, 0xc3,
0x48, 0xfb, 0x03, 0x9e, 0x7a, 0x14, 0xbb, 0x1a, 0x94, 0x78, 0x19, 0x06, 0x9d, 0xc6, 0xb3, 0xb1,
0xc4, 0xfc, 0x21, 0xf7, 0x34, 0x01, 0x60, 0xf0, 0x75, 0xb8, 0x33, 0x74, 0x99, 0x88, 0x21, 0xec,
0x8f, 0x98, 0xb0, 0xc9, 0x90, 0xa5, 0x82, 0x95, 0x84, 0xc3, 0x8a, 0xfc, 0x63, 0x5e, 0x12, 0x90,
0x24, 0x6b, 0x1d, 0xbf, 0x28, 0x38, 0xe6, 0xf6, 0xe1, 0xac, 0xf6, 0x27, 0xdc, 0x6a, 0x14, 0x2b,
0x58, 0x6d, 0x13, 0x26, 0x99, 0xc4, 0xc3, 0xf9, 0xf5, 0x4b, 0xbc, 0xb0, 0x52, 0xf4, 0x96, 0xe8,
0xdd, 0xff, 0x05, 0x53, 0x9e, 0x39, 0x79, 0x47, 0xea, 0x54, 0x5b, 0x66, 0x3b, 0x86, 0xe4, 0x2f,
0x33, 0xc9, 0xbc, 0xe2, 0x7b, 0x2d, 0xad, 0xb3, 0x6a, 0xb6, 0xb1, 0xf0, 0xc7, 0x21, 0xcd, 0x85,
0xef, 0x59, 0x1d, 0x54, 0xb3, 0x77, 0xac, 0xc6, 0xb3, 0xa8, 0x1e, 0x43, 0xf4, 0x9f, 0x4a, 0xae,
0xda, 0x0a, 0xc0, 0xb1, 0xe4, 0x65, 0xd0, 0xbc, 0x5e, 0xa5, 0xda, 0x68, 0xb5, 0xed, 0x8e, 0x1b,
0x21, 0xf1, 0xcf, 0xb8, 0xa7, 0x3c, 0xdc, 0x32, 0x81, 0xe5, 0xca, 0x30, 0x4a, 0xbe, 0xc6, 0x0d,
0xc9, 0xaf, 0x30, 0x41, 0x23, 0x3e, 0x8a, 0x15, 0x8e, 0x9a, 0xdd, 0x6a, 0x9b, 0x9d, 0x38, 0xf5,
0xef, 0xcf, 0x79, 0xe1, 0x60, 0x10, 0x56, 0x38, 0xdc, 0xfd, 0x36, 0xc2, 0xab, 0x7d, 0x0c, 0x09,
0x5f, 0xe5, 0x85, 0x83, 0x63, 0x98, 0x08, 0xde, 0x30, 0xc4, 0x10, 0xf1, 0x17, 0x5c, 0x04, 0xc7,
0x60, 0x11, 0xef, 0xf6, 0x17, 0xda, 0x0e, 0xda, 0x69, 0x38, 0x6e, 0x87, 0xf6, 0xc1, 0x07, 0x8b,
0xfa, 0xda, 0x6b, 0x62, 0x13, 0x66, 0x04, 0xa0, 0xb9, 0x6b, 0x30, 0x26, 0xb5, 0x18, 0x7a, 0xd4,
0xed, 0x86, 0xf4, 0xff, 0x7d, 0x9d, 0x15, 0x23, 0xb1, 0xc3, 0xc8, 0xad, 0x60, 0xbf, 0x8b, 0x7d,
0x40, 0xb4, 0xb0, 0x0f, 0xbc, 0xee, 0xb9, 0x5e, 0x68, 0x03, 0x72, 0x57, 0x60, 0x44, 0xe8, 0x01,
0xa2, 0x45, 0xfd, 0x3f, 0x26, 0x6a, 0x38, 0xd8, 0x02, 0xe4, 0xce, 0x41, 0x12, 0xaf, 0xe7, 0xd1,
0xf0, 0xff, 0xcf, 0xe0, 0x84, 0x3d, 0xf7, 0x10, 0xa4, 0xf8, 0x3a, 0x1e, 0x0d, 0xfd, 0x20, 0x83,
0x7a, 0x10, 0x0c, 0xe7, 0x6b, 0x78, 0x34, 0xfc, 0x97, 0x38, 0x9c, 0x43, 0x30, 0x3c, 0xbe, 0x09,
0x5f, 0xfa, 0x95, 0x24, 0xab, 0xc3, 0xdc, 0x76, 0x97, 0xe1, 0x08, 0x5b, 0xbc, 0xa3, 0xd1, 0x1f,
0x66, 0x0f, 0xe7, 0x88, 0xdc, 0x05, 0xe8, 0x8f, 0x69, 0xf0, 0x8f, 0x30, 0x28, 0xe5, 0xcf, 0x15,
0x61, 0x28, 0xb0, 0x60, 0x47, 0xc3, 0x7f, 0x95, 0xc1, 0x83, 0x28, 0xac, 0x3a, 0x5b, 0xb0, 0xa3,
0x05, 0xfc, 0x1a, 0x57, 0x9d, 0x21, 0xb0, 0xd9, 0xf8, 0x5a, 0x1d, 0x8d, 0xfe, 0x75, 0x6e, 0x75,
0x0e, 0xc9, 0x3d, 0x02, 0x83, 0x5e, 0xfd, 0x8d, 0xc6, 0xff, 0x06, 0xc3, 0xfb, 0x18, 0x6c, 0x81,
0x40, 0xfd, 0x8f, 0x16, 0xf1, 0x9b, 0xdc, 0x02, 0x01, 0x14, 0x4e, 0x23, 0x79, 0x4d, 0x8f, 0x96,
0xf4, 0x51, 0x9e, 0x46, 0xd2, 0x92, 0x8e, 0xbd, 0x49, 0xca, 0x60, 0xb4, 0x88, 0xdf, 0xe2, 0xde,
0x24, 0xfc, 0x58, 0x0d, 0x79, 0x91, 0x8c, 0x96, 0xf1, 0x3b, 0x5c, 0x0d, 0x69, 0x8d, 0xcc, 0xad,
0x83, 0xde, 0xbd, 0x40, 0x46, 0xcb, 0xfb, 0x18, 0x93, 0x37, 0xde, 0xb5, 0x3e, 0xe6, 0x1e, 0x83,
0xc9, 0xf0, 0xc5, 0x31, 0x5a, 0xea, 0xc7, 0x5f, 0x97, 0x5e, 0x67, 0x82, 0x6b, 0x63, 0x6e, 0xd3,
0xaf, 0xb2, 0xc1, 0x85, 0x31, 0x5a, 0xec, 0x27, 0x5e, 0x17, 0x0b, 0x6d, 0x70, 0x5d, 0xcc, 0xe5,
0x01, 0xfc, 0x35, 0x29, 0x5a, 0xd6, 0x27, 0x99, 0xac, 0x00, 0x08, 0xa7, 0x06, 0x5b, 0x92, 0xa2,
0xf1, 0x9f, 0xe2, 0xa9, 0xc1, 0x10, 0x38, 0x35, 0xf8, 0x6a, 0x14, 0x8d, 0x7e, 0x9e, 0xa7, 0x06,
0x87, 0xe4, 0x2e, 0x43, 0xca, 0xda, 0x6b, 0x36, 0x71, 0x6c, 0xe9, 0x07, 0x5f, 0x38, 0x4a, 0xff,
0xeb, 0x1b, 0x0c, 0xcc, 0x01, 0xb9, 0x73, 0xd0, 0x8f, 0x5a, 0x37, 0x50, 0x3d, 0x0a, 0xf9, 0x6f,
0x6f, 0xf0, 0x7a, 0x82, 0xb9, 0x73, 0x8f, 0x00, 0xd0, 0x97, 0x69, 0x72, 0x4a, 0x14, 0x81, 0xfd,
0xf7, 0x37, 0xd8, 0x5d, 0x06, 0x1f, 0xe2, 0x0b, 0xa0, 0x37, 0x23, 0x0e, 0x16, 0xf0, 0x9a, 0x28,
0x80, 0xbc, 0x80, 0x5f, 0x82, 0x23, 0x4f, 0x38, 0xb6, 0xe5, 0x9a, 0x3b, 0x51, 0xe8, 0xff, 0x60,
0x68, 0xce, 0x8f, 0x0d, 0xd6, 0xb2, 0x3b, 0xc8, 0x35, 0x77, 0x9c, 0x28, 0xec, 0x7f, 0x32, 0xac,
0x07, 0xc0, 0xe0, 0x9a, 0xe9, 0xb8, 0x71, 0xe6, 0xfd, 0x5f, 0x1c, 0xcc, 0x01, 0x58, 0x69, 0xfc,
0xf9, 0x49, 0xb4, 0x1f, 0x85, 0xfd, 0x01, 0x57, 0x9a, 0xf1, 0xe7, 0x1e, 0x82, 0x41, 0xfc, 0x91,
0xde, 0xef, 0x89, 0x00, 0xff, 0x90, 0x81, 0x7d, 0x04, 0x7e, 0xb2, 0xe3, 0xd6, 0xdd, 0x46, 0xb4,
0xb1, 0xff, 0x9b, 0x79, 0x9a, 0xf3, 0xe7, 0xf2, 0x30, 0xe4, 0xb8, 0xf5, 0xfa, 0x1e, 0xeb, 0x68,
0x22, 0xe0, 0x3f, 0x7a, 0xc3, 0x7b, 0xc9, 0xf5, 0x30, 0x85, 0x13, 0xe1, 0x9b, 0x75, 0x70, 0xd5,
0xbe, 0x6a, 0xd3, 0x6d, 0x3a, 0xf8, 0xbb, 0x26, 0x64, 0x6a, 0x76, 0xeb, 0x86, 0xed, 0x9c, 0xf6,
0x0a, 0xc9, 0x69, 0x77, 0x17, 0xe1, 0xf5, 0x83, 0x6d, 0xb3, 0x25, 0xf1, 0xe7, 0xa9, 0xc3, 0xed,
0xcd, 0x91, 0x63, 0xd7, 0x4a, 0x03, 0xab, 0x57, 0x21, 0x3b, 0xdf, 0xfa, 0x71, 0x18, 0x20, 0x0a,
0x9f, 0x21, 0xa7, 0x4b, 0x4a, 0x21, 0x79, 0xf3, 0x95, 0xe9, 0x3e, 0x83, 0x8d, 0x79, 0xd4, 0x45,
0xb2, 0x35, 0x99, 0x10, 0xa8, 0x8b, 0x1e, 0xf5, 0x2c, 0xdd, 0x9d, 0x14, 0xa8, 0x67, 0x3d, 0xea,
0x12, 0xd9, 0xa7, 0x54, 0x05, 0xea, 0x92, 0x47, 0x3d, 0x47, 0xf6, 0xe2, 0x47, 0x04, 0xea, 0x39,
0x8f, 0x7a, 0x9e, 0xec, 0xc0, 0x27, 0x05, 0xea, 0x79, 0x8f, 0x7a, 0x81, 0x6c, 0xbe, 0x8f, 0x0b,
0xd4, 0x0b, 0x1e, 0xf5, 0x22, 0xd9, 0x74, 0xd7, 0x05, 0xea, 0x45, 0x8f, 0x7a, 0x89, 0xdc, 0x39,
0x39, 0x22, 0x50, 0x2f, 0xe9, 0x19, 0x38, 0x42, 0x67, 0xbe, 0x40, 0x4e, 0x68, 0xc7, 0x18, 0x99,
0x0f, 0xfa, 0xf4, 0x33, 0xe4, 0x7e, 0xc9, 0x80, 0x48, 0x3f, 0xe3, 0xd3, 0x17, 0xc9, 0x4d, 0x6b,
0x4d, 0xa4, 0x2f, 0xfa, 0xf4, 0xb3, 0xe9, 0x11, 0x72, 0xc7, 0x46, 0xa0, 0x9f, 0xf5, 0xe9, 0x4b,
0xe9, 0x51, 0x1c, 0xb3, 0x22, 0x7d, 0xc9, 0xa7, 0x9f, 0x4b, 0x8f, 0xcd, 0x28, 0xb3, 0xc3, 0x22,
0xfd, 0x5c, 0xf6, 0xfd, 0xc4, 0xbd, 0x96, 0xef, 0xde, 0x49, 0xd1, 0xbd, 0x9e, 0x63, 0x27, 0x45,
0xc7, 0x7a, 0x2e, 0x9d, 0x14, 0x5d, 0xea, 0x39, 0x73, 0x52, 0x74, 0xa6, 0xe7, 0xc6, 0x49, 0xd1,
0x8d, 0x9e, 0x03, 0x27, 0x45, 0x07, 0x7a, 0xae, 0x9b, 0x14, 0x5d, 0xe7, 0x39, 0x6d, 0x52, 0x74,
0x9a, 0xe7, 0xae, 0x49, 0xd1, 0x5d, 0x9e, 0xa3, 0xd2, 0x92, 0xa3, 0x7c, 0x17, 0xa5, 0x25, 0x17,
0xf9, 0xce, 0x49, 0x4b, 0xce, 0xf1, 0xdd, 0x92, 0x96, 0xdc, 0xe2, 0x3b, 0x24, 0x2d, 0x39, 0xc4,
0x77, 0x45, 0x5a, 0x72, 0x85, 0xef, 0x04, 0x96, 0x63, 0x06, 0x6a, 0x87, 0xe4, 0x98, 0x7a, 0x60,
0x8e, 0xa9, 0x07, 0xe6, 0x98, 0x7a, 0x60, 0x8e, 0xa9, 0x07, 0xe6, 0x98, 0x7a, 0x60, 0x8e, 0xa9,
0x07, 0xe6, 0x98, 0x7a, 0x60, 0x8e, 0xa9, 0x07, 0xe6, 0x98, 0x7a, 0x70, 0x8e, 0xa9, 0x11, 0x39,
0xa6, 0x46, 0xe4, 0x98, 0x1a, 0x91, 0x63, 0x6a, 0x44, 0x8e, 0xa9, 0x11, 0x39, 0xa6, 0xf6, 0xcc,
0x31, 0xdf, 0xbd, 0x93, 0xa2, 0x7b, 0x43, 0x73, 0x4c, 0xed, 0x91, 0x63, 0x6a, 0x8f, 0x1c, 0x53,
0x7b, 0xe4, 0x98, 0xda, 0x23, 0xc7, 0xd4, 0x1e, 0x39, 0xa6, 0xf6, 0xc8, 0x31, 0xb5, 0x47, 0x8e,
0xa9, 0xbd, 0x72, 0x4c, 0xed, 0x99, 0x63, 0x6a, 0xcf, 0x1c, 0x53, 0x7b, 0xe6, 0x98, 0xda, 0x33,
0xc7, 0xd4, 0x9e, 0x39, 0xa6, 0x06, 0x73, 0xec, 0x2f, 0x55, 0xd0, 0x69, 0x8e, 0xad, 0x93, 0x3b,
0x3e, 0xcc, 0x15, 0x19, 0x29, 0xd3, 0x06, 0xb0, 0xeb, 0x34, 0xdf, 0x25, 0x19, 0x29, 0xd7, 0x44,
0xfa, 0xa2, 0x47, 0xe7, 0xd9, 0x26, 0xd2, 0xcf, 0x7a, 0x74, 0x9e, 0x6f, 0x22, 0x7d, 0xc9, 0xa3,
0xf3, 0x8c, 0x13, 0xe9, 0xe7, 0x3c, 0x3a, 0xcf, 0x39, 0x91, 0x7e, 0xde, 0xa3, 0xf3, 0xac, 0x13,
0xe9, 0x17, 0x3c, 0x3a, 0xcf, 0x3b, 0x91, 0x7e, 0xd1, 0xa3, 0xf3, 0xcc, 0x13, 0xe9, 0x97, 0xf4,
0x19, 0x39, 0xf7, 0x38, 0x83, 0xe7, 0xda, 0x19, 0x39, 0xfb, 0x24, 0x8e, 0x33, 0x3e, 0x07, 0xcf,
0x3f, 0x89, 0x63, 0xd1, 0xe7, 0xe0, 0x19, 0x28, 0x71, 0x9c, 0xcd, 0x7e, 0x88, 0xb8, 0xcf, 0x92,
0xdd, 0x37, 0x25, 0xb9, 0x2f, 0x11, 0x70, 0xdd, 0x94, 0xe4, 0xba, 0x44, 0xc0, 0x6d, 0x53, 0x92,
0xdb, 0x12, 0x01, 0x97, 0x4d, 0x49, 0x2e, 0x4b, 0x04, 0xdc, 0x35, 0x25, 0xb9, 0x2b, 0x11, 0x70,
0xd5, 0x94, 0xe4, 0xaa, 0x44, 0xc0, 0x4d, 0x53, 0x92, 0x9b, 0x12, 0x01, 0x17, 0x4d, 0x49, 0x2e,
0x4a, 0x04, 0xdc, 0x33, 0x25, 0xb9, 0x27, 0x11, 0x70, 0xcd, 0x71, 0xd9, 0x35, 0x89, 0xa0, 0x5b,
0x8e, 0xcb, 0x6e, 0x49, 0x04, 0x5d, 0x72, 0x5c, 0x76, 0x49, 0x22, 0xe8, 0x8e, 0xe3, 0xb2, 0x3b,
0x12, 0x41, 0x57, 0xfc, 0x34, 0xc1, 0x3b, 0xc2, 0x0d, 0xb7, 0xb3, 0x57, 0x73, 0x6f, 0xab, 0x23,
0x5c, 0x10, 0xda, 0x87, 0xa1, 0x45, 0x7d, 0x9e, 0x34, 0xac, 0xc1, 0x8e, 0x53, 0x5a, 0xc1, 0x16,
0x84, 0xc6, 0x22, 0x80, 0xb0, 0xc2, 0x11, 0x4b, 0xb7, 0xd5, 0x1b, 0x2e, 0x08, 0x6d, 0x46, 0xb4,
0x7e, 0x17, 0xdf, 0xf6, 0x8e, 0xed, 0xa5, 0x04, 0xef, 0xd8, 0x98, 0xf9, 0x0f, 0xdb, 0xb1, 0xcd,
0x45, 0x9b, 0xdc, 0x33, 0xf6, 0x5c, 0xb4, 0xb1, 0xbb, 0x56, 0x9d, 0xb8, 0x1d, 0xdc, 0x5c, 0xb4,
0x69, 0x3d, 0xa3, 0xbe, 0xb5, 0xfd, 0x16, 0x8b, 0x60, 0x03, 0xb5, 0x43, 0x22, 0xf8, 0xb0, 0xfd,
0xd6, 0x82, 0x50, 0x4a, 0x0e, 0x1b, 0xc1, 0xea, 0xa1, 0x23, 0xf8, 0xb0, 0x9d, 0xd7, 0x82, 0x50,
0x5e, 0x0e, 0x1d, 0xc1, 0x6f, 0x43, 0x3f, 0xc4, 0x22, 0xd8, 0x37, 0xff, 0x61, 0xfb, 0xa1, 0xb9,
0x68, 0x93, 0x87, 0x46, 0xb0, 0x7a, 0x88, 0x08, 0x8e, 0xd3, 0x1f, 0xcd, 0x45, 0x9b, 0x36, 0x3c,
0x82, 0x6f, 0xbb, 0x9b, 0xf9, 0xb4, 0x02, 0xe3, 0x95, 0x46, 0xbd, 0xdc, 0xba, 0x81, 0xea, 0x75,
0x54, 0x67, 0x76, 0x5c, 0x10, 0x2a, 0x41, 0x0f, 0x57, 0xbf, 0xfc, 0xca, 0xb4, 0x6f, 0xe1, 0x73,
0x90, 0xa2, 0x36, 0x5d, 0x58, 0x48, 0xdf, 0x54, 0x22, 0x2a, 0x9c, 0xc7, 0xaa, 0x9f, 0xe0, 0xb0,
0x33, 0x0b, 0xe9, 0x7f, 0x50, 0x02, 0x55, 0xce, 0x1b, 0xce, 0x7e, 0x94, 0x68, 0x68, 0xdd, 0xb6,
0x86, 0xa7, 0x63, 0x69, 0x18, 0xd0, 0xed, 0xae, 0x2e, 0xdd, 0x02, 0x5a, 0xed, 0xc1, 0x58, 0xa5,
0x51, 0xaf, 0x90, 0xbf, 0xf1, 0x8d, 0xa3, 0x12, 0xe5, 0x91, 0xea, 0xc1, 0x82, 0x10, 0x96, 0x41,
0x84, 0x17, 0xd2, 0x62, 0x8d, 0xc8, 0x36, 0xf0, 0x63, 0x2d, 0xe1, 0xb1, 0x73, 0xbd, 0x1e, 0xeb,
0x57, 0x76, 0xef, 0x81, 0x73, 0xbd, 0x1e, 0xe8, 0xe7, 0x90, 0xf7, 0xa8, 0x67, 0xf8, 0xe2, 0x4c,
0x2f, 0xdb, 0xe8, 0xc7, 0x21, 0xb1, 0x4c, 0x2f, 0x02, 0x0f, 0x17, 0x86, 0xb1, 0x52, 0xdf, 0x7e,
0x65, 0x3a, 0xb9, 0xb5, 0xd7, 0xa8, 0x1b, 0x89, 0xe5, 0xba, 0x7e, 0x0d, 0xfa, 0xdf, 0xc3, 0xfe,
0x52, 0x0e, 0x33, 0x2c, 0x31, 0x86, 0x07, 0x7a, 0xee, 0x11, 0xe1, 0x07, 0x9f, 0xa6, 0xdb, 0x88,
0xf3, 0x5b, 0x0d, 0xcb, 0x3d, 0xb3, 0x78, 0xd1, 0xa0, 0x22, 0xb2, 0xff, 0x1b, 0x80, 0x3e, 0xb3,
0x64, 0x3a, 0xbb, 0x7a, 0x85, 0x4b, 0xa6, 0x8f, 0xbe, 0xf8, 0xed, 0x57, 0xa6, 0x97, 0xe2, 0x48,
0x7d, 0xb0, 0x6e, 0x3a, 0xbb, 0x0f, 0xba, 0xfb, 0x6d, 0x34, 0x5f, 0xd8, 0x77, 0x91, 0xc3, 0xa5,
0xb7, 0xf9, 0xaa, 0xc7, 0xe6, 0x95, 0x0e, 0xcc, 0x2b, 0x25, 0xcc, 0xe9, 0x8a, 0x38, 0xa7, 0x85,
0x37, 0x3b, 0x9f, 0x67, 0xf8, 0x22, 0x21, 0x59, 0x52, 0x8d, 0xb2, 0xa4, 0x7a, 0xbb, 0x96, 0x6c,
0xf3, 0xfa, 0x28, 0xcd, 0x55, 0x3d, 0x68, 0xae, 0xea, 0xed, 0xcc, 0xf5, 0xc7, 0x34, 0x5b, 0xbd,
0x7c, 0xda, 0xb2, 0xe8, 0x25, 0xc4, 0x5f, 0xac, 0xbd, 0xa0, 0xb7, 0xb4, 0x0b, 0xc8, 0x25, 0x6f,
0xbe, 0x30, 0xad, 0x64, 0x3f, 0x9d, 0xe0, 0x33, 0xa7, 0x89, 0xf4, 0xe6, 0x66, 0xfe, 0x8b, 0xd2,
0x53, 0xbd, 0x1d, 0x16, 0x7a, 0x5e, 0x81, 0xc9, 0xae, 0x4a, 0x4e, 0xcd, 0xf4, 0xd6, 0x96, 0x73,
0xeb, 0xb0, 0xe5, 0x9c, 0x29, 0xf8, 0x15, 0x05, 0x8e, 0x4a, 0xe5, 0x95, 0xaa, 0x77, 0x5a, 0x52,
0xef, 0x58, 0xf7, 0x93, 0x08, 0x63, 0x40, 0xbb, 0xa0, 0x7b, 0x25, 0x40, 0x40, 0xb2, 0xe7, 0xf7,
0x25, 0xc9, 0xef, 0xc7, 0x3d, 0x40, 0x88, 0xb9, 0x78, 0x04, 0x30, 0xb5, 0x6d, 0x48, 0x6e, 0x76,
0x10, 0xd2, 0x33, 0x90, 0x58, 0xeb, 0x30, 0x0d, 0x47, 0x29, 0x7e, 0xad, 0x53, 0xe8, 0x98, 0x56,
0x6d, 0xd7, 0x48, 0xac, 0x75, 0xf4, 0x13, 0xa0, 0xe6, 0xd9, 0x6f, 0x11, 0x0c, 0x2d, 0x8e, 0x51,
0x86, 0xbc, 0x55, 0x67, 0x1c, 0x98, 0xa6, 0x67, 0x20, 0xb9, 0x82, 0xcc, 0x6d, 0xa6, 0x04, 0x50,
0x1e, 0x3c, 0x62, 0x90, 0x71, 0xf6, 0xc0, 0xc7, 0x21, 0xc5, 0x05, 0xeb, 0x27, 0x31, 0x62, 0xdb,
0x65, 0x8f, 0x65, 0x08, 0xac, 0x0e, 0x5b, 0xb9, 0x08, 0x55, 0x3f, 0x05, 0xfd, 0x46, 0x63, 0x67,
0xd7, 0x65, 0x0f, 0xef, 0x66, 0xa3, 0xe4, 0xec, 0x75, 0x18, 0xf4, 0x34, 0x7a, 0x8b, 0x45, 0x97,
0xe8, 0xd4, 0xf4, 0xa9, 0xe0, 0x7a, 0xc2, 0xf7, 0x2d, 0xe9, 0x90, 0x3e, 0x03, 0xa9, 0x0d, 0xb7,
0xe3, 0x17, 0x7d, 0xde, 0x91, 0x7a, 0xa3, 0xd9, 0xf7, 0x2b, 0x90, 0x2a, 0x21, 0xd4, 0x26, 0x06,
0xbf, 0x17, 0x92, 0x25, 0xfb, 0x69, 0x8b, 0x29, 0x38, 0xce, 0x2c, 0x8a, 0xc9, 0xcc, 0xa6, 0x84,
0xac, 0xdf, 0x1b, 0xb4, 0xfb, 0x84, 0x67, 0xf7, 0x00, 0x1f, 0xb1, 0x7d, 0x56, 0xb0, 0x3d, 0x73,
0x20, 0x66, 0xea, 0xb2, 0xff, 0x05, 0x18, 0x0a, 0x3c, 0x45, 0x9f, 0x65, 0x6a, 0x24, 0x64, 0x60,
0xd0, 0x56, 0x98, 0x23, 0x8b, 0x60, 0x44, 0x78, 0x30, 0x86, 0x06, 0x4c, 0xdc, 0x03, 0x4a, 0xcc,
0x3c, 0x27, 0x9a, 0x39, 0x9c, 0x95, 0x99, 0x7a, 0x81, 0xda, 0x88, 0x98, 0xfb, 0x24, 0x0d, 0xce,
0xde, 0x4e, 0xc4, 0x9f, 0xb3, 0xfd, 0xa0, 0x56, 0x1a, 0xcd, 0xec, 0x43, 0x00, 0x34, 0xe5, 0xcb,
0xd6, 0x5e, 0x4b, 0xca, 0xba, 0x51, 0x6e, 0xe0, 0xcd, 0x5d, 0xb4, 0x89, 0x1c, 0xc2, 0x22, 0xf6,
0x53, 0xb8, 0xc0, 0x00, 0x4d, 0x31, 0x82, 0xbf, 0x3f, 0x12, 0x1f, 0xda, 0x89, 0x61, 0xd6, 0x34,
0x65, 0xbd, 0x8e, 0xdc, 0xbc, 0x65, 0xbb, 0xbb, 0xa8, 0x23, 0x21, 0x16, 0xf5, 0xb3, 0x42, 0xc2,
0x8e, 0x2e, 0xde, 0xe5, 0x21, 0x7a, 0x82, 0xce, 0x66, 0xbf, 0x44, 0x14, 0xc4, 0xad, 0x40, 0xd7,
0x04, 0xd5, 0x18, 0x13, 0xd4, 0xcf, 0x0b, 0xfd, 0xdb, 0x01, 0x6a, 0x4a, 0xaf, 0x96, 0x97, 0x84,
0xf7, 0x9c, 0x83, 0x95, 0x15, 0xdf, 0x31, 0xb9, 0x4d, 0xb9, 0xca, 0xf7, 0x47, 0xaa, 0xdc, 0xa3,
0xbb, 0x3d, 0xac, 0x4d, 0xd5, 0xb8, 0x36, 0xfd, 0xba, 0xd7, 0x71, 0xd0, 0x5f, 0x75, 0x20, 0x3f,
0x22, 0xa2, 0x3f, 0x10, 0xe9, 0xfb, 0x9c, 0x52, 0xf4, 0x54, 0x5d, 0x8a, 0xeb, 0xfe, 0x5c, 0xa2,
0x50, 0xf0, 0xd4, 0xbd, 0x70, 0x88, 0x10, 0xc8, 0x25, 0x8a, 0x45, 0xaf, 0x6c, 0xa7, 0x3e, 0xf4,
0xc2, 0xb4, 0xf2, 0xe2, 0x0b, 0xd3, 0x7d, 0xd9, 0x2f, 0x28, 0x30, 0xce, 0x38, 0x03, 0x81, 0xfb,
0xa0, 0xa4, 0xfc, 0x1d, 0xbc, 0x66, 0x84, 0x59, 0xe0, 0x67, 0x16, 0xbc, 0xdf, 0x54, 0x20, 0xdd,
0xa5, 0x2b, 0xb7, 0xf7, 0x42, 0x2c, 0x95, 0x73, 0x4a, 0xf9, 0xe7, 0x6f, 0xf3, 0xeb, 0xd0, 0xbf,
0xd9, 0x68, 0xa1, 0x0e, 0x5e, 0x09, 0xf0, 0x07, 0xaa, 0x32, 0x3f, 0xcc, 0xa1, 0x43, 0x9c, 0x46,
0x95, 0x13, 0x68, 0x8b, 0x7a, 0x1a, 0x92, 0x25, 0xd3, 0x35, 0x89, 0x06, 0xc3, 0x5e, 0x7d, 0x35,
0x5d, 0x33, 0x7b, 0x16, 0x86, 0x57, 0xf7, 0xc9, 0x4d, 0x99, 0x3a, 0xb9, 0x05, 0x22, 0x76, 0x7f,
0xbc, 0x5f, 0x3d, 0x33, 0xd7, 0x9f, 0xaa, 0x6b, 0x37, 0x95, 0x5c, 0x92, 0xe8, 0xf3, 0x14, 0x8c,
0xae, 0x61, 0xb5, 0x09, 0x4e, 0x80, 0xd1, 0xa7, 0xab, 0xde, 0xe4, 0xa5, 0xa6, 0x4c, 0xf5, 0x9b,
0xb2, 0x19, 0x50, 0x56, 0xc5, 0xd6, 0x29, 0xa8, 0x87, 0xa1, 0xac, 0xce, 0x25, 0x53, 0xa3, 0xda,
0xf8, 0x5c, 0x32, 0x05, 0xda, 0x08, 0x7b, 0xee, 0xdf, 0xaa, 0xa0, 0xd1, 0x56, 0xa7, 0x84, 0xb6,
0x1b, 0x56, 0xc3, 0xed, 0xee, 0x57, 0x3d, 0x8d, 0xf5, 0x47, 0x60, 0x10, 0x9b, 0xf4, 0x0a, 0xfb,
0x2d, 0x2e, 0x6c, 0xfa, 0x13, 0xac, 0x45, 0x91, 0x44, 0xb0, 0x01, 0x12, 0x3a, 0x3e, 0x46, 0xbf,
0x02, 0x6a, 0xa5, 0xb2, 0xca, 0x16, 0xb7, 0xa5, 0x03, 0xa1, 0xec, 0xa2, 0x0d, 0xfb, 0xc6, 0xc6,
0x9c, 0x1d, 0x03, 0x0b, 0xd0, 0x97, 0x20, 0x51, 0x59, 0x65, 0x0d, 0xef, 0xc9, 0x38, 0x62, 0x8c,
0x44, 0x65, 0x75, 0xea, 0xaf, 0x14, 0x18, 0x11, 0x46, 0xf5, 0x2c, 0x0c, 0xd3, 0x81, 0xc0, 0x74,
0x07, 0x0c, 0x61, 0x8c, 0xeb, 0x9c, 0xb8, 0x4d, 0x9d, 0xa7, 0xf2, 0x30, 0x26, 0x8d, 0xeb, 0xf3,
0xa0, 0x07, 0x87, 0x98, 0x12, 0xf4, 0x77, 0x8c, 0x42, 0x28, 0xd9, 0xbb, 0x01, 0x7c, 0xbb, 0x7a,
0x3f, 0xbf, 0x53, 0x29, 0x6f, 0x6c, 0x96, 0x4b, 0x9a, 0x92, 0xfd, 0xaa, 0x02, 0x43, 0xac, 0x6d,
0xad, 0xd9, 0x6d, 0xa4, 0x17, 0x40, 0xc9, 0xb3, 0x78, 0x78, 0x73, 0x7a, 0x2b, 0x79, 0xfd, 0x34,
0x28, 0x85, 0xf8, 0xae, 0x56, 0x0a, 0xfa, 0x22, 0x28, 0x45, 0xe6, 0xe0, 0x78, 0x9e, 0x51, 0x8a,
0xd9, 0x1f, 0xaa, 0x30, 0x11, 0x6c, 0xa3, 0x79, 0x3d, 0x39, 0x21, 0xbe, 0x37, 0xe5, 0x06, 0xcf,
0x2c, 0x9e, 0x5d, 0x9a, 0xc7, 0xff, 0x78, 0x21, 0x79, 0x42, 0x7c, 0x85, 0xea, 0x66, 0xe9, 0xba,
0x26, 0x92, 0x4b, 0x06, 0xa8, 0x5d, 0xd7, 0x44, 0x04, 0x6a, 0xd7, 0x35, 0x11, 0x81, 0xda, 0x75,
0x4d, 0x44, 0xa0, 0x76, 0x1d, 0x05, 0x08, 0xd4, 0xae, 0x6b, 0x22, 0x02, 0xb5, 0xeb, 0x9a, 0x88,
0x40, 0xed, 0xbe, 0x26, 0xc2, 0xc8, 0x3d, 0xaf, 0x89, 0x88, 0xf4, 0xee, 0x6b, 0x22, 0x22, 0xbd,
0xfb, 0x9a, 0x48, 0x2e, 0xe9, 0x76, 0xf6, 0x50, 0xef, 0x43, 0x07, 0x11, 0x7f, 0xd0, 0x3b, 0xa0,
0x5f, 0x80, 0xd7, 0x60, 0x8c, 0xee, 0x47, 0x14, 0x6d, 0xcb, 0x35, 0x1b, 0x16, 0xea, 0xe8, 0xef,
0x84, 0x61, 0x3a, 0x44, 0xdf, 0x72, 0xc2, 0xde, 0x02, 0x29, 0x9d, 0x95, 0x5b, 0x81, 0x3b, 0xfb,
0xd3, 0x24, 0x4c, 0xd2, 0x81, 0x8a, 0xd9, 0x42, 0xc2, 0x25, 0xa3, 0x53, 0xd2, 0x91, 0xd2, 0x28,
0x86, 0xdf, 0x7a, 0x65, 0x9a, 0x8e, 0xe6, 0xbd, 0x60, 0x3a, 0x25, 0x1d, 0x2e, 0x89, 0x7c, 0xfe,
0xfa, 0x73, 0x4a, 0xba, 0x78, 0x24, 0xf2, 0x79, 0xcb, 0x8d, 0xc7, 0xc7, 0xaf, 0x20, 0x89, 0x7c,
0x25, 0x2f, 0xca, 0x4e, 0x49, 0x97, 0x91, 0x44, 0xbe, 0xb2, 0x17, 0x6f, 0xa7, 0xa4, 0xa3, 0x27,
0x91, 0xef, 0x8a, 0x17, 0x79, 0xa7, 0xa4, 0x43, 0x28, 0x91, 0xef, 0xaa, 0x17, 0x83, 0xa7, 0xa4,
0xab, 0x4a, 0x22, 0xdf, 0xa3, 0x5e, 0x34, 0x9e, 0x92, 0x2e, 0x2d, 0x89, 0x7c, 0xcb, 0x5e, 0x5c,
0xce, 0xca, 0xd7, 0x97, 0x44, 0xc6, 0x6b, 0x7e, 0x84, 0xce, 0xca, 0x17, 0x99, 0x44, 0xce, 0x77,
0xf9, 0xb1, 0x3a, 0x2b, 0x5f, 0x69, 0x12, 0x39, 0x57, 0xfc, 0xa8, 0x9d, 0x95, 0x8f, 0xca, 0x44,
0xce, 0x55, 0x3f, 0x7e, 0x67, 0xe5, 0x43, 0x33, 0x91, 0xb3, 0xe2, 0x47, 0xf2, 0xac, 0x7c, 0x7c,
0x26, 0x72, 0xae, 0xf9, 0x7b, 0xe8, 0xdf, 0x90, 0xc2, 0x2f, 0x70, 0x09, 0x2a, 0x2b, 0x85, 0x1f,
0x84, 0x84, 0x5e, 0x56, 0x0a, 0x3d, 0x08, 0x09, 0xbb, 0xac, 0x14, 0x76, 0x10, 0x12, 0x72, 0x59,
0x29, 0xe4, 0x20, 0x24, 0xdc, 0xb2, 0x52, 0xb8, 0x41, 0x48, 0xa8, 0x65, 0xa5, 0x50, 0x83, 0x90,
0x30, 0xcb, 0x4a, 0x61, 0x06, 0x21, 0x21, 0x96, 0x95, 0x42, 0x0c, 0x42, 0xc2, 0x2b, 0x2b, 0x85,
0x17, 0x84, 0x84, 0xd6, 0x49, 0x39, 0xb4, 0x20, 0x2c, 0xac, 0x4e, 0xca, 0x61, 0x05, 0x61, 0x21,
0x75, 0x8f, 0x1c, 0x52, 0x83, 0xb7, 0x5e, 0x99, 0xee, 0xc7, 0x43, 0x81, 0x68, 0x3a, 0x29, 0x47,
0x13, 0x84, 0x45, 0xd2, 0x49, 0x39, 0x92, 0x20, 0x2c, 0x8a, 0x4e, 0xca, 0x51, 0x04, 0x61, 0x11,
0xf4, 0x92, 0x1c, 0x41, 0xfe, 0x15, 0x9f, 0xac, 0x74, 0xa2, 0x18, 0x15, 0x41, 0x6a, 0x8c, 0x08,
0x52, 0x63, 0x44, 0x90, 0x1a, 0x23, 0x82, 0xd4, 0x18, 0x11, 0xa4, 0xc6, 0x88, 0x20, 0x35, 0x46,
0x04, 0xa9, 0x31, 0x22, 0x48, 0x8d, 0x13, 0x41, 0x6a, 0xac, 0x08, 0x52, 0x7b, 0x45, 0xd0, 0x49,
0xf9, 0xc2, 0x03, 0x84, 0x15, 0xa4, 0x93, 0xf2, 0xc9, 0x67, 0x74, 0x08, 0xa9, 0xb1, 0x42, 0x48,
0xed, 0x15, 0x42, 0xdf, 0x50, 0x61, 0x42, 0x08, 0x21, 0x76, 0x3c, 0xf4, 0x56, 0x55, 0xa0, 0xf3,
0x31, 0xee, 0x57, 0x84, 0xc5, 0xd4, 0xf9, 0x18, 0x67, 0xd4, 0x07, 0xc5, 0x59, 0x77, 0x15, 0x2a,
0xc7, 0xa8, 0x42, 0x57, 0xbc, 0x18, 0x3a, 0x1f, 0xe3, 0xde, 0x45, 0x77, 0xec, 0x5d, 0x3c, 0xa8,
0x08, 0x3c, 0x1a, 0xab, 0x08, 0x2c, 0xc7, 0x2a, 0x02, 0xd7, 0x7c, 0x0f, 0x7e, 0x30, 0x01, 0x47,
0x7d, 0x0f, 0xd2, 0x4f, 0xe4, 0x97, 0x90, 0xb2, 0x81, 0x13, 0x2a, 0x9d, 0x9f, 0xda, 0x04, 0xdc,
0x98, 0x58, 0xae, 0xeb, 0xeb, 0xe2, 0x59, 0x55, 0xee, 0xb0, 0xe7, 0x37, 0x01, 0x8f, 0xb3, 0xbd,
0xd0, 0x93, 0xa0, 0x2e, 0xd7, 0x1d, 0x52, 0x2d, 0xc2, 0x1e, 0x5b, 0x34, 0x30, 0x59, 0x37, 0x60,
0x80, 0xb0, 0x3b, 0xc4, 0xbd, 0xb7, 0xf3, 0xe0, 0x92, 0xc1, 0x24, 0x65, 0x5f, 0x52, 0x60, 0x46,
0x08, 0xe5, 0xb7, 0xe6, 0xc4, 0xe0, 0x72, 0xac, 0x13, 0x03, 0x21, 0x41, 0xfc, 0xd3, 0x83, 0xfb,
0xba, 0x0f, 0xaa, 0x83, 0x59, 0x22, 0x9f, 0x24, 0xfc, 0x1f, 0x18, 0xf5, 0x67, 0x40, 0x5e, 0xd9,
0xce, 0x45, 0x6f, 0x66, 0x86, 0xa5, 0xe6, 0x39, 0x69, 0x13, 0xed, 0x40, 0x98, 0x97, 0xad, 0xd9,
0x1c, 0x8c, 0x55, 0xc4, 0x3f, 0xd9, 0x89, 0xda, 0x8b, 0x48, 0xe1, 0xd6, 0xfc, 0xe6, 0x67, 0xa6,
0xfb, 0xb2, 0x0f, 0xc0, 0x70, 0xf0, 0xaf, 0x72, 0x24, 0xe0, 0x20, 0x07, 0xe6, 0x92, 0x2f, 0x63,
0xee, 0xdf, 0x56, 0xe0, 0x8e, 0x20, 0xfb, 0x63, 0x0d, 0x77, 0x77, 0xd9, 0xc2, 0x3d, 0xfd, 0x43,
0x90, 0x42, 0xcc, 0x71, 0xec, 0x47, 0x4d, 0xd8, 0x6b, 0x64, 0x28, 0xfb, 0x3c, 0xf9, 0xd7, 0xf0,
0x20, 0xd2, 0x26, 0x08, 0x7f, 0xec, 0xe2, 0xd4, 0xbd, 0xd0, 0x4f, 0xe5, 0x8b, 0x7a, 0x8d, 0x48,
0x7a, 0x7d, 0x2e, 0x44, 0x2f, 0x12, 0x47, 0xfa, 0x35, 0x41, 0xaf, 0xc0, 0xdb, 0x6a, 0x28, 0xfb,
0x3c, 0x0f, 0xbe, 0x42, 0x0a, 0xf7, 0x7f, 0x24, 0xa2, 0xa2, 0x95, 0x9c, 0x85, 0x54, 0x59, 0xe6,
0x09, 0xd7, 0xb3, 0x04, 0xc9, 0x8a, 0x5d, 0x27, 0x3f, 0xb7, 0x42, 0x7e, 0x40, 0x97, 0x19, 0x99,
0xfd, 0x9a, 0xee, 0x29, 0x48, 0x15, 0x77, 0x1b, 0xcd, 0x7a, 0x07, 0x59, 0xec, 0xc8, 0x9e, 0xed,
0xa0, 0x63, 0x8c, 0xe1, 0xd1, 0xb2, 0x45, 0x18, 0xaf, 0xd8, 0x56, 0x61, 0xdf, 0x0d, 0xd6, 0x8d,
0x79, 0x29, 0x45, 0xd8, 0x91, 0x0f, 0xf9, 0x3b, 0x0f, 0xcc, 0x50, 0xe8, 0xff, 0xf6, 0x2b, 0xd3,
0xca, 0xa6, 0xb7, 0x7d, 0xbe, 0x0a, 0xc7, 0x58, 0xfa, 0x74, 0x89, 0x5a, 0x8c, 0x12, 0x35, 0xc8,
0x8e, 0xa9, 0x03, 0xe2, 0x96, 0xb1, 0x38, 0x2b, 0x54, 0xdc, 0x9b, 0xd3, 0x0c, 0x37, 0x45, 0x07,
0x6a, 0xa6, 0x1e, 0x4a, 0xb3, 0x50, 0x71, 0xf3, 0x51, 0xe2, 0x24, 0xcd, 0xee, 0x81, 0x41, 0x8f,
0x16, 0x88, 0x86, 0x60, 0xa6, 0x2c, 0xce, 0x65, 0x61, 0x28, 0x90, 0xb0, 0x7a, 0x3f, 0x28, 0x79,
0xad, 0x0f, 0xff, 0x57, 0xd0, 0x14, 0xfc, 0x5f, 0x51, 0x4b, 0xcc, 0xdd, 0x0b, 0x63, 0xd2, 0xf6,
0x25, 0xa6, 0x94, 0x34, 0xc0, 0xff, 0x95, 0xb5, 0xa1, 0xa9, 0xe4, 0x87, 0x7e, 0x2f, 0xd3, 0x37,
0x77, 0x19, 0xf4, 0xee, 0x8d, 0x4e, 0x7d, 0x00, 0x12, 0x79, 0x2c, 0xf2, 0x18, 0x24, 0x0a, 0x05,
0x4d, 0x99, 0x1a, 0xfb, 0xe5, 0x4f, 0xcd, 0x0c, 0x15, 0xc8, 0x9f, 0x1c, 0x5f, 0x47, 0x6e, 0xa1,
0xc0, 0xc0, 0x0f, 0xc3, 0x1d, 0xa1, 0x1b, 0xa5, 0x18, 0x5f, 0x2c, 0x52, 0x7c, 0xa9, 0xd4, 0x85,
0x2f, 0x95, 0x08, 0x5e, 0xc9, 0xf1, 0x03, 0xe7, 0xbc, 0x1e, 0xb2, 0xc9, 0x98, 0xae, 0x07, 0x0e,
0xb8, 0xf3, 0xb9, 0x87, 0x19, 0x6f, 0x21, 0x94, 0x17, 0x45, 0x1c, 0x58, 0x17, 0x72, 0x45, 0x86,
0x2f, 0x86, 0xe2, 0xb7, 0xa5, 0x53, 0x55, 0x71, 0x85, 0x60, 0x42, 0x8a, 0x9e, 0xc2, 0xa5, 0x50,
0x21, 0xbb, 0x81, 0xbb, 0xee, 0x25, 0x4f, 0xe1, 0x72, 0x28, 0x6f, 0x23, 0xe2, 0xce, 0x57, 0x39,
0x77, 0x9a, 0x2d, 0xf2, 0xf9, 0x33, 0xfa, 0x1d, 0x3c, 0x47, 0x85, 0x0a, 0xcc, 0x0c, 0xc4, 0xb9,
0x72, 0x45, 0x06, 0x28, 0xf4, 0x04, 0xf4, 0xb6, 0x12, 0x47, 0xe6, 0x1e, 0x65, 0x42, 0x8a, 0x3d,
0x85, 0x44, 0x98, 0x8a, 0xc3, 0x0b, 0x9b, 0x37, 0x5f, 0xcd, 0xf4, 0xbd, 0xfc, 0x6a, 0xa6, 0xef,
0x9f, 0x5e, 0xcd, 0xf4, 0x7d, 0xe7, 0xd5, 0x8c, 0xf2, 0xfd, 0x57, 0x33, 0xca, 0x0f, 0x5e, 0xcd,
0x28, 0x3f, 0x79, 0x35, 0xa3, 0x3c, 0x77, 0x2b, 0xa3, 0xbc, 0x78, 0x2b, 0xa3, 0x7c, 0xe9, 0x56,
0x46, 0xf9, 0xda, 0xad, 0x8c, 0xf2, 0xd2, 0xad, 0x8c, 0x72, 0xf3, 0x56, 0x46, 0x79, 0xf9, 0x56,
0xa6, 0xef, 0x3b, 0xb7, 0x32, 0xca, 0xf7, 0x6f, 0x65, 0xfa, 0x7e, 0x70, 0x2b, 0xa3, 0xfc, 0xe4,
0x56, 0xa6, 0xef, 0xb9, 0xef, 0x66, 0xfa, 0x5e, 0xf8, 0x6e, 0xa6, 0xef, 0xc5, 0xef, 0x66, 0x94,
0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x1b, 0xdd, 0x04, 0xd4, 0x64, 0x00, 0x00,
}
r := bytes.NewReader(gzipped)
gzipr, err := compress_gzip.NewReader(r)
if err != nil {
panic(err)
}
ungzipped, err := io_ioutil.ReadAll(gzipr)
if err != nil {
panic(err)
}
if err := github_com_gogo_protobuf_proto.Unmarshal(ungzipped, d); err != nil {
panic(err)
}
return d
}
func (x TheTestEnum) String() string {
s, ok := TheTestEnum_name[int32(x)]
if ok {
return s
}
return strconv.Itoa(int(x))
}
func (x AnotherTestEnum) String() string {
s, ok := AnotherTestEnum_name[int32(x)]
if ok {
return s
}
return strconv.Itoa(int(x))
}
func (x YetAnotherTestEnum) String() string {
s, ok := YetAnotherTestEnum_name[int32(x)]
if ok {
return s
}
return strconv.Itoa(int(x))
}
func (x YetYetAnotherTestEnum) String() string {
s, ok := YetYetAnotherTestEnum_name[int32(x)]
if ok {
return s
}
return strconv.Itoa(int(x))
}
func (x NestedDefinition_NestedEnum) String() string {
s, ok := NestedDefinition_NestedEnum_name[int32(x)]
if ok {
return s
}
return strconv.Itoa(int(x))
}
func (this *NidOptNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidOptNative)
if !ok {
that2, ok := that.(NidOptNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidOptNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidOptNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidOptNative but is not nil && this == nil")
}
if this.Field1 != that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if this.Field4 != that1.Field4 {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", this.Field4, that1.Field4)
}
if this.Field5 != that1.Field5 {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", this.Field5, that1.Field5)
}
if this.Field6 != that1.Field6 {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", this.Field6, that1.Field6)
}
if this.Field7 != that1.Field7 {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", this.Field7, that1.Field7)
}
if this.Field8 != that1.Field8 {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", this.Field8, that1.Field8)
}
if this.Field9 != that1.Field9 {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", this.Field9, that1.Field9)
}
if this.Field10 != that1.Field10 {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", this.Field10, that1.Field10)
}
if this.Field11 != that1.Field11 {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", this.Field11, that1.Field11)
}
if this.Field12 != that1.Field12 {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", this.Field12, that1.Field12)
}
if this.Field13 != that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if this.Field14 != that1.Field14 {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", this.Field14, that1.Field14)
}
if !bytes.Equal(this.Field15, that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", this.Field15, that1.Field15)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidOptNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidOptNative)
if !ok {
that2, ok := that.(NidOptNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != that1.Field1 {
return false
}
if this.Field2 != that1.Field2 {
return false
}
if this.Field3 != that1.Field3 {
return false
}
if this.Field4 != that1.Field4 {
return false
}
if this.Field5 != that1.Field5 {
return false
}
if this.Field6 != that1.Field6 {
return false
}
if this.Field7 != that1.Field7 {
return false
}
if this.Field8 != that1.Field8 {
return false
}
if this.Field9 != that1.Field9 {
return false
}
if this.Field10 != that1.Field10 {
return false
}
if this.Field11 != that1.Field11 {
return false
}
if this.Field12 != that1.Field12 {
return false
}
if this.Field13 != that1.Field13 {
return false
}
if this.Field14 != that1.Field14 {
return false
}
if !bytes.Equal(this.Field15, that1.Field15) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptNative)
if !ok {
that2, ok := that.(NinOptNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptNative but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", *this.Field3, *that1.Field3)
}
} else if this.Field3 != nil {
return fmt.Errorf("this.Field3 == nil && that.Field3 != nil")
} else if that1.Field3 != nil {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", *this.Field4, *that1.Field4)
}
} else if this.Field4 != nil {
return fmt.Errorf("this.Field4 == nil && that.Field4 != nil")
} else if that1.Field4 != nil {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", this.Field4, that1.Field4)
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", *this.Field5, *that1.Field5)
}
} else if this.Field5 != nil {
return fmt.Errorf("this.Field5 == nil && that.Field5 != nil")
} else if that1.Field5 != nil {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", this.Field5, that1.Field5)
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", *this.Field6, *that1.Field6)
}
} else if this.Field6 != nil {
return fmt.Errorf("this.Field6 == nil && that.Field6 != nil")
} else if that1.Field6 != nil {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", this.Field6, that1.Field6)
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", *this.Field7, *that1.Field7)
}
} else if this.Field7 != nil {
return fmt.Errorf("this.Field7 == nil && that.Field7 != nil")
} else if that1.Field7 != nil {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", this.Field7, that1.Field7)
}
if this.Field8 != nil && that1.Field8 != nil {
if *this.Field8 != *that1.Field8 {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", *this.Field8, *that1.Field8)
}
} else if this.Field8 != nil {
return fmt.Errorf("this.Field8 == nil && that.Field8 != nil")
} else if that1.Field8 != nil {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", this.Field8, that1.Field8)
}
if this.Field9 != nil && that1.Field9 != nil {
if *this.Field9 != *that1.Field9 {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", *this.Field9, *that1.Field9)
}
} else if this.Field9 != nil {
return fmt.Errorf("this.Field9 == nil && that.Field9 != nil")
} else if that1.Field9 != nil {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", this.Field9, that1.Field9)
}
if this.Field10 != nil && that1.Field10 != nil {
if *this.Field10 != *that1.Field10 {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", *this.Field10, *that1.Field10)
}
} else if this.Field10 != nil {
return fmt.Errorf("this.Field10 == nil && that.Field10 != nil")
} else if that1.Field10 != nil {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", this.Field10, that1.Field10)
}
if this.Field11 != nil && that1.Field11 != nil {
if *this.Field11 != *that1.Field11 {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", *this.Field11, *that1.Field11)
}
} else if this.Field11 != nil {
return fmt.Errorf("this.Field11 == nil && that.Field11 != nil")
} else if that1.Field11 != nil {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", this.Field11, that1.Field11)
}
if this.Field12 != nil && that1.Field12 != nil {
if *this.Field12 != *that1.Field12 {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", *this.Field12, *that1.Field12)
}
} else if this.Field12 != nil {
return fmt.Errorf("this.Field12 == nil && that.Field12 != nil")
} else if that1.Field12 != nil {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", this.Field12, that1.Field12)
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", *this.Field13, *that1.Field13)
}
} else if this.Field13 != nil {
return fmt.Errorf("this.Field13 == nil && that.Field13 != nil")
} else if that1.Field13 != nil {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", *this.Field14, *that1.Field14)
}
} else if this.Field14 != nil {
return fmt.Errorf("this.Field14 == nil && that.Field14 != nil")
} else if that1.Field14 != nil {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", this.Field14, that1.Field14)
}
if !bytes.Equal(this.Field15, that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", this.Field15, that1.Field15)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptNative)
if !ok {
that2, ok := that.(NinOptNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return false
}
} else if this.Field3 != nil {
return false
} else if that1.Field3 != nil {
return false
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
return false
}
} else if this.Field4 != nil {
return false
} else if that1.Field4 != nil {
return false
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
return false
}
} else if this.Field5 != nil {
return false
} else if that1.Field5 != nil {
return false
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return false
}
} else if this.Field6 != nil {
return false
} else if that1.Field6 != nil {
return false
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return false
}
} else if this.Field7 != nil {
return false
} else if that1.Field7 != nil {
return false
}
if this.Field8 != nil && that1.Field8 != nil {
if *this.Field8 != *that1.Field8 {
return false
}
} else if this.Field8 != nil {
return false
} else if that1.Field8 != nil {
return false
}
if this.Field9 != nil && that1.Field9 != nil {
if *this.Field9 != *that1.Field9 {
return false
}
} else if this.Field9 != nil {
return false
} else if that1.Field9 != nil {
return false
}
if this.Field10 != nil && that1.Field10 != nil {
if *this.Field10 != *that1.Field10 {
return false
}
} else if this.Field10 != nil {
return false
} else if that1.Field10 != nil {
return false
}
if this.Field11 != nil && that1.Field11 != nil {
if *this.Field11 != *that1.Field11 {
return false
}
} else if this.Field11 != nil {
return false
} else if that1.Field11 != nil {
return false
}
if this.Field12 != nil && that1.Field12 != nil {
if *this.Field12 != *that1.Field12 {
return false
}
} else if this.Field12 != nil {
return false
} else if that1.Field12 != nil {
return false
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return false
}
} else if this.Field13 != nil {
return false
} else if that1.Field13 != nil {
return false
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return false
}
} else if this.Field14 != nil {
return false
} else if that1.Field14 != nil {
return false
}
if !bytes.Equal(this.Field15, that1.Field15) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidRepNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidRepNative)
if !ok {
that2, ok := that.(NidRepNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidRepNative")
}
}
if that1 == nil {
if this == nil {
return nil
} | if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if len(this.Field4) != len(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", len(this.Field4), len(that1.Field4))
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return fmt.Errorf("Field4 this[%v](%v) Not Equal that[%v](%v)", i, this.Field4[i], i, that1.Field4[i])
}
}
if len(this.Field5) != len(that1.Field5) {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", len(this.Field5), len(that1.Field5))
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return fmt.Errorf("Field5 this[%v](%v) Not Equal that[%v](%v)", i, this.Field5[i], i, that1.Field5[i])
}
}
if len(this.Field6) != len(that1.Field6) {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", len(this.Field6), len(that1.Field6))
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return fmt.Errorf("Field6 this[%v](%v) Not Equal that[%v](%v)", i, this.Field6[i], i, that1.Field6[i])
}
}
if len(this.Field7) != len(that1.Field7) {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", len(this.Field7), len(that1.Field7))
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return fmt.Errorf("Field7 this[%v](%v) Not Equal that[%v](%v)", i, this.Field7[i], i, that1.Field7[i])
}
}
if len(this.Field8) != len(that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", len(this.Field8), len(that1.Field8))
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return fmt.Errorf("Field8 this[%v](%v) Not Equal that[%v](%v)", i, this.Field8[i], i, that1.Field8[i])
}
}
if len(this.Field9) != len(that1.Field9) {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", len(this.Field9), len(that1.Field9))
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return fmt.Errorf("Field9 this[%v](%v) Not Equal that[%v](%v)", i, this.Field9[i], i, that1.Field9[i])
}
}
if len(this.Field10) != len(that1.Field10) {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", len(this.Field10), len(that1.Field10))
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return fmt.Errorf("Field10 this[%v](%v) Not Equal that[%v](%v)", i, this.Field10[i], i, that1.Field10[i])
}
}
if len(this.Field11) != len(that1.Field11) {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", len(this.Field11), len(that1.Field11))
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return fmt.Errorf("Field11 this[%v](%v) Not Equal that[%v](%v)", i, this.Field11[i], i, that1.Field11[i])
}
}
if len(this.Field12) != len(that1.Field12) {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", len(this.Field12), len(that1.Field12))
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return fmt.Errorf("Field12 this[%v](%v) Not Equal that[%v](%v)", i, this.Field12[i], i, that1.Field12[i])
}
}
if len(this.Field13) != len(that1.Field13) {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", len(this.Field13), len(that1.Field13))
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return fmt.Errorf("Field13 this[%v](%v) Not Equal that[%v](%v)", i, this.Field13[i], i, that1.Field13[i])
}
}
if len(this.Field14) != len(that1.Field14) {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", len(this.Field14), len(that1.Field14))
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return fmt.Errorf("Field14 this[%v](%v) Not Equal that[%v](%v)", i, this.Field14[i], i, that1.Field14[i])
}
}
if len(this.Field15) != len(that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", len(this.Field15), len(that1.Field15))
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return fmt.Errorf("Field15 this[%v](%v) Not Equal that[%v](%v)", i, this.Field15[i], i, that1.Field15[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidRepNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidRepNative)
if !ok {
that2, ok := that.(NidRepNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return false
}
}
if len(this.Field4) != len(that1.Field4) {
return false
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return false
}
}
if len(this.Field5) != len(that1.Field5) {
return false
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return false
}
}
if len(this.Field6) != len(that1.Field6) {
return false
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return false
}
}
if len(this.Field7) != len(that1.Field7) {
return false
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return false
}
}
if len(this.Field8) != len(that1.Field8) {
return false
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return false
}
}
if len(this.Field9) != len(that1.Field9) {
return false
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return false
}
}
if len(this.Field10) != len(that1.Field10) {
return false
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return false
}
}
if len(this.Field11) != len(that1.Field11) {
return false
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return false
}
}
if len(this.Field12) != len(that1.Field12) {
return false
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return false
}
}
if len(this.Field13) != len(that1.Field13) {
return false
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return false
}
}
if len(this.Field14) != len(that1.Field14) {
return false
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return false
}
}
if len(this.Field15) != len(that1.Field15) {
return false
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinRepNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinRepNative)
if !ok {
that2, ok := that.(NinRepNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinRepNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinRepNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinRepNative but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if len(this.Field4) != len(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", len(this.Field4), len(that1.Field4))
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return fmt.Errorf("Field4 this[%v](%v) Not Equal that[%v](%v)", i, this.Field4[i], i, that1.Field4[i])
}
}
if len(this.Field5) != len(that1.Field5) {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", len(this.Field5), len(that1.Field5))
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return fmt.Errorf("Field5 this[%v](%v) Not Equal that[%v](%v)", i, this.Field5[i], i, that1.Field5[i])
}
}
if len(this.Field6) != len(that1.Field6) {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", len(this.Field6), len(that1.Field6))
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return fmt.Errorf("Field6 this[%v](%v) Not Equal that[%v](%v)", i, this.Field6[i], i, that1.Field6[i])
}
}
if len(this.Field7) != len(that1.Field7) {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", len(this.Field7), len(that1.Field7))
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return fmt.Errorf("Field7 this[%v](%v) Not Equal that[%v](%v)", i, this.Field7[i], i, that1.Field7[i])
}
}
if len(this.Field8) != len(that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", len(this.Field8), len(that1.Field8))
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return fmt.Errorf("Field8 this[%v](%v) Not Equal that[%v](%v)", i, this.Field8[i], i, that1.Field8[i])
}
}
if len(this.Field9) != len(that1.Field9) {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", len(this.Field9), len(that1.Field9))
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return fmt.Errorf("Field9 this[%v](%v) Not Equal that[%v](%v)", i, this.Field9[i], i, that1.Field9[i])
}
}
if len(this.Field10) != len(that1.Field10) {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", len(this.Field10), len(that1.Field10))
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return fmt.Errorf("Field10 this[%v](%v) Not Equal that[%v](%v)", i, this.Field10[i], i, that1.Field10[i])
}
}
if len(this.Field11) != len(that1.Field11) {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", len(this.Field11), len(that1.Field11))
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return fmt.Errorf("Field11 this[%v](%v) Not Equal that[%v](%v)", i, this.Field11[i], i, that1.Field11[i])
}
}
if len(this.Field12) != len(that1.Field12) {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", len(this.Field12), len(that1.Field12))
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return fmt.Errorf("Field12 this[%v](%v) Not Equal that[%v](%v)", i, this.Field12[i], i, that1.Field12[i])
}
}
if len(this.Field13) != len(that1.Field13) {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", len(this.Field13), len(that1.Field13))
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return fmt.Errorf("Field13 this[%v](%v) Not Equal that[%v](%v)", i, this.Field13[i], i, that1.Field13[i])
}
}
if len(this.Field14) != len(that1.Field14) {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", len(this.Field14), len(that1.Field14))
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return fmt.Errorf("Field14 this[%v](%v) Not Equal that[%v](%v)", i, this.Field14[i], i, that1.Field14[i])
}
}
if len(this.Field15) != len(that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", len(this.Field15), len(that1.Field15))
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return fmt.Errorf("Field15 this[%v](%v) Not Equal that[%v](%v)", i, this.Field15[i], i, that1.Field15[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinRepNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinRepNative)
if !ok {
that2, ok := that.(NinRepNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return false
}
}
if len(this.Field4) != len(that1.Field4) {
return false
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return false
}
}
if len(this.Field5) != len(that1.Field5) {
return false
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return false
}
}
if len(this.Field6) != len(that1.Field6) {
return false
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return false
}
}
if len(this.Field7) != len(that1.Field7) {
return false
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return false
}
}
if len(this.Field8) != len(that1.Field8) {
return false
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return false
}
}
if len(this.Field9) != len(that1.Field9) {
return false
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return false
}
}
if len(this.Field10) != len(that1.Field10) {
return false
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return false
}
}
if len(this.Field11) != len(that1.Field11) {
return false
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return false
}
}
if len(this.Field12) != len(that1.Field12) {
return false
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return false
}
}
if len(this.Field13) != len(that1.Field13) {
return false
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return false
}
}
if len(this.Field14) != len(that1.Field14) {
return false
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return false
}
}
if len(this.Field15) != len(that1.Field15) {
return false
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidRepPackedNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidRepPackedNative)
if !ok {
that2, ok := that.(NidRepPackedNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidRepPackedNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidRepPackedNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidRepPackedNative but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if len(this.Field4) != len(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", len(this.Field4), len(that1.Field4))
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return fmt.Errorf("Field4 this[%v](%v) Not Equal that[%v](%v)", i, this.Field4[i], i, that1.Field4[i])
}
}
if len(this.Field5) != len(that1.Field5) {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", len(this.Field5), len(that1.Field5))
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return fmt.Errorf("Field5 this[%v](%v) Not Equal that[%v](%v)", i, this.Field5[i], i, that1.Field5[i])
}
}
if len(this.Field6) != len(that1.Field6) {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", len(this.Field6), len(that1.Field6))
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return fmt.Errorf("Field6 this[%v](%v) Not Equal that[%v](%v)", i, this.Field6[i], i, that1.Field6[i])
}
}
if len(this.Field7) != len(that1.Field7) {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", len(this.Field7), len(that1.Field7))
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return fmt.Errorf("Field7 this[%v](%v) Not Equal that[%v](%v)", i, this.Field7[i], i, that1.Field7[i])
}
}
if len(this.Field8) != len(that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", len(this.Field8), len(that1.Field8))
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return fmt.Errorf("Field8 this[%v](%v) Not Equal that[%v](%v)", i, this.Field8[i], i, that1.Field8[i])
}
}
if len(this.Field9) != len(that1.Field9) {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", len(this.Field9), len(that1.Field9))
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return fmt.Errorf("Field9 this[%v](%v) Not Equal that[%v](%v)", i, this.Field9[i], i, that1.Field9[i])
}
}
if len(this.Field10) != len(that1.Field10) {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", len(this.Field10), len(that1.Field10))
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return fmt.Errorf("Field10 this[%v](%v) Not Equal that[%v](%v)", i, this.Field10[i], i, that1.Field10[i])
}
}
if len(this.Field11) != len(that1.Field11) {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", len(this.Field11), len(that1.Field11))
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return fmt.Errorf("Field11 this[%v](%v) Not Equal that[%v](%v)", i, this.Field11[i], i, that1.Field11[i])
}
}
if len(this.Field12) != len(that1.Field12) {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", len(this.Field12), len(that1.Field12))
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return fmt.Errorf("Field12 this[%v](%v) Not Equal that[%v](%v)", i, this.Field12[i], i, that1.Field12[i])
}
}
if len(this.Field13) != len(that1.Field13) {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", len(this.Field13), len(that1.Field13))
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return fmt.Errorf("Field13 this[%v](%v) Not Equal that[%v](%v)", i, this.Field13[i], i, that1.Field13[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidRepPackedNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidRepPackedNative)
if !ok {
that2, ok := that.(NidRepPackedNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return false
}
}
if len(this.Field4) != len(that1.Field4) {
return false
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return false
}
}
if len(this.Field5) != len(that1.Field5) {
return false
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return false
}
}
if len(this.Field6) != len(that1.Field6) {
return false
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return false
}
}
if len(this.Field7) != len(that1.Field7) {
return false
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return false
}
}
if len(this.Field8) != len(that1.Field8) {
return false
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return false
}
}
if len(this.Field9) != len(that1.Field9) {
return false
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return false
}
}
if len(this.Field10) != len(that1.Field10) {
return false
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return false
}
}
if len(this.Field11) != len(that1.Field11) {
return false
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return false
}
}
if len(this.Field12) != len(that1.Field12) {
return false
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return false
}
}
if len(this.Field13) != len(that1.Field13) {
return false
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinRepPackedNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinRepPackedNative)
if !ok {
that2, ok := that.(NinRepPackedNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinRepPackedNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinRepPackedNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinRepPackedNative but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if len(this.Field4) != len(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", len(this.Field4), len(that1.Field4))
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return fmt.Errorf("Field4 this[%v](%v) Not Equal that[%v](%v)", i, this.Field4[i], i, that1.Field4[i])
}
}
if len(this.Field5) != len(that1.Field5) {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", len(this.Field5), len(that1.Field5))
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return fmt.Errorf("Field5 this[%v](%v) Not Equal that[%v](%v)", i, this.Field5[i], i, that1.Field5[i])
}
}
if len(this.Field6) != len(that1.Field6) {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", len(this.Field6), len(that1.Field6))
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return fmt.Errorf("Field6 this[%v](%v) Not Equal that[%v](%v)", i, this.Field6[i], i, that1.Field6[i])
}
}
if len(this.Field7) != len(that1.Field7) {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", len(this.Field7), len(that1.Field7))
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return fmt.Errorf("Field7 this[%v](%v) Not Equal that[%v](%v)", i, this.Field7[i], i, that1.Field7[i])
}
}
if len(this.Field8) != len(that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", len(this.Field8), len(that1.Field8))
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return fmt.Errorf("Field8 this[%v](%v) Not Equal that[%v](%v)", i, this.Field8[i], i, that1.Field8[i])
}
}
if len(this.Field9) != len(that1.Field9) {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", len(this.Field9), len(that1.Field9))
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return fmt.Errorf("Field9 this[%v](%v) Not Equal that[%v](%v)", i, this.Field9[i], i, that1.Field9[i])
}
}
if len(this.Field10) != len(that1.Field10) {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", len(this.Field10), len(that1.Field10))
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return fmt.Errorf("Field10 this[%v](%v) Not Equal that[%v](%v)", i, this.Field10[i], i, that1.Field10[i])
}
}
if len(this.Field11) != len(that1.Field11) {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", len(this.Field11), len(that1.Field11))
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return fmt.Errorf("Field11 this[%v](%v) Not Equal that[%v](%v)", i, this.Field11[i], i, that1.Field11[i])
}
}
if len(this.Field12) != len(that1.Field12) {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", len(this.Field12), len(that1.Field12))
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return fmt.Errorf("Field12 this[%v](%v) Not Equal that[%v](%v)", i, this.Field12[i], i, that1.Field12[i])
}
}
if len(this.Field13) != len(that1.Field13) {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", len(this.Field13), len(that1.Field13))
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return fmt.Errorf("Field13 this[%v](%v) Not Equal that[%v](%v)", i, this.Field13[i], i, that1.Field13[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinRepPackedNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinRepPackedNative)
if !ok {
that2, ok := that.(NinRepPackedNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return false
}
}
if len(this.Field4) != len(that1.Field4) {
return false
}
for i := range this.Field4 {
if this.Field4[i] != that1.Field4[i] {
return false
}
}
if len(this.Field5) != len(that1.Field5) {
return false
}
for i := range this.Field5 {
if this.Field5[i] != that1.Field5[i] {
return false
}
}
if len(this.Field6) != len(that1.Field6) {
return false
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return false
}
}
if len(this.Field7) != len(that1.Field7) {
return false
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return false
}
}
if len(this.Field8) != len(that1.Field8) {
return false
}
for i := range this.Field8 {
if this.Field8[i] != that1.Field8[i] {
return false
}
}
if len(this.Field9) != len(that1.Field9) {
return false
}
for i := range this.Field9 {
if this.Field9[i] != that1.Field9[i] {
return false
}
}
if len(this.Field10) != len(that1.Field10) {
return false
}
for i := range this.Field10 {
if this.Field10[i] != that1.Field10[i] {
return false
}
}
if len(this.Field11) != len(that1.Field11) {
return false
}
for i := range this.Field11 {
if this.Field11[i] != that1.Field11[i] {
return false
}
}
if len(this.Field12) != len(that1.Field12) {
return false
}
for i := range this.Field12 {
if this.Field12[i] != that1.Field12[i] {
return false
}
}
if len(this.Field13) != len(that1.Field13) {
return false
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidOptStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidOptStruct)
if !ok {
that2, ok := that.(NidOptStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidOptStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidOptStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidOptStruct but is not nil && this == nil")
}
if this.Field1 != that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if !this.Field3.Equal(&that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !this.Field4.Equal(&that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", this.Field4, that1.Field4)
}
if this.Field6 != that1.Field6 {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", this.Field6, that1.Field6)
}
if this.Field7 != that1.Field7 {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", this.Field7, that1.Field7)
}
if !this.Field8.Equal(&that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", this.Field8, that1.Field8)
}
if this.Field13 != that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if this.Field14 != that1.Field14 {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", this.Field14, that1.Field14)
}
if !bytes.Equal(this.Field15, that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", this.Field15, that1.Field15)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidOptStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidOptStruct)
if !ok {
that2, ok := that.(NidOptStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != that1.Field1 {
return false
}
if this.Field2 != that1.Field2 {
return false
}
if !this.Field3.Equal(&that1.Field3) {
return false
}
if !this.Field4.Equal(&that1.Field4) {
return false
}
if this.Field6 != that1.Field6 {
return false
}
if this.Field7 != that1.Field7 {
return false
}
if !this.Field8.Equal(&that1.Field8) {
return false
}
if this.Field13 != that1.Field13 {
return false
}
if this.Field14 != that1.Field14 {
return false
}
if !bytes.Equal(this.Field15, that1.Field15) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptStruct)
if !ok {
that2, ok := that.(NinOptStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptStruct but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if !this.Field3.Equal(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !this.Field4.Equal(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", this.Field4, that1.Field4)
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", *this.Field6, *that1.Field6)
}
} else if this.Field6 != nil {
return fmt.Errorf("this.Field6 == nil && that.Field6 != nil")
} else if that1.Field6 != nil {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", this.Field6, that1.Field6)
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", *this.Field7, *that1.Field7)
}
} else if this.Field7 != nil {
return fmt.Errorf("this.Field7 == nil && that.Field7 != nil")
} else if that1.Field7 != nil {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", this.Field7, that1.Field7)
}
if !this.Field8.Equal(that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", this.Field8, that1.Field8)
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", *this.Field13, *that1.Field13)
}
} else if this.Field13 != nil {
return fmt.Errorf("this.Field13 == nil && that.Field13 != nil")
} else if that1.Field13 != nil {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", *this.Field14, *that1.Field14)
}
} else if this.Field14 != nil {
return fmt.Errorf("this.Field14 == nil && that.Field14 != nil")
} else if that1.Field14 != nil {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", this.Field14, that1.Field14)
}
if !bytes.Equal(this.Field15, that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", this.Field15, that1.Field15)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptStruct)
if !ok {
that2, ok := that.(NinOptStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if !this.Field3.Equal(that1.Field3) {
return false
}
if !this.Field4.Equal(that1.Field4) {
return false
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return false
}
} else if this.Field6 != nil {
return false
} else if that1.Field6 != nil {
return false
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return false
}
} else if this.Field7 != nil {
return false
} else if that1.Field7 != nil {
return false
}
if !this.Field8.Equal(that1.Field8) {
return false
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return false
}
} else if this.Field13 != nil {
return false
} else if that1.Field13 != nil {
return false
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return false
}
} else if this.Field14 != nil {
return false
} else if that1.Field14 != nil {
return false
}
if !bytes.Equal(this.Field15, that1.Field15) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidRepStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidRepStruct)
if !ok {
that2, ok := that.(NidRepStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidRepStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidRepStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidRepStruct but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if !this.Field3[i].Equal(&that1.Field3[i]) {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if len(this.Field4) != len(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", len(this.Field4), len(that1.Field4))
}
for i := range this.Field4 {
if !this.Field4[i].Equal(&that1.Field4[i]) {
return fmt.Errorf("Field4 this[%v](%v) Not Equal that[%v](%v)", i, this.Field4[i], i, that1.Field4[i])
}
}
if len(this.Field6) != len(that1.Field6) {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", len(this.Field6), len(that1.Field6))
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return fmt.Errorf("Field6 this[%v](%v) Not Equal that[%v](%v)", i, this.Field6[i], i, that1.Field6[i])
}
}
if len(this.Field7) != len(that1.Field7) {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", len(this.Field7), len(that1.Field7))
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return fmt.Errorf("Field7 this[%v](%v) Not Equal that[%v](%v)", i, this.Field7[i], i, that1.Field7[i])
}
}
if len(this.Field8) != len(that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", len(this.Field8), len(that1.Field8))
}
for i := range this.Field8 {
if !this.Field8[i].Equal(&that1.Field8[i]) {
return fmt.Errorf("Field8 this[%v](%v) Not Equal that[%v](%v)", i, this.Field8[i], i, that1.Field8[i])
}
}
if len(this.Field13) != len(that1.Field13) {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", len(this.Field13), len(that1.Field13))
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return fmt.Errorf("Field13 this[%v](%v) Not Equal that[%v](%v)", i, this.Field13[i], i, that1.Field13[i])
}
}
if len(this.Field14) != len(that1.Field14) {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", len(this.Field14), len(that1.Field14))
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return fmt.Errorf("Field14 this[%v](%v) Not Equal that[%v](%v)", i, this.Field14[i], i, that1.Field14[i])
}
}
if len(this.Field15) != len(that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", len(this.Field15), len(that1.Field15))
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return fmt.Errorf("Field15 this[%v](%v) Not Equal that[%v](%v)", i, this.Field15[i], i, that1.Field15[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidRepStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidRepStruct)
if !ok {
that2, ok := that.(NidRepStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if !this.Field3[i].Equal(&that1.Field3[i]) {
return false
}
}
if len(this.Field4) != len(that1.Field4) {
return false
}
for i := range this.Field4 {
if !this.Field4[i].Equal(&that1.Field4[i]) {
return false
}
}
if len(this.Field6) != len(that1.Field6) {
return false
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return false
}
}
if len(this.Field7) != len(that1.Field7) {
return false
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return false
}
}
if len(this.Field8) != len(that1.Field8) {
return false
}
for i := range this.Field8 {
if !this.Field8[i].Equal(&that1.Field8[i]) {
return false
}
}
if len(this.Field13) != len(that1.Field13) {
return false
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return false
}
}
if len(this.Field14) != len(that1.Field14) {
return false
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return false
}
}
if len(this.Field15) != len(that1.Field15) {
return false
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinRepStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinRepStruct)
if !ok {
that2, ok := that.(NinRepStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinRepStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinRepStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinRepStruct but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if !this.Field3[i].Equal(that1.Field3[i]) {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if len(this.Field4) != len(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", len(this.Field4), len(that1.Field4))
}
for i := range this.Field4 {
if !this.Field4[i].Equal(that1.Field4[i]) {
return fmt.Errorf("Field4 this[%v](%v) Not Equal that[%v](%v)", i, this.Field4[i], i, that1.Field4[i])
}
}
if len(this.Field6) != len(that1.Field6) {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", len(this.Field6), len(that1.Field6))
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return fmt.Errorf("Field6 this[%v](%v) Not Equal that[%v](%v)", i, this.Field6[i], i, that1.Field6[i])
}
}
if len(this.Field7) != len(that1.Field7) {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", len(this.Field7), len(that1.Field7))
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return fmt.Errorf("Field7 this[%v](%v) Not Equal that[%v](%v)", i, this.Field7[i], i, that1.Field7[i])
}
}
if len(this.Field8) != len(that1.Field8) {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", len(this.Field8), len(that1.Field8))
}
for i := range this.Field8 {
if !this.Field8[i].Equal(that1.Field8[i]) {
return fmt.Errorf("Field8 this[%v](%v) Not Equal that[%v](%v)", i, this.Field8[i], i, that1.Field8[i])
}
}
if len(this.Field13) != len(that1.Field13) {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", len(this.Field13), len(that1.Field13))
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return fmt.Errorf("Field13 this[%v](%v) Not Equal that[%v](%v)", i, this.Field13[i], i, that1.Field13[i])
}
}
if len(this.Field14) != len(that1.Field14) {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", len(this.Field14), len(that1.Field14))
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return fmt.Errorf("Field14 this[%v](%v) Not Equal that[%v](%v)", i, this.Field14[i], i, that1.Field14[i])
}
}
if len(this.Field15) != len(that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", len(this.Field15), len(that1.Field15))
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return fmt.Errorf("Field15 this[%v](%v) Not Equal that[%v](%v)", i, this.Field15[i], i, that1.Field15[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinRepStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinRepStruct)
if !ok {
that2, ok := that.(NinRepStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if !this.Field3[i].Equal(that1.Field3[i]) {
return false
}
}
if len(this.Field4) != len(that1.Field4) {
return false
}
for i := range this.Field4 {
if !this.Field4[i].Equal(that1.Field4[i]) {
return false
}
}
if len(this.Field6) != len(that1.Field6) {
return false
}
for i := range this.Field6 {
if this.Field6[i] != that1.Field6[i] {
return false
}
}
if len(this.Field7) != len(that1.Field7) {
return false
}
for i := range this.Field7 {
if this.Field7[i] != that1.Field7[i] {
return false
}
}
if len(this.Field8) != len(that1.Field8) {
return false
}
for i := range this.Field8 {
if !this.Field8[i].Equal(that1.Field8[i]) {
return false
}
}
if len(this.Field13) != len(that1.Field13) {
return false
}
for i := range this.Field13 {
if this.Field13[i] != that1.Field13[i] {
return false
}
}
if len(this.Field14) != len(that1.Field14) {
return false
}
for i := range this.Field14 {
if this.Field14[i] != that1.Field14[i] {
return false
}
}
if len(this.Field15) != len(that1.Field15) {
return false
}
for i := range this.Field15 {
if !bytes.Equal(this.Field15[i], that1.Field15[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidEmbeddedStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidEmbeddedStruct)
if !ok {
that2, ok := that.(NidEmbeddedStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidEmbeddedStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidEmbeddedStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidEmbeddedStruct but is not nil && this == nil")
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return fmt.Errorf("NidOptNative this(%v) Not Equal that(%v)", this.NidOptNative, that1.NidOptNative)
}
if !this.Field200.Equal(&that1.Field200) {
return fmt.Errorf("Field200 this(%v) Not Equal that(%v)", this.Field200, that1.Field200)
}
if this.Field210 != that1.Field210 {
return fmt.Errorf("Field210 this(%v) Not Equal that(%v)", this.Field210, that1.Field210)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidEmbeddedStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidEmbeddedStruct)
if !ok {
that2, ok := that.(NidEmbeddedStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return false
}
if !this.Field200.Equal(&that1.Field200) {
return false
}
if this.Field210 != that1.Field210 {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinEmbeddedStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinEmbeddedStruct)
if !ok {
that2, ok := that.(NinEmbeddedStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinEmbeddedStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinEmbeddedStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinEmbeddedStruct but is not nil && this == nil")
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return fmt.Errorf("NidOptNative this(%v) Not Equal that(%v)", this.NidOptNative, that1.NidOptNative)
}
if !this.Field200.Equal(that1.Field200) {
return fmt.Errorf("Field200 this(%v) Not Equal that(%v)", this.Field200, that1.Field200)
}
if this.Field210 != nil && that1.Field210 != nil {
if *this.Field210 != *that1.Field210 {
return fmt.Errorf("Field210 this(%v) Not Equal that(%v)", *this.Field210, *that1.Field210)
}
} else if this.Field210 != nil {
return fmt.Errorf("this.Field210 == nil && that.Field210 != nil")
} else if that1.Field210 != nil {
return fmt.Errorf("Field210 this(%v) Not Equal that(%v)", this.Field210, that1.Field210)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinEmbeddedStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinEmbeddedStruct)
if !ok {
that2, ok := that.(NinEmbeddedStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return false
}
if !this.Field200.Equal(that1.Field200) {
return false
}
if this.Field210 != nil && that1.Field210 != nil {
if *this.Field210 != *that1.Field210 {
return false
}
} else if this.Field210 != nil {
return false
} else if that1.Field210 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidNestedStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidNestedStruct)
if !ok {
that2, ok := that.(NidNestedStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidNestedStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidNestedStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidNestedStruct but is not nil && this == nil")
}
if !this.Field1.Equal(&that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if !this.Field2[i].Equal(&that1.Field2[i]) {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidNestedStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidNestedStruct)
if !ok {
that2, ok := that.(NidNestedStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Field1.Equal(&that1.Field1) {
return false
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if !this.Field2[i].Equal(&that1.Field2[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinNestedStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinNestedStruct)
if !ok {
that2, ok := that.(NinNestedStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinNestedStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinNestedStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinNestedStruct but is not nil && this == nil")
}
if !this.Field1.Equal(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if !this.Field2[i].Equal(that1.Field2[i]) {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinNestedStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinNestedStruct)
if !ok {
that2, ok := that.(NinNestedStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Field1.Equal(that1.Field1) {
return false
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if !this.Field2[i].Equal(that1.Field2[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidOptCustom) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidOptCustom)
if !ok {
that2, ok := that.(NidOptCustom)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidOptCustom")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidOptCustom but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidOptCustom but is not nil && this == nil")
}
if !this.Id.Equal(that1.Id) {
return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id)
}
if !this.Value.Equal(that1.Value) {
return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidOptCustom) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidOptCustom)
if !ok {
that2, ok := that.(NidOptCustom)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Id.Equal(that1.Id) {
return false
}
if !this.Value.Equal(that1.Value) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomDash) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomDash)
if !ok {
that2, ok := that.(CustomDash)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomDash")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomDash but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomDash but is not nil && this == nil")
}
if that1.Value == nil {
if this.Value != nil {
return fmt.Errorf("this.Value != nil && that1.Value == nil")
}
} else if !this.Value.Equal(*that1.Value) {
return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomDash) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomDash)
if !ok {
that2, ok := that.(CustomDash)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if that1.Value == nil {
if this.Value != nil {
return false
}
} else if !this.Value.Equal(*that1.Value) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptCustom) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptCustom)
if !ok {
that2, ok := that.(NinOptCustom)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptCustom")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptCustom but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptCustom but is not nil && this == nil")
}
if that1.Id == nil {
if this.Id != nil {
return fmt.Errorf("this.Id != nil && that1.Id == nil")
}
} else if !this.Id.Equal(*that1.Id) {
return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id)
}
if that1.Value == nil {
if this.Value != nil {
return fmt.Errorf("this.Value != nil && that1.Value == nil")
}
} else if !this.Value.Equal(*that1.Value) {
return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptCustom) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptCustom)
if !ok {
that2, ok := that.(NinOptCustom)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if that1.Id == nil {
if this.Id != nil {
return false
}
} else if !this.Id.Equal(*that1.Id) {
return false
}
if that1.Value == nil {
if this.Value != nil {
return false
}
} else if !this.Value.Equal(*that1.Value) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidRepCustom) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidRepCustom)
if !ok {
that2, ok := that.(NidRepCustom)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidRepCustom")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidRepCustom but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidRepCustom but is not nil && this == nil")
}
if len(this.Id) != len(that1.Id) {
return fmt.Errorf("Id this(%v) Not Equal that(%v)", len(this.Id), len(that1.Id))
}
for i := range this.Id {
if !this.Id[i].Equal(that1.Id[i]) {
return fmt.Errorf("Id this[%v](%v) Not Equal that[%v](%v)", i, this.Id[i], i, that1.Id[i])
}
}
if len(this.Value) != len(that1.Value) {
return fmt.Errorf("Value this(%v) Not Equal that(%v)", len(this.Value), len(that1.Value))
}
for i := range this.Value {
if !this.Value[i].Equal(that1.Value[i]) {
return fmt.Errorf("Value this[%v](%v) Not Equal that[%v](%v)", i, this.Value[i], i, that1.Value[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidRepCustom) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidRepCustom)
if !ok {
that2, ok := that.(NidRepCustom)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Id) != len(that1.Id) {
return false
}
for i := range this.Id {
if !this.Id[i].Equal(that1.Id[i]) {
return false
}
}
if len(this.Value) != len(that1.Value) {
return false
}
for i := range this.Value {
if !this.Value[i].Equal(that1.Value[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinRepCustom) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinRepCustom)
if !ok {
that2, ok := that.(NinRepCustom)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinRepCustom")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinRepCustom but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinRepCustom but is not nil && this == nil")
}
if len(this.Id) != len(that1.Id) {
return fmt.Errorf("Id this(%v) Not Equal that(%v)", len(this.Id), len(that1.Id))
}
for i := range this.Id {
if !this.Id[i].Equal(that1.Id[i]) {
return fmt.Errorf("Id this[%v](%v) Not Equal that[%v](%v)", i, this.Id[i], i, that1.Id[i])
}
}
if len(this.Value) != len(that1.Value) {
return fmt.Errorf("Value this(%v) Not Equal that(%v)", len(this.Value), len(that1.Value))
}
for i := range this.Value {
if !this.Value[i].Equal(that1.Value[i]) {
return fmt.Errorf("Value this[%v](%v) Not Equal that[%v](%v)", i, this.Value[i], i, that1.Value[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinRepCustom) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinRepCustom)
if !ok {
that2, ok := that.(NinRepCustom)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Id) != len(that1.Id) {
return false
}
for i := range this.Id {
if !this.Id[i].Equal(that1.Id[i]) {
return false
}
}
if len(this.Value) != len(that1.Value) {
return false
}
for i := range this.Value {
if !this.Value[i].Equal(that1.Value[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptNativeUnion) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptNativeUnion)
if !ok {
that2, ok := that.(NinOptNativeUnion)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptNativeUnion")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptNativeUnion but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptNativeUnion but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", *this.Field3, *that1.Field3)
}
} else if this.Field3 != nil {
return fmt.Errorf("this.Field3 == nil && that.Field3 != nil")
} else if that1.Field3 != nil {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", *this.Field4, *that1.Field4)
}
} else if this.Field4 != nil {
return fmt.Errorf("this.Field4 == nil && that.Field4 != nil")
} else if that1.Field4 != nil {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", this.Field4, that1.Field4)
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", *this.Field5, *that1.Field5)
}
} else if this.Field5 != nil {
return fmt.Errorf("this.Field5 == nil && that.Field5 != nil")
} else if that1.Field5 != nil {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", this.Field5, that1.Field5)
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", *this.Field6, *that1.Field6)
}
} else if this.Field6 != nil {
return fmt.Errorf("this.Field6 == nil && that.Field6 != nil")
} else if that1.Field6 != nil {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", this.Field6, that1.Field6)
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", *this.Field13, *that1.Field13)
}
} else if this.Field13 != nil {
return fmt.Errorf("this.Field13 == nil && that.Field13 != nil")
} else if that1.Field13 != nil {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", *this.Field14, *that1.Field14)
}
} else if this.Field14 != nil {
return fmt.Errorf("this.Field14 == nil && that.Field14 != nil")
} else if that1.Field14 != nil {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", this.Field14, that1.Field14)
}
if !bytes.Equal(this.Field15, that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", this.Field15, that1.Field15)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptNativeUnion) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptNativeUnion)
if !ok {
that2, ok := that.(NinOptNativeUnion)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return false
}
} else if this.Field3 != nil {
return false
} else if that1.Field3 != nil {
return false
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
return false
}
} else if this.Field4 != nil {
return false
} else if that1.Field4 != nil {
return false
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
return false
}
} else if this.Field5 != nil {
return false
} else if that1.Field5 != nil {
return false
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return false
}
} else if this.Field6 != nil {
return false
} else if that1.Field6 != nil {
return false
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return false
}
} else if this.Field13 != nil {
return false
} else if that1.Field13 != nil {
return false
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return false
}
} else if this.Field14 != nil {
return false
} else if that1.Field14 != nil {
return false
}
if !bytes.Equal(this.Field15, that1.Field15) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptStructUnion) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptStructUnion)
if !ok {
that2, ok := that.(NinOptStructUnion)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptStructUnion")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptStructUnion but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptStructUnion but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if !this.Field3.Equal(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !this.Field4.Equal(that1.Field4) {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", this.Field4, that1.Field4)
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", *this.Field6, *that1.Field6)
}
} else if this.Field6 != nil {
return fmt.Errorf("this.Field6 == nil && that.Field6 != nil")
} else if that1.Field6 != nil {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", this.Field6, that1.Field6)
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", *this.Field7, *that1.Field7)
}
} else if this.Field7 != nil {
return fmt.Errorf("this.Field7 == nil && that.Field7 != nil")
} else if that1.Field7 != nil {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", this.Field7, that1.Field7)
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", *this.Field13, *that1.Field13)
}
} else if this.Field13 != nil {
return fmt.Errorf("this.Field13 == nil && that.Field13 != nil")
} else if that1.Field13 != nil {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", *this.Field14, *that1.Field14)
}
} else if this.Field14 != nil {
return fmt.Errorf("this.Field14 == nil && that.Field14 != nil")
} else if that1.Field14 != nil {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", this.Field14, that1.Field14)
}
if !bytes.Equal(this.Field15, that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", this.Field15, that1.Field15)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptStructUnion) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptStructUnion)
if !ok {
that2, ok := that.(NinOptStructUnion)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if !this.Field3.Equal(that1.Field3) {
return false
}
if !this.Field4.Equal(that1.Field4) {
return false
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return false
}
} else if this.Field6 != nil {
return false
} else if that1.Field6 != nil {
return false
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return false
}
} else if this.Field7 != nil {
return false
} else if that1.Field7 != nil {
return false
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return false
}
} else if this.Field13 != nil {
return false
} else if that1.Field13 != nil {
return false
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return false
}
} else if this.Field14 != nil {
return false
} else if that1.Field14 != nil {
return false
}
if !bytes.Equal(this.Field15, that1.Field15) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinEmbeddedStructUnion) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinEmbeddedStructUnion)
if !ok {
that2, ok := that.(NinEmbeddedStructUnion)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinEmbeddedStructUnion")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinEmbeddedStructUnion but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinEmbeddedStructUnion but is not nil && this == nil")
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return fmt.Errorf("NidOptNative this(%v) Not Equal that(%v)", this.NidOptNative, that1.NidOptNative)
}
if !this.Field200.Equal(that1.Field200) {
return fmt.Errorf("Field200 this(%v) Not Equal that(%v)", this.Field200, that1.Field200)
}
if this.Field210 != nil && that1.Field210 != nil {
if *this.Field210 != *that1.Field210 {
return fmt.Errorf("Field210 this(%v) Not Equal that(%v)", *this.Field210, *that1.Field210)
}
} else if this.Field210 != nil {
return fmt.Errorf("this.Field210 == nil && that.Field210 != nil")
} else if that1.Field210 != nil {
return fmt.Errorf("Field210 this(%v) Not Equal that(%v)", this.Field210, that1.Field210)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinEmbeddedStructUnion) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinEmbeddedStructUnion)
if !ok {
that2, ok := that.(NinEmbeddedStructUnion)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return false
}
if !this.Field200.Equal(that1.Field200) {
return false
}
if this.Field210 != nil && that1.Field210 != nil {
if *this.Field210 != *that1.Field210 {
return false
}
} else if this.Field210 != nil {
return false
} else if that1.Field210 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinNestedStructUnion) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinNestedStructUnion)
if !ok {
that2, ok := that.(NinNestedStructUnion)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinNestedStructUnion")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinNestedStructUnion but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinNestedStructUnion but is not nil && this == nil")
}
if !this.Field1.Equal(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if !this.Field2.Equal(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if !this.Field3.Equal(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinNestedStructUnion) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinNestedStructUnion)
if !ok {
that2, ok := that.(NinNestedStructUnion)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Field1.Equal(that1.Field1) {
return false
}
if !this.Field2.Equal(that1.Field2) {
return false
}
if !this.Field3.Equal(that1.Field3) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Tree) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Tree)
if !ok {
that2, ok := that.(Tree)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Tree")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Tree but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Tree but is not nil && this == nil")
}
if !this.Or.Equal(that1.Or) {
return fmt.Errorf("Or this(%v) Not Equal that(%v)", this.Or, that1.Or)
}
if !this.And.Equal(that1.And) {
return fmt.Errorf("And this(%v) Not Equal that(%v)", this.And, that1.And)
}
if !this.Leaf.Equal(that1.Leaf) {
return fmt.Errorf("Leaf this(%v) Not Equal that(%v)", this.Leaf, that1.Leaf)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *Tree) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Tree)
if !ok {
that2, ok := that.(Tree)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Or.Equal(that1.Or) {
return false
}
if !this.And.Equal(that1.And) {
return false
}
if !this.Leaf.Equal(that1.Leaf) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *OrBranch) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*OrBranch)
if !ok {
that2, ok := that.(OrBranch)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *OrBranch")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *OrBranch but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *OrBranch but is not nil && this == nil")
}
if !this.Left.Equal(&that1.Left) {
return fmt.Errorf("Left this(%v) Not Equal that(%v)", this.Left, that1.Left)
}
if !this.Right.Equal(&that1.Right) {
return fmt.Errorf("Right this(%v) Not Equal that(%v)", this.Right, that1.Right)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *OrBranch) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*OrBranch)
if !ok {
that2, ok := that.(OrBranch)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Left.Equal(&that1.Left) {
return false
}
if !this.Right.Equal(&that1.Right) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *AndBranch) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*AndBranch)
if !ok {
that2, ok := that.(AndBranch)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *AndBranch")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *AndBranch but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *AndBranch but is not nil && this == nil")
}
if !this.Left.Equal(&that1.Left) {
return fmt.Errorf("Left this(%v) Not Equal that(%v)", this.Left, that1.Left)
}
if !this.Right.Equal(&that1.Right) {
return fmt.Errorf("Right this(%v) Not Equal that(%v)", this.Right, that1.Right)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *AndBranch) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*AndBranch)
if !ok {
that2, ok := that.(AndBranch)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Left.Equal(&that1.Left) {
return false
}
if !this.Right.Equal(&that1.Right) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Leaf) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Leaf)
if !ok {
that2, ok := that.(Leaf)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Leaf")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Leaf but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Leaf but is not nil && this == nil")
}
if this.Value != that1.Value {
return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value)
}
if this.StrValue != that1.StrValue {
return fmt.Errorf("StrValue this(%v) Not Equal that(%v)", this.StrValue, that1.StrValue)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *Leaf) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Leaf)
if !ok {
that2, ok := that.(Leaf)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Value != that1.Value {
return false
}
if this.StrValue != that1.StrValue {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *DeepTree) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*DeepTree)
if !ok {
that2, ok := that.(DeepTree)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *DeepTree")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *DeepTree but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *DeepTree but is not nil && this == nil")
}
if !this.Down.Equal(that1.Down) {
return fmt.Errorf("Down this(%v) Not Equal that(%v)", this.Down, that1.Down)
}
if !this.And.Equal(that1.And) {
return fmt.Errorf("And this(%v) Not Equal that(%v)", this.And, that1.And)
}
if !this.Leaf.Equal(that1.Leaf) {
return fmt.Errorf("Leaf this(%v) Not Equal that(%v)", this.Leaf, that1.Leaf)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *DeepTree) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*DeepTree)
if !ok {
that2, ok := that.(DeepTree)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Down.Equal(that1.Down) {
return false
}
if !this.And.Equal(that1.And) {
return false
}
if !this.Leaf.Equal(that1.Leaf) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *ADeepBranch) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*ADeepBranch)
if !ok {
that2, ok := that.(ADeepBranch)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *ADeepBranch")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *ADeepBranch but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *ADeepBranch but is not nil && this == nil")
}
if !this.Down.Equal(&that1.Down) {
return fmt.Errorf("Down this(%v) Not Equal that(%v)", this.Down, that1.Down)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *ADeepBranch) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*ADeepBranch)
if !ok {
that2, ok := that.(ADeepBranch)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Down.Equal(&that1.Down) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *AndDeepBranch) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*AndDeepBranch)
if !ok {
that2, ok := that.(AndDeepBranch)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *AndDeepBranch")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *AndDeepBranch but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *AndDeepBranch but is not nil && this == nil")
}
if !this.Left.Equal(&that1.Left) {
return fmt.Errorf("Left this(%v) Not Equal that(%v)", this.Left, that1.Left)
}
if !this.Right.Equal(&that1.Right) {
return fmt.Errorf("Right this(%v) Not Equal that(%v)", this.Right, that1.Right)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *AndDeepBranch) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*AndDeepBranch)
if !ok {
that2, ok := that.(AndDeepBranch)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Left.Equal(&that1.Left) {
return false
}
if !this.Right.Equal(&that1.Right) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *DeepLeaf) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*DeepLeaf)
if !ok {
that2, ok := that.(DeepLeaf)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *DeepLeaf")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *DeepLeaf but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *DeepLeaf but is not nil && this == nil")
}
if !this.Tree.Equal(&that1.Tree) {
return fmt.Errorf("Tree this(%v) Not Equal that(%v)", this.Tree, that1.Tree)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *DeepLeaf) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*DeepLeaf)
if !ok {
that2, ok := that.(DeepLeaf)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Tree.Equal(&that1.Tree) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Nil) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Nil)
if !ok {
that2, ok := that.(Nil)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Nil")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Nil but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Nil but is not nil && this == nil")
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *Nil) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Nil)
if !ok {
that2, ok := that.(Nil)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidOptEnum) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidOptEnum)
if !ok {
that2, ok := that.(NidOptEnum)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidOptEnum")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidOptEnum but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidOptEnum but is not nil && this == nil")
}
if this.Field1 != that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidOptEnum) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidOptEnum)
if !ok {
that2, ok := that.(NidOptEnum)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != that1.Field1 {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptEnum) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptEnum)
if !ok {
that2, ok := that.(NinOptEnum)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptEnum")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptEnum but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptEnum but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", *this.Field3, *that1.Field3)
}
} else if this.Field3 != nil {
return fmt.Errorf("this.Field3 == nil && that.Field3 != nil")
} else if that1.Field3 != nil {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptEnum) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptEnum)
if !ok {
that2, ok := that.(NinOptEnum)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return false
}
} else if this.Field3 != nil {
return false
} else if that1.Field3 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidRepEnum) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidRepEnum)
if !ok {
that2, ok := that.(NidRepEnum)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidRepEnum")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidRepEnum but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidRepEnum but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidRepEnum) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidRepEnum)
if !ok {
that2, ok := that.(NidRepEnum)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinRepEnum) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinRepEnum)
if !ok {
that2, ok := that.(NinRepEnum)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinRepEnum")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinRepEnum but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinRepEnum but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if len(this.Field2) != len(that1.Field2) {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", len(this.Field2), len(that1.Field2))
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return fmt.Errorf("Field2 this[%v](%v) Not Equal that[%v](%v)", i, this.Field2[i], i, that1.Field2[i])
}
}
if len(this.Field3) != len(that1.Field3) {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", len(this.Field3), len(that1.Field3))
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return fmt.Errorf("Field3 this[%v](%v) Not Equal that[%v](%v)", i, this.Field3[i], i, that1.Field3[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinRepEnum) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinRepEnum)
if !ok {
that2, ok := that.(NinRepEnum)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if this.Field1[i] != that1.Field1[i] {
return false
}
}
if len(this.Field2) != len(that1.Field2) {
return false
}
for i := range this.Field2 {
if this.Field2[i] != that1.Field2[i] {
return false
}
}
if len(this.Field3) != len(that1.Field3) {
return false
}
for i := range this.Field3 {
if this.Field3[i] != that1.Field3[i] {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptEnumDefault) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptEnumDefault)
if !ok {
that2, ok := that.(NinOptEnumDefault)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptEnumDefault")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptEnumDefault but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptEnumDefault but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", *this.Field3, *that1.Field3)
}
} else if this.Field3 != nil {
return fmt.Errorf("this.Field3 == nil && that.Field3 != nil")
} else if that1.Field3 != nil {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptEnumDefault) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptEnumDefault)
if !ok {
that2, ok := that.(NinOptEnumDefault)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return false
}
} else if this.Field3 != nil {
return false
} else if that1.Field3 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *AnotherNinOptEnum) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*AnotherNinOptEnum)
if !ok {
that2, ok := that.(AnotherNinOptEnum)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *AnotherNinOptEnum")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *AnotherNinOptEnum but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *AnotherNinOptEnum but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", *this.Field3, *that1.Field3)
}
} else if this.Field3 != nil {
return fmt.Errorf("this.Field3 == nil && that.Field3 != nil")
} else if that1.Field3 != nil {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *AnotherNinOptEnum) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*AnotherNinOptEnum)
if !ok {
that2, ok := that.(AnotherNinOptEnum)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return false
}
} else if this.Field3 != nil {
return false
} else if that1.Field3 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *AnotherNinOptEnumDefault) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*AnotherNinOptEnumDefault)
if !ok {
that2, ok := that.(AnotherNinOptEnumDefault)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *AnotherNinOptEnumDefault")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *AnotherNinOptEnumDefault but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *AnotherNinOptEnumDefault but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", *this.Field3, *that1.Field3)
}
} else if this.Field3 != nil {
return fmt.Errorf("this.Field3 == nil && that.Field3 != nil")
} else if that1.Field3 != nil {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *AnotherNinOptEnumDefault) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*AnotherNinOptEnumDefault)
if !ok {
that2, ok := that.(AnotherNinOptEnumDefault)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return false
}
} else if this.Field3 != nil {
return false
} else if that1.Field3 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Timer) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Timer)
if !ok {
that2, ok := that.(Timer)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Timer")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Timer but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Timer but is not nil && this == nil")
}
if this.Time1 != that1.Time1 {
return fmt.Errorf("Time1 this(%v) Not Equal that(%v)", this.Time1, that1.Time1)
}
if this.Time2 != that1.Time2 {
return fmt.Errorf("Time2 this(%v) Not Equal that(%v)", this.Time2, that1.Time2)
}
if !bytes.Equal(this.Data, that1.Data) {
return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *Timer) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Timer)
if !ok {
that2, ok := that.(Timer)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Time1 != that1.Time1 {
return false
}
if this.Time2 != that1.Time2 {
return false
}
if !bytes.Equal(this.Data, that1.Data) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *MyExtendable) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*MyExtendable)
if !ok {
that2, ok := that.(MyExtendable)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *MyExtendable")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *MyExtendable but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *MyExtendable but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
thismap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(this)
thatmap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(that1)
for k, v := range thismap {
if v2, ok := thatmap[k]; ok {
if !v.Equal(&v2) {
return fmt.Errorf("XXX_InternalExtensions this[%v](%v) Not Equal that[%v](%v)", k, thismap[k], k, thatmap[k])
}
} else {
return fmt.Errorf("XXX_InternalExtensions[%v] Not In that", k)
}
}
for k := range thatmap {
if _, ok := thismap[k]; !ok {
return fmt.Errorf("XXX_InternalExtensions[%v] Not In this", k)
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *MyExtendable) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*MyExtendable)
if !ok {
that2, ok := that.(MyExtendable)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
thismap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(this)
thatmap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(that1)
for k, v := range thismap {
if v2, ok := thatmap[k]; ok {
if !v.Equal(&v2) {
return false
}
} else {
return false
}
}
for k := range thatmap {
if _, ok := thismap[k]; !ok {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *OtherExtenable) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*OtherExtenable)
if !ok {
that2, ok := that.(OtherExtenable)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *OtherExtenable")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *OtherExtenable but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *OtherExtenable but is not nil && this == nil")
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", *this.Field13, *that1.Field13)
}
} else if this.Field13 != nil {
return fmt.Errorf("this.Field13 == nil && that.Field13 != nil")
} else if that1.Field13 != nil {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if !this.M.Equal(that1.M) {
return fmt.Errorf("M this(%v) Not Equal that(%v)", this.M, that1.M)
}
thismap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(this)
thatmap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(that1)
for k, v := range thismap {
if v2, ok := thatmap[k]; ok {
if !v.Equal(&v2) {
return fmt.Errorf("XXX_InternalExtensions this[%v](%v) Not Equal that[%v](%v)", k, thismap[k], k, thatmap[k])
}
} else {
return fmt.Errorf("XXX_InternalExtensions[%v] Not In that", k)
}
}
for k := range thatmap {
if _, ok := thismap[k]; !ok {
return fmt.Errorf("XXX_InternalExtensions[%v] Not In this", k)
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *OtherExtenable) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*OtherExtenable)
if !ok {
that2, ok := that.(OtherExtenable)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return false
}
} else if this.Field13 != nil {
return false
} else if that1.Field13 != nil {
return false
}
if !this.M.Equal(that1.M) {
return false
}
thismap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(this)
thatmap := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(that1)
for k, v := range thismap {
if v2, ok := thatmap[k]; ok {
if !v.Equal(&v2) {
return false
}
} else {
return false
}
}
for k := range thatmap {
if _, ok := thismap[k]; !ok {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NestedDefinition) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NestedDefinition)
if !ok {
that2, ok := that.(NestedDefinition)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NestedDefinition")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NestedDefinition but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NestedDefinition but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.EnumField != nil && that1.EnumField != nil {
if *this.EnumField != *that1.EnumField {
return fmt.Errorf("EnumField this(%v) Not Equal that(%v)", *this.EnumField, *that1.EnumField)
}
} else if this.EnumField != nil {
return fmt.Errorf("this.EnumField == nil && that.EnumField != nil")
} else if that1.EnumField != nil {
return fmt.Errorf("EnumField this(%v) Not Equal that(%v)", this.EnumField, that1.EnumField)
}
if !this.NNM.Equal(that1.NNM) {
return fmt.Errorf("NNM this(%v) Not Equal that(%v)", this.NNM, that1.NNM)
}
if !this.NM.Equal(that1.NM) {
return fmt.Errorf("NM this(%v) Not Equal that(%v)", this.NM, that1.NM)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NestedDefinition) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NestedDefinition)
if !ok {
that2, ok := that.(NestedDefinition)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.EnumField != nil && that1.EnumField != nil {
if *this.EnumField != *that1.EnumField {
return false
}
} else if this.EnumField != nil {
return false
} else if that1.EnumField != nil {
return false
}
if !this.NNM.Equal(that1.NNM) {
return false
}
if !this.NM.Equal(that1.NM) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NestedDefinition_NestedMessage) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NestedDefinition_NestedMessage)
if !ok {
that2, ok := that.(NestedDefinition_NestedMessage)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NestedDefinition_NestedMessage")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NestedDefinition_NestedMessage but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NestedDefinition_NestedMessage but is not nil && this == nil")
}
if this.NestedField1 != nil && that1.NestedField1 != nil {
if *this.NestedField1 != *that1.NestedField1 {
return fmt.Errorf("NestedField1 this(%v) Not Equal that(%v)", *this.NestedField1, *that1.NestedField1)
}
} else if this.NestedField1 != nil {
return fmt.Errorf("this.NestedField1 == nil && that.NestedField1 != nil")
} else if that1.NestedField1 != nil {
return fmt.Errorf("NestedField1 this(%v) Not Equal that(%v)", this.NestedField1, that1.NestedField1)
}
if !this.NNM.Equal(that1.NNM) {
return fmt.Errorf("NNM this(%v) Not Equal that(%v)", this.NNM, that1.NNM)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NestedDefinition_NestedMessage) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NestedDefinition_NestedMessage)
if !ok {
that2, ok := that.(NestedDefinition_NestedMessage)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.NestedField1 != nil && that1.NestedField1 != nil {
if *this.NestedField1 != *that1.NestedField1 {
return false
}
} else if this.NestedField1 != nil {
return false
} else if that1.NestedField1 != nil {
return false
}
if !this.NNM.Equal(that1.NNM) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NestedDefinition_NestedMessage_NestedNestedMsg)
if !ok {
that2, ok := that.(NestedDefinition_NestedMessage_NestedNestedMsg)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NestedDefinition_NestedMessage_NestedNestedMsg")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NestedDefinition_NestedMessage_NestedNestedMsg but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NestedDefinition_NestedMessage_NestedNestedMsg but is not nil && this == nil")
}
if this.NestedNestedField1 != nil && that1.NestedNestedField1 != nil {
if *this.NestedNestedField1 != *that1.NestedNestedField1 {
return fmt.Errorf("NestedNestedField1 this(%v) Not Equal that(%v)", *this.NestedNestedField1, *that1.NestedNestedField1)
}
} else if this.NestedNestedField1 != nil {
return fmt.Errorf("this.NestedNestedField1 == nil && that.NestedNestedField1 != nil")
} else if that1.NestedNestedField1 != nil {
return fmt.Errorf("NestedNestedField1 this(%v) Not Equal that(%v)", this.NestedNestedField1, that1.NestedNestedField1)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NestedDefinition_NestedMessage_NestedNestedMsg)
if !ok {
that2, ok := that.(NestedDefinition_NestedMessage_NestedNestedMsg)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.NestedNestedField1 != nil && that1.NestedNestedField1 != nil {
if *this.NestedNestedField1 != *that1.NestedNestedField1 {
return false
}
} else if this.NestedNestedField1 != nil {
return false
} else if that1.NestedNestedField1 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NestedScope) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NestedScope)
if !ok {
that2, ok := that.(NestedScope)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NestedScope")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NestedScope but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NestedScope but is not nil && this == nil")
}
if !this.A.Equal(that1.A) {
return fmt.Errorf("A this(%v) Not Equal that(%v)", this.A, that1.A)
}
if this.B != nil && that1.B != nil {
if *this.B != *that1.B {
return fmt.Errorf("B this(%v) Not Equal that(%v)", *this.B, *that1.B)
}
} else if this.B != nil {
return fmt.Errorf("this.B == nil && that.B != nil")
} else if that1.B != nil {
return fmt.Errorf("B this(%v) Not Equal that(%v)", this.B, that1.B)
}
if !this.C.Equal(that1.C) {
return fmt.Errorf("C this(%v) Not Equal that(%v)", this.C, that1.C)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NestedScope) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NestedScope)
if !ok {
that2, ok := that.(NestedScope)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.A.Equal(that1.A) {
return false
}
if this.B != nil && that1.B != nil {
if *this.B != *that1.B {
return false
}
} else if this.B != nil {
return false
} else if that1.B != nil {
return false
}
if !this.C.Equal(that1.C) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptNativeDefault) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptNativeDefault)
if !ok {
that2, ok := that.(NinOptNativeDefault)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptNativeDefault")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptNativeDefault but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptNativeDefault but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", *this.Field3, *that1.Field3)
}
} else if this.Field3 != nil {
return fmt.Errorf("this.Field3 == nil && that.Field3 != nil")
} else if that1.Field3 != nil {
return fmt.Errorf("Field3 this(%v) Not Equal that(%v)", this.Field3, that1.Field3)
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", *this.Field4, *that1.Field4)
}
} else if this.Field4 != nil {
return fmt.Errorf("this.Field4 == nil && that.Field4 != nil")
} else if that1.Field4 != nil {
return fmt.Errorf("Field4 this(%v) Not Equal that(%v)", this.Field4, that1.Field4)
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", *this.Field5, *that1.Field5)
}
} else if this.Field5 != nil {
return fmt.Errorf("this.Field5 == nil && that.Field5 != nil")
} else if that1.Field5 != nil {
return fmt.Errorf("Field5 this(%v) Not Equal that(%v)", this.Field5, that1.Field5)
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", *this.Field6, *that1.Field6)
}
} else if this.Field6 != nil {
return fmt.Errorf("this.Field6 == nil && that.Field6 != nil")
} else if that1.Field6 != nil {
return fmt.Errorf("Field6 this(%v) Not Equal that(%v)", this.Field6, that1.Field6)
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", *this.Field7, *that1.Field7)
}
} else if this.Field7 != nil {
return fmt.Errorf("this.Field7 == nil && that.Field7 != nil")
} else if that1.Field7 != nil {
return fmt.Errorf("Field7 this(%v) Not Equal that(%v)", this.Field7, that1.Field7)
}
if this.Field8 != nil && that1.Field8 != nil {
if *this.Field8 != *that1.Field8 {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", *this.Field8, *that1.Field8)
}
} else if this.Field8 != nil {
return fmt.Errorf("this.Field8 == nil && that.Field8 != nil")
} else if that1.Field8 != nil {
return fmt.Errorf("Field8 this(%v) Not Equal that(%v)", this.Field8, that1.Field8)
}
if this.Field9 != nil && that1.Field9 != nil {
if *this.Field9 != *that1.Field9 {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", *this.Field9, *that1.Field9)
}
} else if this.Field9 != nil {
return fmt.Errorf("this.Field9 == nil && that.Field9 != nil")
} else if that1.Field9 != nil {
return fmt.Errorf("Field9 this(%v) Not Equal that(%v)", this.Field9, that1.Field9)
}
if this.Field10 != nil && that1.Field10 != nil {
if *this.Field10 != *that1.Field10 {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", *this.Field10, *that1.Field10)
}
} else if this.Field10 != nil {
return fmt.Errorf("this.Field10 == nil && that.Field10 != nil")
} else if that1.Field10 != nil {
return fmt.Errorf("Field10 this(%v) Not Equal that(%v)", this.Field10, that1.Field10)
}
if this.Field11 != nil && that1.Field11 != nil {
if *this.Field11 != *that1.Field11 {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", *this.Field11, *that1.Field11)
}
} else if this.Field11 != nil {
return fmt.Errorf("this.Field11 == nil && that.Field11 != nil")
} else if that1.Field11 != nil {
return fmt.Errorf("Field11 this(%v) Not Equal that(%v)", this.Field11, that1.Field11)
}
if this.Field12 != nil && that1.Field12 != nil {
if *this.Field12 != *that1.Field12 {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", *this.Field12, *that1.Field12)
}
} else if this.Field12 != nil {
return fmt.Errorf("this.Field12 == nil && that.Field12 != nil")
} else if that1.Field12 != nil {
return fmt.Errorf("Field12 this(%v) Not Equal that(%v)", this.Field12, that1.Field12)
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", *this.Field13, *that1.Field13)
}
} else if this.Field13 != nil {
return fmt.Errorf("this.Field13 == nil && that.Field13 != nil")
} else if that1.Field13 != nil {
return fmt.Errorf("Field13 this(%v) Not Equal that(%v)", this.Field13, that1.Field13)
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", *this.Field14, *that1.Field14)
}
} else if this.Field14 != nil {
return fmt.Errorf("this.Field14 == nil && that.Field14 != nil")
} else if that1.Field14 != nil {
return fmt.Errorf("Field14 this(%v) Not Equal that(%v)", this.Field14, that1.Field14)
}
if !bytes.Equal(this.Field15, that1.Field15) {
return fmt.Errorf("Field15 this(%v) Not Equal that(%v)", this.Field15, that1.Field15)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptNativeDefault) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptNativeDefault)
if !ok {
that2, ok := that.(NinOptNativeDefault)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if this.Field3 != nil && that1.Field3 != nil {
if *this.Field3 != *that1.Field3 {
return false
}
} else if this.Field3 != nil {
return false
} else if that1.Field3 != nil {
return false
}
if this.Field4 != nil && that1.Field4 != nil {
if *this.Field4 != *that1.Field4 {
return false
}
} else if this.Field4 != nil {
return false
} else if that1.Field4 != nil {
return false
}
if this.Field5 != nil && that1.Field5 != nil {
if *this.Field5 != *that1.Field5 {
return false
}
} else if this.Field5 != nil {
return false
} else if that1.Field5 != nil {
return false
}
if this.Field6 != nil && that1.Field6 != nil {
if *this.Field6 != *that1.Field6 {
return false
}
} else if this.Field6 != nil {
return false
} else if that1.Field6 != nil {
return false
}
if this.Field7 != nil && that1.Field7 != nil {
if *this.Field7 != *that1.Field7 {
return false
}
} else if this.Field7 != nil {
return false
} else if that1.Field7 != nil {
return false
}
if this.Field8 != nil && that1.Field8 != nil {
if *this.Field8 != *that1.Field8 {
return false
}
} else if this.Field8 != nil {
return false
} else if that1.Field8 != nil {
return false
}
if this.Field9 != nil && that1.Field9 != nil {
if *this.Field9 != *that1.Field9 {
return false
}
} else if this.Field9 != nil {
return false
} else if that1.Field9 != nil {
return false
}
if this.Field10 != nil && that1.Field10 != nil {
if *this.Field10 != *that1.Field10 {
return false
}
} else if this.Field10 != nil {
return false
} else if that1.Field10 != nil {
return false
}
if this.Field11 != nil && that1.Field11 != nil {
if *this.Field11 != *that1.Field11 {
return false
}
} else if this.Field11 != nil {
return false
} else if that1.Field11 != nil {
return false
}
if this.Field12 != nil && that1.Field12 != nil {
if *this.Field12 != *that1.Field12 {
return false
}
} else if this.Field12 != nil {
return false
} else if that1.Field12 != nil {
return false
}
if this.Field13 != nil && that1.Field13 != nil {
if *this.Field13 != *that1.Field13 {
return false
}
} else if this.Field13 != nil {
return false
} else if that1.Field13 != nil {
return false
}
if this.Field14 != nil && that1.Field14 != nil {
if *this.Field14 != *that1.Field14 {
return false
}
} else if this.Field14 != nil {
return false
} else if that1.Field14 != nil {
return false
}
if !bytes.Equal(this.Field15, that1.Field15) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomContainer) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomContainer)
if !ok {
that2, ok := that.(CustomContainer)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomContainer")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomContainer but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomContainer but is not nil && this == nil")
}
if !this.CustomStruct.Equal(&that1.CustomStruct) {
return fmt.Errorf("CustomStruct this(%v) Not Equal that(%v)", this.CustomStruct, that1.CustomStruct)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomContainer) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomContainer)
if !ok {
that2, ok := that.(CustomContainer)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.CustomStruct.Equal(&that1.CustomStruct) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomNameNidOptNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomNameNidOptNative)
if !ok {
that2, ok := that.(CustomNameNidOptNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomNameNidOptNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomNameNidOptNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomNameNidOptNative but is not nil && this == nil")
}
if this.FieldA != that1.FieldA {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", this.FieldA, that1.FieldA)
}
if this.FieldB != that1.FieldB {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", this.FieldB, that1.FieldB)
}
if this.FieldC != that1.FieldC {
return fmt.Errorf("FieldC this(%v) Not Equal that(%v)", this.FieldC, that1.FieldC)
}
if this.FieldD != that1.FieldD {
return fmt.Errorf("FieldD this(%v) Not Equal that(%v)", this.FieldD, that1.FieldD)
}
if this.FieldE != that1.FieldE {
return fmt.Errorf("FieldE this(%v) Not Equal that(%v)", this.FieldE, that1.FieldE)
}
if this.FieldF != that1.FieldF {
return fmt.Errorf("FieldF this(%v) Not Equal that(%v)", this.FieldF, that1.FieldF)
}
if this.FieldG != that1.FieldG {
return fmt.Errorf("FieldG this(%v) Not Equal that(%v)", this.FieldG, that1.FieldG)
}
if this.FieldH != that1.FieldH {
return fmt.Errorf("FieldH this(%v) Not Equal that(%v)", this.FieldH, that1.FieldH)
}
if this.FieldI != that1.FieldI {
return fmt.Errorf("FieldI this(%v) Not Equal that(%v)", this.FieldI, that1.FieldI)
}
if this.FieldJ != that1.FieldJ {
return fmt.Errorf("FieldJ this(%v) Not Equal that(%v)", this.FieldJ, that1.FieldJ)
}
if this.FieldK != that1.FieldK {
return fmt.Errorf("FieldK this(%v) Not Equal that(%v)", this.FieldK, that1.FieldK)
}
if this.FieldL != that1.FieldL {
return fmt.Errorf("FieldL this(%v) Not Equal that(%v)", this.FieldL, that1.FieldL)
}
if this.FieldM != that1.FieldM {
return fmt.Errorf("FieldM this(%v) Not Equal that(%v)", this.FieldM, that1.FieldM)
}
if this.FieldN != that1.FieldN {
return fmt.Errorf("FieldN this(%v) Not Equal that(%v)", this.FieldN, that1.FieldN)
}
if !bytes.Equal(this.FieldO, that1.FieldO) {
return fmt.Errorf("FieldO this(%v) Not Equal that(%v)", this.FieldO, that1.FieldO)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomNameNidOptNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomNameNidOptNative)
if !ok {
that2, ok := that.(CustomNameNidOptNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.FieldA != that1.FieldA {
return false
}
if this.FieldB != that1.FieldB {
return false
}
if this.FieldC != that1.FieldC {
return false
}
if this.FieldD != that1.FieldD {
return false
}
if this.FieldE != that1.FieldE {
return false
}
if this.FieldF != that1.FieldF {
return false
}
if this.FieldG != that1.FieldG {
return false
}
if this.FieldH != that1.FieldH {
return false
}
if this.FieldI != that1.FieldI {
return false
}
if this.FieldJ != that1.FieldJ {
return false
}
if this.FieldK != that1.FieldK {
return false
}
if this.FieldL != that1.FieldL {
return false
}
if this.FieldM != that1.FieldM {
return false
}
if this.FieldN != that1.FieldN {
return false
}
if !bytes.Equal(this.FieldO, that1.FieldO) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomNameNinOptNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomNameNinOptNative)
if !ok {
that2, ok := that.(CustomNameNinOptNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomNameNinOptNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomNameNinOptNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomNameNinOptNative but is not nil && this == nil")
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", *this.FieldA, *that1.FieldA)
}
} else if this.FieldA != nil {
return fmt.Errorf("this.FieldA == nil && that.FieldA != nil")
} else if that1.FieldA != nil {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", this.FieldA, that1.FieldA)
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", *this.FieldB, *that1.FieldB)
}
} else if this.FieldB != nil {
return fmt.Errorf("this.FieldB == nil && that.FieldB != nil")
} else if that1.FieldB != nil {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", this.FieldB, that1.FieldB)
}
if this.FieldC != nil && that1.FieldC != nil {
if *this.FieldC != *that1.FieldC {
return fmt.Errorf("FieldC this(%v) Not Equal that(%v)", *this.FieldC, *that1.FieldC)
}
} else if this.FieldC != nil {
return fmt.Errorf("this.FieldC == nil && that.FieldC != nil")
} else if that1.FieldC != nil {
return fmt.Errorf("FieldC this(%v) Not Equal that(%v)", this.FieldC, that1.FieldC)
}
if this.FieldD != nil && that1.FieldD != nil {
if *this.FieldD != *that1.FieldD {
return fmt.Errorf("FieldD this(%v) Not Equal that(%v)", *this.FieldD, *that1.FieldD)
}
} else if this.FieldD != nil {
return fmt.Errorf("this.FieldD == nil && that.FieldD != nil")
} else if that1.FieldD != nil {
return fmt.Errorf("FieldD this(%v) Not Equal that(%v)", this.FieldD, that1.FieldD)
}
if this.FieldE != nil && that1.FieldE != nil {
if *this.FieldE != *that1.FieldE {
return fmt.Errorf("FieldE this(%v) Not Equal that(%v)", *this.FieldE, *that1.FieldE)
}
} else if this.FieldE != nil {
return fmt.Errorf("this.FieldE == nil && that.FieldE != nil")
} else if that1.FieldE != nil {
return fmt.Errorf("FieldE this(%v) Not Equal that(%v)", this.FieldE, that1.FieldE)
}
if this.FieldF != nil && that1.FieldF != nil {
if *this.FieldF != *that1.FieldF {
return fmt.Errorf("FieldF this(%v) Not Equal that(%v)", *this.FieldF, *that1.FieldF)
}
} else if this.FieldF != nil {
return fmt.Errorf("this.FieldF == nil && that.FieldF != nil")
} else if that1.FieldF != nil {
return fmt.Errorf("FieldF this(%v) Not Equal that(%v)", this.FieldF, that1.FieldF)
}
if this.FieldG != nil && that1.FieldG != nil {
if *this.FieldG != *that1.FieldG {
return fmt.Errorf("FieldG this(%v) Not Equal that(%v)", *this.FieldG, *that1.FieldG)
}
} else if this.FieldG != nil {
return fmt.Errorf("this.FieldG == nil && that.FieldG != nil")
} else if that1.FieldG != nil {
return fmt.Errorf("FieldG this(%v) Not Equal that(%v)", this.FieldG, that1.FieldG)
}
if this.FieldH != nil && that1.FieldH != nil {
if *this.FieldH != *that1.FieldH {
return fmt.Errorf("FieldH this(%v) Not Equal that(%v)", *this.FieldH, *that1.FieldH)
}
} else if this.FieldH != nil {
return fmt.Errorf("this.FieldH == nil && that.FieldH != nil")
} else if that1.FieldH != nil {
return fmt.Errorf("FieldH this(%v) Not Equal that(%v)", this.FieldH, that1.FieldH)
}
if this.FieldI != nil && that1.FieldI != nil {
if *this.FieldI != *that1.FieldI {
return fmt.Errorf("FieldI this(%v) Not Equal that(%v)", *this.FieldI, *that1.FieldI)
}
} else if this.FieldI != nil {
return fmt.Errorf("this.FieldI == nil && that.FieldI != nil")
} else if that1.FieldI != nil {
return fmt.Errorf("FieldI this(%v) Not Equal that(%v)", this.FieldI, that1.FieldI)
}
if this.FieldJ != nil && that1.FieldJ != nil {
if *this.FieldJ != *that1.FieldJ {
return fmt.Errorf("FieldJ this(%v) Not Equal that(%v)", *this.FieldJ, *that1.FieldJ)
}
} else if this.FieldJ != nil {
return fmt.Errorf("this.FieldJ == nil && that.FieldJ != nil")
} else if that1.FieldJ != nil {
return fmt.Errorf("FieldJ this(%v) Not Equal that(%v)", this.FieldJ, that1.FieldJ)
}
if this.FieldK != nil && that1.FieldK != nil {
if *this.FieldK != *that1.FieldK {
return fmt.Errorf("FieldK this(%v) Not Equal that(%v)", *this.FieldK, *that1.FieldK)
}
} else if this.FieldK != nil {
return fmt.Errorf("this.FieldK == nil && that.FieldK != nil")
} else if that1.FieldK != nil {
return fmt.Errorf("FieldK this(%v) Not Equal that(%v)", this.FieldK, that1.FieldK)
}
if this.FielL != nil && that1.FielL != nil {
if *this.FielL != *that1.FielL {
return fmt.Errorf("FielL this(%v) Not Equal that(%v)", *this.FielL, *that1.FielL)
}
} else if this.FielL != nil {
return fmt.Errorf("this.FielL == nil && that.FielL != nil")
} else if that1.FielL != nil {
return fmt.Errorf("FielL this(%v) Not Equal that(%v)", this.FielL, that1.FielL)
}
if this.FieldM != nil && that1.FieldM != nil {
if *this.FieldM != *that1.FieldM {
return fmt.Errorf("FieldM this(%v) Not Equal that(%v)", *this.FieldM, *that1.FieldM)
}
} else if this.FieldM != nil {
return fmt.Errorf("this.FieldM == nil && that.FieldM != nil")
} else if that1.FieldM != nil {
return fmt.Errorf("FieldM this(%v) Not Equal that(%v)", this.FieldM, that1.FieldM)
}
if this.FieldN != nil && that1.FieldN != nil {
if *this.FieldN != *that1.FieldN {
return fmt.Errorf("FieldN this(%v) Not Equal that(%v)", *this.FieldN, *that1.FieldN)
}
} else if this.FieldN != nil {
return fmt.Errorf("this.FieldN == nil && that.FieldN != nil")
} else if that1.FieldN != nil {
return fmt.Errorf("FieldN this(%v) Not Equal that(%v)", this.FieldN, that1.FieldN)
}
if !bytes.Equal(this.FieldO, that1.FieldO) {
return fmt.Errorf("FieldO this(%v) Not Equal that(%v)", this.FieldO, that1.FieldO)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomNameNinOptNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomNameNinOptNative)
if !ok {
that2, ok := that.(CustomNameNinOptNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
return false
}
} else if this.FieldA != nil {
return false
} else if that1.FieldA != nil {
return false
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
return false
}
} else if this.FieldB != nil {
return false
} else if that1.FieldB != nil {
return false
}
if this.FieldC != nil && that1.FieldC != nil {
if *this.FieldC != *that1.FieldC {
return false
}
} else if this.FieldC != nil {
return false
} else if that1.FieldC != nil {
return false
}
if this.FieldD != nil && that1.FieldD != nil {
if *this.FieldD != *that1.FieldD {
return false
}
} else if this.FieldD != nil {
return false
} else if that1.FieldD != nil {
return false
}
if this.FieldE != nil && that1.FieldE != nil {
if *this.FieldE != *that1.FieldE {
return false
}
} else if this.FieldE != nil {
return false
} else if that1.FieldE != nil {
return false
}
if this.FieldF != nil && that1.FieldF != nil {
if *this.FieldF != *that1.FieldF {
return false
}
} else if this.FieldF != nil {
return false
} else if that1.FieldF != nil {
return false
}
if this.FieldG != nil && that1.FieldG != nil {
if *this.FieldG != *that1.FieldG {
return false
}
} else if this.FieldG != nil {
return false
} else if that1.FieldG != nil {
return false
}
if this.FieldH != nil && that1.FieldH != nil {
if *this.FieldH != *that1.FieldH {
return false
}
} else if this.FieldH != nil {
return false
} else if that1.FieldH != nil {
return false
}
if this.FieldI != nil && that1.FieldI != nil {
if *this.FieldI != *that1.FieldI {
return false
}
} else if this.FieldI != nil {
return false
} else if that1.FieldI != nil {
return false
}
if this.FieldJ != nil && that1.FieldJ != nil {
if *this.FieldJ != *that1.FieldJ {
return false
}
} else if this.FieldJ != nil {
return false
} else if that1.FieldJ != nil {
return false
}
if this.FieldK != nil && that1.FieldK != nil {
if *this.FieldK != *that1.FieldK {
return false
}
} else if this.FieldK != nil {
return false
} else if that1.FieldK != nil {
return false
}
if this.FielL != nil && that1.FielL != nil {
if *this.FielL != *that1.FielL {
return false
}
} else if this.FielL != nil {
return false
} else if that1.FielL != nil {
return false
}
if this.FieldM != nil && that1.FieldM != nil {
if *this.FieldM != *that1.FieldM {
return false
}
} else if this.FieldM != nil {
return false
} else if that1.FieldM != nil {
return false
}
if this.FieldN != nil && that1.FieldN != nil {
if *this.FieldN != *that1.FieldN {
return false
}
} else if this.FieldN != nil {
return false
} else if that1.FieldN != nil {
return false
}
if !bytes.Equal(this.FieldO, that1.FieldO) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomNameNinRepNative) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomNameNinRepNative)
if !ok {
that2, ok := that.(CustomNameNinRepNative)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomNameNinRepNative")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomNameNinRepNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomNameNinRepNative but is not nil && this == nil")
}
if len(this.FieldA) != len(that1.FieldA) {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", len(this.FieldA), len(that1.FieldA))
}
for i := range this.FieldA {
if this.FieldA[i] != that1.FieldA[i] {
return fmt.Errorf("FieldA this[%v](%v) Not Equal that[%v](%v)", i, this.FieldA[i], i, that1.FieldA[i])
}
}
if len(this.FieldB) != len(that1.FieldB) {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", len(this.FieldB), len(that1.FieldB))
}
for i := range this.FieldB {
if this.FieldB[i] != that1.FieldB[i] {
return fmt.Errorf("FieldB this[%v](%v) Not Equal that[%v](%v)", i, this.FieldB[i], i, that1.FieldB[i])
}
}
if len(this.FieldC) != len(that1.FieldC) {
return fmt.Errorf("FieldC this(%v) Not Equal that(%v)", len(this.FieldC), len(that1.FieldC))
}
for i := range this.FieldC {
if this.FieldC[i] != that1.FieldC[i] {
return fmt.Errorf("FieldC this[%v](%v) Not Equal that[%v](%v)", i, this.FieldC[i], i, that1.FieldC[i])
}
}
if len(this.FieldD) != len(that1.FieldD) {
return fmt.Errorf("FieldD this(%v) Not Equal that(%v)", len(this.FieldD), len(that1.FieldD))
}
for i := range this.FieldD {
if this.FieldD[i] != that1.FieldD[i] {
return fmt.Errorf("FieldD this[%v](%v) Not Equal that[%v](%v)", i, this.FieldD[i], i, that1.FieldD[i])
}
}
if len(this.FieldE) != len(that1.FieldE) {
return fmt.Errorf("FieldE this(%v) Not Equal that(%v)", len(this.FieldE), len(that1.FieldE))
}
for i := range this.FieldE {
if this.FieldE[i] != that1.FieldE[i] {
return fmt.Errorf("FieldE this[%v](%v) Not Equal that[%v](%v)", i, this.FieldE[i], i, that1.FieldE[i])
}
}
if len(this.FieldF) != len(that1.FieldF) {
return fmt.Errorf("FieldF this(%v) Not Equal that(%v)", len(this.FieldF), len(that1.FieldF))
}
for i := range this.FieldF {
if this.FieldF[i] != that1.FieldF[i] {
return fmt.Errorf("FieldF this[%v](%v) Not Equal that[%v](%v)", i, this.FieldF[i], i, that1.FieldF[i])
}
}
if len(this.FieldG) != len(that1.FieldG) {
return fmt.Errorf("FieldG this(%v) Not Equal that(%v)", len(this.FieldG), len(that1.FieldG))
}
for i := range this.FieldG {
if this.FieldG[i] != that1.FieldG[i] {
return fmt.Errorf("FieldG this[%v](%v) Not Equal that[%v](%v)", i, this.FieldG[i], i, that1.FieldG[i])
}
}
if len(this.FieldH) != len(that1.FieldH) {
return fmt.Errorf("FieldH this(%v) Not Equal that(%v)", len(this.FieldH), len(that1.FieldH))
}
for i := range this.FieldH {
if this.FieldH[i] != that1.FieldH[i] {
return fmt.Errorf("FieldH this[%v](%v) Not Equal that[%v](%v)", i, this.FieldH[i], i, that1.FieldH[i])
}
}
if len(this.FieldI) != len(that1.FieldI) {
return fmt.Errorf("FieldI this(%v) Not Equal that(%v)", len(this.FieldI), len(that1.FieldI))
}
for i := range this.FieldI {
if this.FieldI[i] != that1.FieldI[i] {
return fmt.Errorf("FieldI this[%v](%v) Not Equal that[%v](%v)", i, this.FieldI[i], i, that1.FieldI[i])
}
}
if len(this.FieldJ) != len(that1.FieldJ) {
return fmt.Errorf("FieldJ this(%v) Not Equal that(%v)", len(this.FieldJ), len(that1.FieldJ))
}
for i := range this.FieldJ {
if this.FieldJ[i] != that1.FieldJ[i] {
return fmt.Errorf("FieldJ this[%v](%v) Not Equal that[%v](%v)", i, this.FieldJ[i], i, that1.FieldJ[i])
}
}
if len(this.FieldK) != len(that1.FieldK) {
return fmt.Errorf("FieldK this(%v) Not Equal that(%v)", len(this.FieldK), len(that1.FieldK))
}
for i := range this.FieldK {
if this.FieldK[i] != that1.FieldK[i] {
return fmt.Errorf("FieldK this[%v](%v) Not Equal that[%v](%v)", i, this.FieldK[i], i, that1.FieldK[i])
}
}
if len(this.FieldL) != len(that1.FieldL) {
return fmt.Errorf("FieldL this(%v) Not Equal that(%v)", len(this.FieldL), len(that1.FieldL))
}
for i := range this.FieldL {
if this.FieldL[i] != that1.FieldL[i] {
return fmt.Errorf("FieldL this[%v](%v) Not Equal that[%v](%v)", i, this.FieldL[i], i, that1.FieldL[i])
}
}
if len(this.FieldM) != len(that1.FieldM) {
return fmt.Errorf("FieldM this(%v) Not Equal that(%v)", len(this.FieldM), len(that1.FieldM))
}
for i := range this.FieldM {
if this.FieldM[i] != that1.FieldM[i] {
return fmt.Errorf("FieldM this[%v](%v) Not Equal that[%v](%v)", i, this.FieldM[i], i, that1.FieldM[i])
}
}
if len(this.FieldN) != len(that1.FieldN) {
return fmt.Errorf("FieldN this(%v) Not Equal that(%v)", len(this.FieldN), len(that1.FieldN))
}
for i := range this.FieldN {
if this.FieldN[i] != that1.FieldN[i] {
return fmt.Errorf("FieldN this[%v](%v) Not Equal that[%v](%v)", i, this.FieldN[i], i, that1.FieldN[i])
}
}
if len(this.FieldO) != len(that1.FieldO) {
return fmt.Errorf("FieldO this(%v) Not Equal that(%v)", len(this.FieldO), len(that1.FieldO))
}
for i := range this.FieldO {
if !bytes.Equal(this.FieldO[i], that1.FieldO[i]) {
return fmt.Errorf("FieldO this[%v](%v) Not Equal that[%v](%v)", i, this.FieldO[i], i, that1.FieldO[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomNameNinRepNative) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomNameNinRepNative)
if !ok {
that2, ok := that.(CustomNameNinRepNative)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.FieldA) != len(that1.FieldA) {
return false
}
for i := range this.FieldA {
if this.FieldA[i] != that1.FieldA[i] {
return false
}
}
if len(this.FieldB) != len(that1.FieldB) {
return false
}
for i := range this.FieldB {
if this.FieldB[i] != that1.FieldB[i] {
return false
}
}
if len(this.FieldC) != len(that1.FieldC) {
return false
}
for i := range this.FieldC {
if this.FieldC[i] != that1.FieldC[i] {
return false
}
}
if len(this.FieldD) != len(that1.FieldD) {
return false
}
for i := range this.FieldD {
if this.FieldD[i] != that1.FieldD[i] {
return false
}
}
if len(this.FieldE) != len(that1.FieldE) {
return false
}
for i := range this.FieldE {
if this.FieldE[i] != that1.FieldE[i] {
return false
}
}
if len(this.FieldF) != len(that1.FieldF) {
return false
}
for i := range this.FieldF {
if this.FieldF[i] != that1.FieldF[i] {
return false
}
}
if len(this.FieldG) != len(that1.FieldG) {
return false
}
for i := range this.FieldG {
if this.FieldG[i] != that1.FieldG[i] {
return false
}
}
if len(this.FieldH) != len(that1.FieldH) {
return false
}
for i := range this.FieldH {
if this.FieldH[i] != that1.FieldH[i] {
return false
}
}
if len(this.FieldI) != len(that1.FieldI) {
return false
}
for i := range this.FieldI {
if this.FieldI[i] != that1.FieldI[i] {
return false
}
}
if len(this.FieldJ) != len(that1.FieldJ) {
return false
}
for i := range this.FieldJ {
if this.FieldJ[i] != that1.FieldJ[i] {
return false
}
}
if len(this.FieldK) != len(that1.FieldK) {
return false
}
for i := range this.FieldK {
if this.FieldK[i] != that1.FieldK[i] {
return false
}
}
if len(this.FieldL) != len(that1.FieldL) {
return false
}
for i := range this.FieldL {
if this.FieldL[i] != that1.FieldL[i] {
return false
}
}
if len(this.FieldM) != len(that1.FieldM) {
return false
}
for i := range this.FieldM {
if this.FieldM[i] != that1.FieldM[i] {
return false
}
}
if len(this.FieldN) != len(that1.FieldN) {
return false
}
for i := range this.FieldN {
if this.FieldN[i] != that1.FieldN[i] {
return false
}
}
if len(this.FieldO) != len(that1.FieldO) {
return false
}
for i := range this.FieldO {
if !bytes.Equal(this.FieldO[i], that1.FieldO[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomNameNinStruct) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomNameNinStruct)
if !ok {
that2, ok := that.(CustomNameNinStruct)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomNameNinStruct")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomNameNinStruct but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomNameNinStruct but is not nil && this == nil")
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", *this.FieldA, *that1.FieldA)
}
} else if this.FieldA != nil {
return fmt.Errorf("this.FieldA == nil && that.FieldA != nil")
} else if that1.FieldA != nil {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", this.FieldA, that1.FieldA)
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", *this.FieldB, *that1.FieldB)
}
} else if this.FieldB != nil {
return fmt.Errorf("this.FieldB == nil && that.FieldB != nil")
} else if that1.FieldB != nil {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", this.FieldB, that1.FieldB)
}
if !this.FieldC.Equal(that1.FieldC) {
return fmt.Errorf("FieldC this(%v) Not Equal that(%v)", this.FieldC, that1.FieldC)
}
if len(this.FieldD) != len(that1.FieldD) {
return fmt.Errorf("FieldD this(%v) Not Equal that(%v)", len(this.FieldD), len(that1.FieldD))
}
for i := range this.FieldD {
if !this.FieldD[i].Equal(that1.FieldD[i]) {
return fmt.Errorf("FieldD this[%v](%v) Not Equal that[%v](%v)", i, this.FieldD[i], i, that1.FieldD[i])
}
}
if this.FieldE != nil && that1.FieldE != nil {
if *this.FieldE != *that1.FieldE {
return fmt.Errorf("FieldE this(%v) Not Equal that(%v)", *this.FieldE, *that1.FieldE)
}
} else if this.FieldE != nil {
return fmt.Errorf("this.FieldE == nil && that.FieldE != nil")
} else if that1.FieldE != nil {
return fmt.Errorf("FieldE this(%v) Not Equal that(%v)", this.FieldE, that1.FieldE)
}
if this.FieldF != nil && that1.FieldF != nil {
if *this.FieldF != *that1.FieldF {
return fmt.Errorf("FieldF this(%v) Not Equal that(%v)", *this.FieldF, *that1.FieldF)
}
} else if this.FieldF != nil {
return fmt.Errorf("this.FieldF == nil && that.FieldF != nil")
} else if that1.FieldF != nil {
return fmt.Errorf("FieldF this(%v) Not Equal that(%v)", this.FieldF, that1.FieldF)
}
if !this.FieldG.Equal(that1.FieldG) {
return fmt.Errorf("FieldG this(%v) Not Equal that(%v)", this.FieldG, that1.FieldG)
}
if this.FieldH != nil && that1.FieldH != nil {
if *this.FieldH != *that1.FieldH {
return fmt.Errorf("FieldH this(%v) Not Equal that(%v)", *this.FieldH, *that1.FieldH)
}
} else if this.FieldH != nil {
return fmt.Errorf("this.FieldH == nil && that.FieldH != nil")
} else if that1.FieldH != nil {
return fmt.Errorf("FieldH this(%v) Not Equal that(%v)", this.FieldH, that1.FieldH)
}
if this.FieldI != nil && that1.FieldI != nil {
if *this.FieldI != *that1.FieldI {
return fmt.Errorf("FieldI this(%v) Not Equal that(%v)", *this.FieldI, *that1.FieldI)
}
} else if this.FieldI != nil {
return fmt.Errorf("this.FieldI == nil && that.FieldI != nil")
} else if that1.FieldI != nil {
return fmt.Errorf("FieldI this(%v) Not Equal that(%v)", this.FieldI, that1.FieldI)
}
if !bytes.Equal(this.FieldJ, that1.FieldJ) {
return fmt.Errorf("FieldJ this(%v) Not Equal that(%v)", this.FieldJ, that1.FieldJ)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomNameNinStruct) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomNameNinStruct)
if !ok {
that2, ok := that.(CustomNameNinStruct)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
return false
}
} else if this.FieldA != nil {
return false
} else if that1.FieldA != nil {
return false
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
return false
}
} else if this.FieldB != nil {
return false
} else if that1.FieldB != nil {
return false
}
if !this.FieldC.Equal(that1.FieldC) {
return false
}
if len(this.FieldD) != len(that1.FieldD) {
return false
}
for i := range this.FieldD {
if !this.FieldD[i].Equal(that1.FieldD[i]) {
return false
}
}
if this.FieldE != nil && that1.FieldE != nil {
if *this.FieldE != *that1.FieldE {
return false
}
} else if this.FieldE != nil {
return false
} else if that1.FieldE != nil {
return false
}
if this.FieldF != nil && that1.FieldF != nil {
if *this.FieldF != *that1.FieldF {
return false
}
} else if this.FieldF != nil {
return false
} else if that1.FieldF != nil {
return false
}
if !this.FieldG.Equal(that1.FieldG) {
return false
}
if this.FieldH != nil && that1.FieldH != nil {
if *this.FieldH != *that1.FieldH {
return false
}
} else if this.FieldH != nil {
return false
} else if that1.FieldH != nil {
return false
}
if this.FieldI != nil && that1.FieldI != nil {
if *this.FieldI != *that1.FieldI {
return false
}
} else if this.FieldI != nil {
return false
} else if that1.FieldI != nil {
return false
}
if !bytes.Equal(this.FieldJ, that1.FieldJ) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomNameCustomType) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomNameCustomType)
if !ok {
that2, ok := that.(CustomNameCustomType)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomNameCustomType")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomNameCustomType but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomNameCustomType but is not nil && this == nil")
}
if that1.FieldA == nil {
if this.FieldA != nil {
return fmt.Errorf("this.FieldA != nil && that1.FieldA == nil")
}
} else if !this.FieldA.Equal(*that1.FieldA) {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", this.FieldA, that1.FieldA)
}
if that1.FieldB == nil {
if this.FieldB != nil {
return fmt.Errorf("this.FieldB != nil && that1.FieldB == nil")
}
} else if !this.FieldB.Equal(*that1.FieldB) {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", this.FieldB, that1.FieldB)
}
if len(this.FieldC) != len(that1.FieldC) {
return fmt.Errorf("FieldC this(%v) Not Equal that(%v)", len(this.FieldC), len(that1.FieldC))
}
for i := range this.FieldC {
if !this.FieldC[i].Equal(that1.FieldC[i]) {
return fmt.Errorf("FieldC this[%v](%v) Not Equal that[%v](%v)", i, this.FieldC[i], i, that1.FieldC[i])
}
}
if len(this.FieldD) != len(that1.FieldD) {
return fmt.Errorf("FieldD this(%v) Not Equal that(%v)", len(this.FieldD), len(that1.FieldD))
}
for i := range this.FieldD {
if !this.FieldD[i].Equal(that1.FieldD[i]) {
return fmt.Errorf("FieldD this[%v](%v) Not Equal that[%v](%v)", i, this.FieldD[i], i, that1.FieldD[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomNameCustomType) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomNameCustomType)
if !ok {
that2, ok := that.(CustomNameCustomType)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if that1.FieldA == nil {
if this.FieldA != nil {
return false
}
} else if !this.FieldA.Equal(*that1.FieldA) {
return false
}
if that1.FieldB == nil {
if this.FieldB != nil {
return false
}
} else if !this.FieldB.Equal(*that1.FieldB) {
return false
}
if len(this.FieldC) != len(that1.FieldC) {
return false
}
for i := range this.FieldC {
if !this.FieldC[i].Equal(that1.FieldC[i]) {
return false
}
}
if len(this.FieldD) != len(that1.FieldD) {
return false
}
for i := range this.FieldD {
if !this.FieldD[i].Equal(that1.FieldD[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomNameNinEmbeddedStructUnion) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomNameNinEmbeddedStructUnion)
if !ok {
that2, ok := that.(CustomNameNinEmbeddedStructUnion)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomNameNinEmbeddedStructUnion")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomNameNinEmbeddedStructUnion but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomNameNinEmbeddedStructUnion but is not nil && this == nil")
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return fmt.Errorf("NidOptNative this(%v) Not Equal that(%v)", this.NidOptNative, that1.NidOptNative)
}
if !this.FieldA.Equal(that1.FieldA) {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", this.FieldA, that1.FieldA)
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", *this.FieldB, *that1.FieldB)
}
} else if this.FieldB != nil {
return fmt.Errorf("this.FieldB == nil && that.FieldB != nil")
} else if that1.FieldB != nil {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", this.FieldB, that1.FieldB)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomNameNinEmbeddedStructUnion) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomNameNinEmbeddedStructUnion)
if !ok {
that2, ok := that.(CustomNameNinEmbeddedStructUnion)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.NidOptNative.Equal(that1.NidOptNative) {
return false
}
if !this.FieldA.Equal(that1.FieldA) {
return false
}
if this.FieldB != nil && that1.FieldB != nil {
if *this.FieldB != *that1.FieldB {
return false
}
} else if this.FieldB != nil {
return false
} else if that1.FieldB != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *CustomNameEnum) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*CustomNameEnum)
if !ok {
that2, ok := that.(CustomNameEnum)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *CustomNameEnum")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *CustomNameEnum but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *CustomNameEnum but is not nil && this == nil")
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", *this.FieldA, *that1.FieldA)
}
} else if this.FieldA != nil {
return fmt.Errorf("this.FieldA == nil && that.FieldA != nil")
} else if that1.FieldA != nil {
return fmt.Errorf("FieldA this(%v) Not Equal that(%v)", this.FieldA, that1.FieldA)
}
if len(this.FieldB) != len(that1.FieldB) {
return fmt.Errorf("FieldB this(%v) Not Equal that(%v)", len(this.FieldB), len(that1.FieldB))
}
for i := range this.FieldB {
if this.FieldB[i] != that1.FieldB[i] {
return fmt.Errorf("FieldB this[%v](%v) Not Equal that[%v](%v)", i, this.FieldB[i], i, that1.FieldB[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *CustomNameEnum) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*CustomNameEnum)
if !ok {
that2, ok := that.(CustomNameEnum)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.FieldA != nil && that1.FieldA != nil {
if *this.FieldA != *that1.FieldA {
return false
}
} else if this.FieldA != nil {
return false
} else if that1.FieldA != nil {
return false
}
if len(this.FieldB) != len(that1.FieldB) {
return false
}
for i := range this.FieldB {
if this.FieldB[i] != that1.FieldB[i] {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NoExtensionsMap) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NoExtensionsMap)
if !ok {
that2, ok := that.(NoExtensionsMap)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NoExtensionsMap")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NoExtensionsMap but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NoExtensionsMap but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if !bytes.Equal(this.XXX_extensions, that1.XXX_extensions) {
return fmt.Errorf("XXX_extensions this(%v) Not Equal that(%v)", this.XXX_extensions, that1.XXX_extensions)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NoExtensionsMap) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NoExtensionsMap)
if !ok {
that2, ok := that.(NoExtensionsMap)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
if !bytes.Equal(this.XXX_extensions, that1.XXX_extensions) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Unrecognized) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Unrecognized)
if !ok {
that2, ok := that.(Unrecognized)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Unrecognized")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Unrecognized but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Unrecognized but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
return nil
}
func (this *Unrecognized) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Unrecognized)
if !ok {
that2, ok := that.(Unrecognized)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
return true
}
func (this *UnrecognizedWithInner) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*UnrecognizedWithInner)
if !ok {
that2, ok := that.(UnrecognizedWithInner)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *UnrecognizedWithInner")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *UnrecognizedWithInner but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *UnrecognizedWithInner but is not nil && this == nil")
}
if len(this.Embedded) != len(that1.Embedded) {
return fmt.Errorf("Embedded this(%v) Not Equal that(%v)", len(this.Embedded), len(that1.Embedded))
}
for i := range this.Embedded {
if !this.Embedded[i].Equal(that1.Embedded[i]) {
return fmt.Errorf("Embedded this[%v](%v) Not Equal that[%v](%v)", i, this.Embedded[i], i, that1.Embedded[i])
}
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *UnrecognizedWithInner) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*UnrecognizedWithInner)
if !ok {
that2, ok := that.(UnrecognizedWithInner)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Embedded) != len(that1.Embedded) {
return false
}
for i := range this.Embedded {
if !this.Embedded[i].Equal(that1.Embedded[i]) {
return false
}
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *UnrecognizedWithInner_Inner) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*UnrecognizedWithInner_Inner)
if !ok {
that2, ok := that.(UnrecognizedWithInner_Inner)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *UnrecognizedWithInner_Inner")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *UnrecognizedWithInner_Inner but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *UnrecognizedWithInner_Inner but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
return nil
}
func (this *UnrecognizedWithInner_Inner) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*UnrecognizedWithInner_Inner)
if !ok {
that2, ok := that.(UnrecognizedWithInner_Inner)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
return true
}
func (this *UnrecognizedWithEmbed) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*UnrecognizedWithEmbed)
if !ok {
that2, ok := that.(UnrecognizedWithEmbed)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *UnrecognizedWithEmbed")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *UnrecognizedWithEmbed but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *UnrecognizedWithEmbed but is not nil && this == nil")
}
if !this.UnrecognizedWithEmbed_Embedded.Equal(&that1.UnrecognizedWithEmbed_Embedded) {
return fmt.Errorf("UnrecognizedWithEmbed_Embedded this(%v) Not Equal that(%v)", this.UnrecognizedWithEmbed_Embedded, that1.UnrecognizedWithEmbed_Embedded)
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *UnrecognizedWithEmbed) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*UnrecognizedWithEmbed)
if !ok {
that2, ok := that.(UnrecognizedWithEmbed)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.UnrecognizedWithEmbed_Embedded.Equal(&that1.UnrecognizedWithEmbed_Embedded) {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *UnrecognizedWithEmbed_Embedded) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*UnrecognizedWithEmbed_Embedded)
if !ok {
that2, ok := that.(UnrecognizedWithEmbed_Embedded)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *UnrecognizedWithEmbed_Embedded")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *UnrecognizedWithEmbed_Embedded but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *UnrecognizedWithEmbed_Embedded but is not nil && this == nil")
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", *this.Field1, *that1.Field1)
}
} else if this.Field1 != nil {
return fmt.Errorf("this.Field1 == nil && that.Field1 != nil")
} else if that1.Field1 != nil {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
return nil
}
func (this *UnrecognizedWithEmbed_Embedded) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*UnrecognizedWithEmbed_Embedded)
if !ok {
that2, ok := that.(UnrecognizedWithEmbed_Embedded)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field1 != nil && that1.Field1 != nil {
if *this.Field1 != *that1.Field1 {
return false
}
} else if this.Field1 != nil {
return false
} else if that1.Field1 != nil {
return false
}
return true
}
func (this *Node) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Node)
if !ok {
that2, ok := that.(Node)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Node")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Node but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Node but is not nil && this == nil")
}
if this.Label != nil && that1.Label != nil {
if *this.Label != *that1.Label {
return fmt.Errorf("Label this(%v) Not Equal that(%v)", *this.Label, *that1.Label)
}
} else if this.Label != nil {
return fmt.Errorf("this.Label == nil && that.Label != nil")
} else if that1.Label != nil {
return fmt.Errorf("Label this(%v) Not Equal that(%v)", this.Label, that1.Label)
}
if len(this.Children) != len(that1.Children) {
return fmt.Errorf("Children this(%v) Not Equal that(%v)", len(this.Children), len(that1.Children))
}
for i := range this.Children {
if !this.Children[i].Equal(that1.Children[i]) {
return fmt.Errorf("Children this[%v](%v) Not Equal that[%v](%v)", i, this.Children[i], i, that1.Children[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *Node) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Node)
if !ok {
that2, ok := that.(Node)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Label != nil && that1.Label != nil {
if *this.Label != *that1.Label {
return false
}
} else if this.Label != nil {
return false
} else if that1.Label != nil {
return false
}
if len(this.Children) != len(that1.Children) {
return false
}
for i := range this.Children {
if !this.Children[i].Equal(that1.Children[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NonByteCustomType) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NonByteCustomType)
if !ok {
that2, ok := that.(NonByteCustomType)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NonByteCustomType")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NonByteCustomType but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NonByteCustomType but is not nil && this == nil")
}
if that1.Field1 == nil {
if this.Field1 != nil {
return fmt.Errorf("this.Field1 != nil && that1.Field1 == nil")
}
} else if !this.Field1.Equal(*that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NonByteCustomType) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NonByteCustomType)
if !ok {
that2, ok := that.(NonByteCustomType)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if that1.Field1 == nil {
if this.Field1 != nil {
return false
}
} else if !this.Field1.Equal(*that1.Field1) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidOptNonByteCustomType) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidOptNonByteCustomType)
if !ok {
that2, ok := that.(NidOptNonByteCustomType)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidOptNonByteCustomType")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidOptNonByteCustomType but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidOptNonByteCustomType but is not nil && this == nil")
}
if !this.Field1.Equal(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidOptNonByteCustomType) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidOptNonByteCustomType)
if !ok {
that2, ok := that.(NidOptNonByteCustomType)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Field1.Equal(that1.Field1) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinOptNonByteCustomType) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinOptNonByteCustomType)
if !ok {
that2, ok := that.(NinOptNonByteCustomType)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinOptNonByteCustomType")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinOptNonByteCustomType but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinOptNonByteCustomType but is not nil && this == nil")
}
if that1.Field1 == nil {
if this.Field1 != nil {
return fmt.Errorf("this.Field1 != nil && that1.Field1 == nil")
}
} else if !this.Field1.Equal(*that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", this.Field1, that1.Field1)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinOptNonByteCustomType) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinOptNonByteCustomType)
if !ok {
that2, ok := that.(NinOptNonByteCustomType)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if that1.Field1 == nil {
if this.Field1 != nil {
return false
}
} else if !this.Field1.Equal(*that1.Field1) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NidRepNonByteCustomType) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NidRepNonByteCustomType)
if !ok {
that2, ok := that.(NidRepNonByteCustomType)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NidRepNonByteCustomType")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NidRepNonByteCustomType but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidRepNonByteCustomType but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if !this.Field1[i].Equal(that1.Field1[i]) {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NidRepNonByteCustomType) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NidRepNonByteCustomType)
if !ok {
that2, ok := that.(NidRepNonByteCustomType)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if !this.Field1[i].Equal(that1.Field1[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *NinRepNonByteCustomType) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*NinRepNonByteCustomType)
if !ok {
that2, ok := that.(NinRepNonByteCustomType)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *NinRepNonByteCustomType")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *NinRepNonByteCustomType but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NinRepNonByteCustomType but is not nil && this == nil")
}
if len(this.Field1) != len(that1.Field1) {
return fmt.Errorf("Field1 this(%v) Not Equal that(%v)", len(this.Field1), len(that1.Field1))
}
for i := range this.Field1 {
if !this.Field1[i].Equal(that1.Field1[i]) {
return fmt.Errorf("Field1 this[%v](%v) Not Equal that[%v](%v)", i, this.Field1[i], i, that1.Field1[i])
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *NinRepNonByteCustomType) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*NinRepNonByteCustomType)
if !ok {
that2, ok := that.(NinRepNonByteCustomType)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if len(this.Field1) != len(that1.Field1) {
return false
}
for i := range this.Field1 {
if !this.Field1[i].Equal(that1.Field1[i]) {
return false
}
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *ProtoType) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*ProtoType)
if !ok {
that2, ok := that.(ProtoType)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *ProtoType")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *ProtoType but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *ProtoType but is not nil && this == nil")
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", *this.Field2, *that1.Field2)
}
} else if this.Field2 != nil {
return fmt.Errorf("this.Field2 == nil && that.Field2 != nil")
} else if that1.Field2 != nil {
return fmt.Errorf("Field2 this(%v) Not Equal that(%v)", this.Field2, that1.Field2)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *ProtoType) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*ProtoType)
if !ok {
that2, ok := that.(ProtoType)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Field2 != nil && that1.Field2 != nil {
if *this.Field2 != *that1.Field2 {
return false
}
} else if this.Field2 != nil {
return false
} else if that1.Field2 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
type NidOptNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() float64
GetField2() float32
GetField3() int32
GetField4() int64
GetField5() uint32
GetField6() uint64
GetField7() int32
GetField8() int64
GetField9() uint32
GetField10() int32
GetField11() uint64
GetField12() int64
GetField13() bool
GetField14() string
GetField15() []byte
}
func (this *NidOptNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidOptNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidOptNativeFromFace(this)
}
func (this *NidOptNative) GetField1() float64 {
return this.Field1
}
func (this *NidOptNative) GetField2() float32 {
return this.Field2
}
func (this *NidOptNative) GetField3() int32 {
return this.Field3
}
func (this *NidOptNative) GetField4() int64 {
return this.Field4
}
func (this *NidOptNative) GetField5() uint32 {
return this.Field5
}
func (this *NidOptNative) GetField6() uint64 {
return this.Field6
}
func (this *NidOptNative) GetField7() int32 {
return this.Field7
}
func (this *NidOptNative) GetField8() int64 {
return this.Field8
}
func (this *NidOptNative) GetField9() uint32 {
return this.Field9
}
func (this *NidOptNative) GetField10() int32 {
return this.Field10
}
func (this *NidOptNative) GetField11() uint64 {
return this.Field11
}
func (this *NidOptNative) GetField12() int64 {
return this.Field12
}
func (this *NidOptNative) GetField13() bool {
return this.Field13
}
func (this *NidOptNative) GetField14() string {
return this.Field14
}
func (this *NidOptNative) GetField15() []byte {
return this.Field15
}
func NewNidOptNativeFromFace(that NidOptNativeFace) *NidOptNative {
this := &NidOptNative{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field5 = that.GetField5()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field9 = that.GetField9()
this.Field10 = that.GetField10()
this.Field11 = that.GetField11()
this.Field12 = that.GetField12()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NinOptNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *float64
GetField2() *float32
GetField3() *int32
GetField4() *int64
GetField5() *uint32
GetField6() *uint64
GetField7() *int32
GetField8() *int64
GetField9() *uint32
GetField10() *int32
GetField11() *uint64
GetField12() *int64
GetField13() *bool
GetField14() *string
GetField15() []byte
}
func (this *NinOptNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinOptNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinOptNativeFromFace(this)
}
func (this *NinOptNative) GetField1() *float64 {
return this.Field1
}
func (this *NinOptNative) GetField2() *float32 {
return this.Field2
}
func (this *NinOptNative) GetField3() *int32 {
return this.Field3
}
func (this *NinOptNative) GetField4() *int64 {
return this.Field4
}
func (this *NinOptNative) GetField5() *uint32 {
return this.Field5
}
func (this *NinOptNative) GetField6() *uint64 {
return this.Field6
}
func (this *NinOptNative) GetField7() *int32 {
return this.Field7
}
func (this *NinOptNative) GetField8() *int64 {
return this.Field8
}
func (this *NinOptNative) GetField9() *uint32 {
return this.Field9
}
func (this *NinOptNative) GetField10() *int32 {
return this.Field10
}
func (this *NinOptNative) GetField11() *uint64 {
return this.Field11
}
func (this *NinOptNative) GetField12() *int64 {
return this.Field12
}
func (this *NinOptNative) GetField13() *bool {
return this.Field13
}
func (this *NinOptNative) GetField14() *string {
return this.Field14
}
func (this *NinOptNative) GetField15() []byte {
return this.Field15
}
func NewNinOptNativeFromFace(that NinOptNativeFace) *NinOptNative {
this := &NinOptNative{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field5 = that.GetField5()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field9 = that.GetField9()
this.Field10 = that.GetField10()
this.Field11 = that.GetField11()
this.Field12 = that.GetField12()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NidRepNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []float64
GetField2() []float32
GetField3() []int32
GetField4() []int64
GetField5() []uint32
GetField6() []uint64
GetField7() []int32
GetField8() []int64
GetField9() []uint32
GetField10() []int32
GetField11() []uint64
GetField12() []int64
GetField13() []bool
GetField14() []string
GetField15() [][]byte
}
func (this *NidRepNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidRepNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidRepNativeFromFace(this)
}
func (this *NidRepNative) GetField1() []float64 {
return this.Field1
}
func (this *NidRepNative) GetField2() []float32 {
return this.Field2
}
func (this *NidRepNative) GetField3() []int32 {
return this.Field3
}
func (this *NidRepNative) GetField4() []int64 {
return this.Field4
}
func (this *NidRepNative) GetField5() []uint32 {
return this.Field5
}
func (this *NidRepNative) GetField6() []uint64 {
return this.Field6
}
func (this *NidRepNative) GetField7() []int32 {
return this.Field7
}
func (this *NidRepNative) GetField8() []int64 {
return this.Field8
}
func (this *NidRepNative) GetField9() []uint32 {
return this.Field9
}
func (this *NidRepNative) GetField10() []int32 {
return this.Field10
}
func (this *NidRepNative) GetField11() []uint64 {
return this.Field11
}
func (this *NidRepNative) GetField12() []int64 {
return this.Field12
}
func (this *NidRepNative) GetField13() []bool {
return this.Field13
}
func (this *NidRepNative) GetField14() []string {
return this.Field14
}
func (this *NidRepNative) GetField15() [][]byte {
return this.Field15
}
func NewNidRepNativeFromFace(that NidRepNativeFace) *NidRepNative {
this := &NidRepNative{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field5 = that.GetField5()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field9 = that.GetField9()
this.Field10 = that.GetField10()
this.Field11 = that.GetField11()
this.Field12 = that.GetField12()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NinRepNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []float64
GetField2() []float32
GetField3() []int32
GetField4() []int64
GetField5() []uint32
GetField6() []uint64
GetField7() []int32
GetField8() []int64
GetField9() []uint32
GetField10() []int32
GetField11() []uint64
GetField12() []int64
GetField13() []bool
GetField14() []string
GetField15() [][]byte
}
func (this *NinRepNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinRepNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinRepNativeFromFace(this)
}
func (this *NinRepNative) GetField1() []float64 {
return this.Field1
}
func (this *NinRepNative) GetField2() []float32 {
return this.Field2
}
func (this *NinRepNative) GetField3() []int32 {
return this.Field3
}
func (this *NinRepNative) GetField4() []int64 {
return this.Field4
}
func (this *NinRepNative) GetField5() []uint32 {
return this.Field5
}
func (this *NinRepNative) GetField6() []uint64 {
return this.Field6
}
func (this *NinRepNative) GetField7() []int32 {
return this.Field7
}
func (this *NinRepNative) GetField8() []int64 {
return this.Field8
}
func (this *NinRepNative) GetField9() []uint32 {
return this.Field9
}
func (this *NinRepNative) GetField10() []int32 {
return this.Field10
}
func (this *NinRepNative) GetField11() []uint64 {
return this.Field11
}
func (this *NinRepNative) GetField12() []int64 {
return this.Field12
}
func (this *NinRepNative) GetField13() []bool {
return this.Field13
}
func (this *NinRepNative) GetField14() []string {
return this.Field14
}
func (this *NinRepNative) GetField15() [][]byte {
return this.Field15
}
func NewNinRepNativeFromFace(that NinRepNativeFace) *NinRepNative {
this := &NinRepNative{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field5 = that.GetField5()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field9 = that.GetField9()
this.Field10 = that.GetField10()
this.Field11 = that.GetField11()
this.Field12 = that.GetField12()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NidRepPackedNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []float64
GetField2() []float32
GetField3() []int32
GetField4() []int64
GetField5() []uint32
GetField6() []uint64
GetField7() []int32
GetField8() []int64
GetField9() []uint32
GetField10() []int32
GetField11() []uint64
GetField12() []int64
GetField13() []bool
}
func (this *NidRepPackedNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidRepPackedNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidRepPackedNativeFromFace(this)
}
func (this *NidRepPackedNative) GetField1() []float64 {
return this.Field1
}
func (this *NidRepPackedNative) GetField2() []float32 {
return this.Field2
}
func (this *NidRepPackedNative) GetField3() []int32 {
return this.Field3
}
func (this *NidRepPackedNative) GetField4() []int64 {
return this.Field4
}
func (this *NidRepPackedNative) GetField5() []uint32 {
return this.Field5
}
func (this *NidRepPackedNative) GetField6() []uint64 {
return this.Field6
}
func (this *NidRepPackedNative) GetField7() []int32 {
return this.Field7
}
func (this *NidRepPackedNative) GetField8() []int64 {
return this.Field8
}
func (this *NidRepPackedNative) GetField9() []uint32 {
return this.Field9
}
func (this *NidRepPackedNative) GetField10() []int32 {
return this.Field10
}
func (this *NidRepPackedNative) GetField11() []uint64 {
return this.Field11
}
func (this *NidRepPackedNative) GetField12() []int64 {
return this.Field12
}
func (this *NidRepPackedNative) GetField13() []bool {
return this.Field13
}
func NewNidRepPackedNativeFromFace(that NidRepPackedNativeFace) *NidRepPackedNative {
this := &NidRepPackedNative{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field5 = that.GetField5()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field9 = that.GetField9()
this.Field10 = that.GetField10()
this.Field11 = that.GetField11()
this.Field12 = that.GetField12()
this.Field13 = that.GetField13()
return this
}
type NinRepPackedNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []float64
GetField2() []float32
GetField3() []int32
GetField4() []int64
GetField5() []uint32
GetField6() []uint64
GetField7() []int32
GetField8() []int64
GetField9() []uint32
GetField10() []int32
GetField11() []uint64
GetField12() []int64
GetField13() []bool
}
func (this *NinRepPackedNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinRepPackedNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinRepPackedNativeFromFace(this)
}
func (this *NinRepPackedNative) GetField1() []float64 {
return this.Field1
}
func (this *NinRepPackedNative) GetField2() []float32 {
return this.Field2
}
func (this *NinRepPackedNative) GetField3() []int32 {
return this.Field3
}
func (this *NinRepPackedNative) GetField4() []int64 {
return this.Field4
}
func (this *NinRepPackedNative) GetField5() []uint32 {
return this.Field5
}
func (this *NinRepPackedNative) GetField6() []uint64 {
return this.Field6
}
func (this *NinRepPackedNative) GetField7() []int32 {
return this.Field7
}
func (this *NinRepPackedNative) GetField8() []int64 {
return this.Field8
}
func (this *NinRepPackedNative) GetField9() []uint32 {
return this.Field9
}
func (this *NinRepPackedNative) GetField10() []int32 {
return this.Field10
}
func (this *NinRepPackedNative) GetField11() []uint64 {
return this.Field11
}
func (this *NinRepPackedNative) GetField12() []int64 {
return this.Field12
}
func (this *NinRepPackedNative) GetField13() []bool {
return this.Field13
}
func NewNinRepPackedNativeFromFace(that NinRepPackedNativeFace) *NinRepPackedNative {
this := &NinRepPackedNative{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field5 = that.GetField5()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field9 = that.GetField9()
this.Field10 = that.GetField10()
this.Field11 = that.GetField11()
this.Field12 = that.GetField12()
this.Field13 = that.GetField13()
return this
}
type NidOptStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() float64
GetField2() float32
GetField3() NidOptNative
GetField4() NinOptNative
GetField6() uint64
GetField7() int32
GetField8() NidOptNative
GetField13() bool
GetField14() string
GetField15() []byte
}
func (this *NidOptStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidOptStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidOptStructFromFace(this)
}
func (this *NidOptStruct) GetField1() float64 {
return this.Field1
}
func (this *NidOptStruct) GetField2() float32 {
return this.Field2
}
func (this *NidOptStruct) GetField3() NidOptNative {
return this.Field3
}
func (this *NidOptStruct) GetField4() NinOptNative {
return this.Field4
}
func (this *NidOptStruct) GetField6() uint64 {
return this.Field6
}
func (this *NidOptStruct) GetField7() int32 {
return this.Field7
}
func (this *NidOptStruct) GetField8() NidOptNative {
return this.Field8
}
func (this *NidOptStruct) GetField13() bool {
return this.Field13
}
func (this *NidOptStruct) GetField14() string {
return this.Field14
}
func (this *NidOptStruct) GetField15() []byte {
return this.Field15
}
func NewNidOptStructFromFace(that NidOptStructFace) *NidOptStruct {
this := &NidOptStruct{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NinOptStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *float64
GetField2() *float32
GetField3() *NidOptNative
GetField4() *NinOptNative
GetField6() *uint64
GetField7() *int32
GetField8() *NidOptNative
GetField13() *bool
GetField14() *string
GetField15() []byte
}
func (this *NinOptStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinOptStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinOptStructFromFace(this)
}
func (this *NinOptStruct) GetField1() *float64 {
return this.Field1
}
func (this *NinOptStruct) GetField2() *float32 {
return this.Field2
}
func (this *NinOptStruct) GetField3() *NidOptNative {
return this.Field3
}
func (this *NinOptStruct) GetField4() *NinOptNative {
return this.Field4
}
func (this *NinOptStruct) GetField6() *uint64 {
return this.Field6
}
func (this *NinOptStruct) GetField7() *int32 {
return this.Field7
}
func (this *NinOptStruct) GetField8() *NidOptNative {
return this.Field8
}
func (this *NinOptStruct) GetField13() *bool {
return this.Field13
}
func (this *NinOptStruct) GetField14() *string {
return this.Field14
}
func (this *NinOptStruct) GetField15() []byte {
return this.Field15
}
func NewNinOptStructFromFace(that NinOptStructFace) *NinOptStruct {
this := &NinOptStruct{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NidRepStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []float64
GetField2() []float32
GetField3() []NidOptNative
GetField4() []NinOptNative
GetField6() []uint64
GetField7() []int32
GetField8() []NidOptNative
GetField13() []bool
GetField14() []string
GetField15() [][]byte
}
func (this *NidRepStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidRepStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidRepStructFromFace(this)
}
func (this *NidRepStruct) GetField1() []float64 {
return this.Field1
}
func (this *NidRepStruct) GetField2() []float32 {
return this.Field2
}
func (this *NidRepStruct) GetField3() []NidOptNative {
return this.Field3
}
func (this *NidRepStruct) GetField4() []NinOptNative {
return this.Field4
}
func (this *NidRepStruct) GetField6() []uint64 {
return this.Field6
}
func (this *NidRepStruct) GetField7() []int32 {
return this.Field7
}
func (this *NidRepStruct) GetField8() []NidOptNative {
return this.Field8
}
func (this *NidRepStruct) GetField13() []bool {
return this.Field13
}
func (this *NidRepStruct) GetField14() []string {
return this.Field14
}
func (this *NidRepStruct) GetField15() [][]byte {
return this.Field15
}
func NewNidRepStructFromFace(that NidRepStructFace) *NidRepStruct {
this := &NidRepStruct{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NinRepStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []float64
GetField2() []float32
GetField3() []*NidOptNative
GetField4() []*NinOptNative
GetField6() []uint64
GetField7() []int32
GetField8() []*NidOptNative
GetField13() []bool
GetField14() []string
GetField15() [][]byte
}
func (this *NinRepStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinRepStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinRepStructFromFace(this)
}
func (this *NinRepStruct) GetField1() []float64 {
return this.Field1
}
func (this *NinRepStruct) GetField2() []float32 {
return this.Field2
}
func (this *NinRepStruct) GetField3() []*NidOptNative {
return this.Field3
}
func (this *NinRepStruct) GetField4() []*NinOptNative {
return this.Field4
}
func (this *NinRepStruct) GetField6() []uint64 {
return this.Field6
}
func (this *NinRepStruct) GetField7() []int32 {
return this.Field7
}
func (this *NinRepStruct) GetField8() []*NidOptNative {
return this.Field8
}
func (this *NinRepStruct) GetField13() []bool {
return this.Field13
}
func (this *NinRepStruct) GetField14() []string {
return this.Field14
}
func (this *NinRepStruct) GetField15() [][]byte {
return this.Field15
}
func NewNinRepStructFromFace(that NinRepStructFace) *NinRepStruct {
this := &NinRepStruct{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field8 = that.GetField8()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NidEmbeddedStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetNidOptNative() *NidOptNative
GetField200() NidOptNative
GetField210() bool
}
func (this *NidEmbeddedStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidEmbeddedStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidEmbeddedStructFromFace(this)
}
func (this *NidEmbeddedStruct) GetNidOptNative() *NidOptNative {
return this.NidOptNative
}
func (this *NidEmbeddedStruct) GetField200() NidOptNative {
return this.Field200
}
func (this *NidEmbeddedStruct) GetField210() bool {
return this.Field210
}
func NewNidEmbeddedStructFromFace(that NidEmbeddedStructFace) *NidEmbeddedStruct {
this := &NidEmbeddedStruct{}
this.NidOptNative = that.GetNidOptNative()
this.Field200 = that.GetField200()
this.Field210 = that.GetField210()
return this
}
type NinEmbeddedStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetNidOptNative() *NidOptNative
GetField200() *NidOptNative
GetField210() *bool
}
func (this *NinEmbeddedStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinEmbeddedStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinEmbeddedStructFromFace(this)
}
func (this *NinEmbeddedStruct) GetNidOptNative() *NidOptNative {
return this.NidOptNative
}
func (this *NinEmbeddedStruct) GetField200() *NidOptNative {
return this.Field200
}
func (this *NinEmbeddedStruct) GetField210() *bool {
return this.Field210
}
func NewNinEmbeddedStructFromFace(that NinEmbeddedStructFace) *NinEmbeddedStruct {
this := &NinEmbeddedStruct{}
this.NidOptNative = that.GetNidOptNative()
this.Field200 = that.GetField200()
this.Field210 = that.GetField210()
return this
}
type NidNestedStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() NidOptStruct
GetField2() []NidRepStruct
}
func (this *NidNestedStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidNestedStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidNestedStructFromFace(this)
}
func (this *NidNestedStruct) GetField1() NidOptStruct {
return this.Field1
}
func (this *NidNestedStruct) GetField2() []NidRepStruct {
return this.Field2
}
func NewNidNestedStructFromFace(that NidNestedStructFace) *NidNestedStruct {
this := &NidNestedStruct{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
return this
}
type NinNestedStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *NinOptStruct
GetField2() []*NinRepStruct
}
func (this *NinNestedStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinNestedStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinNestedStructFromFace(this)
}
func (this *NinNestedStruct) GetField1() *NinOptStruct {
return this.Field1
}
func (this *NinNestedStruct) GetField2() []*NinRepStruct {
return this.Field2
}
func NewNinNestedStructFromFace(that NinNestedStructFace) *NinNestedStruct {
this := &NinNestedStruct{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
return this
}
type NidOptCustomFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetId() Uuid
GetValue() github_com_gogo_protobuf_test_custom.Uint128
}
func (this *NidOptCustom) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidOptCustom) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidOptCustomFromFace(this)
}
func (this *NidOptCustom) GetId() Uuid {
return this.Id
}
func (this *NidOptCustom) GetValue() github_com_gogo_protobuf_test_custom.Uint128 {
return this.Value
}
func NewNidOptCustomFromFace(that NidOptCustomFace) *NidOptCustom {
this := &NidOptCustom{}
this.Id = that.GetId()
this.Value = that.GetValue()
return this
}
type CustomDashFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetValue() *github_com_gogo_protobuf_test_custom_dash_type.Bytes
}
func (this *CustomDash) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomDash) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomDashFromFace(this)
}
func (this *CustomDash) GetValue() *github_com_gogo_protobuf_test_custom_dash_type.Bytes {
return this.Value
}
func NewCustomDashFromFace(that CustomDashFace) *CustomDash {
this := &CustomDash{}
this.Value = that.GetValue()
return this
}
type NinOptCustomFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetId() *Uuid
GetValue() *github_com_gogo_protobuf_test_custom.Uint128
}
func (this *NinOptCustom) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinOptCustom) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinOptCustomFromFace(this)
}
func (this *NinOptCustom) GetId() *Uuid {
return this.Id
}
func (this *NinOptCustom) GetValue() *github_com_gogo_protobuf_test_custom.Uint128 {
return this.Value
}
func NewNinOptCustomFromFace(that NinOptCustomFace) *NinOptCustom {
this := &NinOptCustom{}
this.Id = that.GetId()
this.Value = that.GetValue()
return this
}
type NidRepCustomFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetId() []Uuid
GetValue() []github_com_gogo_protobuf_test_custom.Uint128
}
func (this *NidRepCustom) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidRepCustom) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidRepCustomFromFace(this)
}
func (this *NidRepCustom) GetId() []Uuid {
return this.Id
}
func (this *NidRepCustom) GetValue() []github_com_gogo_protobuf_test_custom.Uint128 {
return this.Value
}
func NewNidRepCustomFromFace(that NidRepCustomFace) *NidRepCustom {
this := &NidRepCustom{}
this.Id = that.GetId()
this.Value = that.GetValue()
return this
}
type NinRepCustomFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetId() []Uuid
GetValue() []github_com_gogo_protobuf_test_custom.Uint128
}
func (this *NinRepCustom) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinRepCustom) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinRepCustomFromFace(this)
}
func (this *NinRepCustom) GetId() []Uuid {
return this.Id
}
func (this *NinRepCustom) GetValue() []github_com_gogo_protobuf_test_custom.Uint128 {
return this.Value
}
func NewNinRepCustomFromFace(that NinRepCustomFace) *NinRepCustom {
this := &NinRepCustom{}
this.Id = that.GetId()
this.Value = that.GetValue()
return this
}
type NinOptNativeUnionFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *float64
GetField2() *float32
GetField3() *int32
GetField4() *int64
GetField5() *uint32
GetField6() *uint64
GetField13() *bool
GetField14() *string
GetField15() []byte
}
func (this *NinOptNativeUnion) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinOptNativeUnion) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinOptNativeUnionFromFace(this)
}
func (this *NinOptNativeUnion) GetField1() *float64 {
return this.Field1
}
func (this *NinOptNativeUnion) GetField2() *float32 {
return this.Field2
}
func (this *NinOptNativeUnion) GetField3() *int32 {
return this.Field3
}
func (this *NinOptNativeUnion) GetField4() *int64 {
return this.Field4
}
func (this *NinOptNativeUnion) GetField5() *uint32 {
return this.Field5
}
func (this *NinOptNativeUnion) GetField6() *uint64 {
return this.Field6
}
func (this *NinOptNativeUnion) GetField13() *bool {
return this.Field13
}
func (this *NinOptNativeUnion) GetField14() *string {
return this.Field14
}
func (this *NinOptNativeUnion) GetField15() []byte {
return this.Field15
}
func NewNinOptNativeUnionFromFace(that NinOptNativeUnionFace) *NinOptNativeUnion {
this := &NinOptNativeUnion{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field5 = that.GetField5()
this.Field6 = that.GetField6()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NinOptStructUnionFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *float64
GetField2() *float32
GetField3() *NidOptNative
GetField4() *NinOptNative
GetField6() *uint64
GetField7() *int32
GetField13() *bool
GetField14() *string
GetField15() []byte
}
func (this *NinOptStructUnion) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinOptStructUnion) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinOptStructUnionFromFace(this)
}
func (this *NinOptStructUnion) GetField1() *float64 {
return this.Field1
}
func (this *NinOptStructUnion) GetField2() *float32 {
return this.Field2
}
func (this *NinOptStructUnion) GetField3() *NidOptNative {
return this.Field3
}
func (this *NinOptStructUnion) GetField4() *NinOptNative {
return this.Field4
}
func (this *NinOptStructUnion) GetField6() *uint64 {
return this.Field6
}
func (this *NinOptStructUnion) GetField7() *int32 {
return this.Field7
}
func (this *NinOptStructUnion) GetField13() *bool {
return this.Field13
}
func (this *NinOptStructUnion) GetField14() *string {
return this.Field14
}
func (this *NinOptStructUnion) GetField15() []byte {
return this.Field15
}
func NewNinOptStructUnionFromFace(that NinOptStructUnionFace) *NinOptStructUnion {
this := &NinOptStructUnion{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
this.Field4 = that.GetField4()
this.Field6 = that.GetField6()
this.Field7 = that.GetField7()
this.Field13 = that.GetField13()
this.Field14 = that.GetField14()
this.Field15 = that.GetField15()
return this
}
type NinEmbeddedStructUnionFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetNidOptNative() *NidOptNative
GetField200() *NinOptNative
GetField210() *bool
}
func (this *NinEmbeddedStructUnion) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinEmbeddedStructUnion) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinEmbeddedStructUnionFromFace(this)
}
func (this *NinEmbeddedStructUnion) GetNidOptNative() *NidOptNative {
return this.NidOptNative
}
func (this *NinEmbeddedStructUnion) GetField200() *NinOptNative {
return this.Field200
}
func (this *NinEmbeddedStructUnion) GetField210() *bool {
return this.Field210
}
func NewNinEmbeddedStructUnionFromFace(that NinEmbeddedStructUnionFace) *NinEmbeddedStructUnion {
this := &NinEmbeddedStructUnion{}
this.NidOptNative = that.GetNidOptNative()
this.Field200 = that.GetField200()
this.Field210 = that.GetField210()
return this
}
type NinNestedStructUnionFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *NinOptNativeUnion
GetField2() *NinOptStructUnion
GetField3() *NinEmbeddedStructUnion
}
func (this *NinNestedStructUnion) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinNestedStructUnion) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinNestedStructUnionFromFace(this)
}
func (this *NinNestedStructUnion) GetField1() *NinOptNativeUnion {
return this.Field1
}
func (this *NinNestedStructUnion) GetField2() *NinOptStructUnion {
return this.Field2
}
func (this *NinNestedStructUnion) GetField3() *NinEmbeddedStructUnion {
return this.Field3
}
func NewNinNestedStructUnionFromFace(that NinNestedStructUnionFace) *NinNestedStructUnion {
this := &NinNestedStructUnion{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
return this
}
type TreeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetOr() *OrBranch
GetAnd() *AndBranch
GetLeaf() *Leaf
}
func (this *Tree) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Tree) TestProto() github_com_gogo_protobuf_proto.Message {
return NewTreeFromFace(this)
}
func (this *Tree) GetOr() *OrBranch {
return this.Or
}
func (this *Tree) GetAnd() *AndBranch {
return this.And
}
func (this *Tree) GetLeaf() *Leaf {
return this.Leaf
}
func NewTreeFromFace(that TreeFace) *Tree {
this := &Tree{}
this.Or = that.GetOr()
this.And = that.GetAnd()
this.Leaf = that.GetLeaf()
return this
}
type OrBranchFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetLeft() Tree
GetRight() Tree
}
func (this *OrBranch) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *OrBranch) TestProto() github_com_gogo_protobuf_proto.Message {
return NewOrBranchFromFace(this)
}
func (this *OrBranch) GetLeft() Tree {
return this.Left
}
func (this *OrBranch) GetRight() Tree {
return this.Right
}
func NewOrBranchFromFace(that OrBranchFace) *OrBranch {
this := &OrBranch{}
this.Left = that.GetLeft()
this.Right = that.GetRight()
return this
}
type AndBranchFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetLeft() Tree
GetRight() Tree
}
func (this *AndBranch) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *AndBranch) TestProto() github_com_gogo_protobuf_proto.Message {
return NewAndBranchFromFace(this)
}
func (this *AndBranch) GetLeft() Tree {
return this.Left
}
func (this *AndBranch) GetRight() Tree {
return this.Right
}
func NewAndBranchFromFace(that AndBranchFace) *AndBranch {
this := &AndBranch{}
this.Left = that.GetLeft()
this.Right = that.GetRight()
return this
}
type LeafFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetValue() int64
GetStrValue() string
}
func (this *Leaf) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Leaf) TestProto() github_com_gogo_protobuf_proto.Message {
return NewLeafFromFace(this)
}
func (this *Leaf) GetValue() int64 {
return this.Value
}
func (this *Leaf) GetStrValue() string {
return this.StrValue
}
func NewLeafFromFace(that LeafFace) *Leaf {
this := &Leaf{}
this.Value = that.GetValue()
this.StrValue = that.GetStrValue()
return this
}
type DeepTreeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetDown() *ADeepBranch
GetAnd() *AndDeepBranch
GetLeaf() *DeepLeaf
}
func (this *DeepTree) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *DeepTree) TestProto() github_com_gogo_protobuf_proto.Message {
return NewDeepTreeFromFace(this)
}
func (this *DeepTree) GetDown() *ADeepBranch {
return this.Down
}
func (this *DeepTree) GetAnd() *AndDeepBranch {
return this.And
}
func (this *DeepTree) GetLeaf() *DeepLeaf {
return this.Leaf
}
func NewDeepTreeFromFace(that DeepTreeFace) *DeepTree {
this := &DeepTree{}
this.Down = that.GetDown()
this.And = that.GetAnd()
this.Leaf = that.GetLeaf()
return this
}
type ADeepBranchFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetDown() DeepTree
}
func (this *ADeepBranch) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *ADeepBranch) TestProto() github_com_gogo_protobuf_proto.Message {
return NewADeepBranchFromFace(this)
}
func (this *ADeepBranch) GetDown() DeepTree {
return this.Down
}
func NewADeepBranchFromFace(that ADeepBranchFace) *ADeepBranch {
this := &ADeepBranch{}
this.Down = that.GetDown()
return this
}
type AndDeepBranchFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetLeft() DeepTree
GetRight() DeepTree
}
func (this *AndDeepBranch) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *AndDeepBranch) TestProto() github_com_gogo_protobuf_proto.Message {
return NewAndDeepBranchFromFace(this)
}
func (this *AndDeepBranch) GetLeft() DeepTree {
return this.Left
}
func (this *AndDeepBranch) GetRight() DeepTree {
return this.Right
}
func NewAndDeepBranchFromFace(that AndDeepBranchFace) *AndDeepBranch {
this := &AndDeepBranch{}
this.Left = that.GetLeft()
this.Right = that.GetRight()
return this
}
type DeepLeafFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetTree() Tree
}
func (this *DeepLeaf) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *DeepLeaf) TestProto() github_com_gogo_protobuf_proto.Message {
return NewDeepLeafFromFace(this)
}
func (this *DeepLeaf) GetTree() Tree {
return this.Tree
}
func NewDeepLeafFromFace(that DeepLeafFace) *DeepLeaf {
this := &DeepLeaf{}
this.Tree = that.GetTree()
return this
}
type NilFace interface {
Proto() github_com_gogo_protobuf_proto.Message
}
func (this *Nil) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Nil) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNilFromFace(this)
}
func NewNilFromFace(that NilFace) *Nil {
this := &Nil{}
return this
}
type NidOptEnumFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() TheTestEnum
}
func (this *NidOptEnum) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidOptEnum) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidOptEnumFromFace(this)
}
func (this *NidOptEnum) GetField1() TheTestEnum {
return this.Field1
}
func NewNidOptEnumFromFace(that NidOptEnumFace) *NidOptEnum {
this := &NidOptEnum{}
this.Field1 = that.GetField1()
return this
}
type NinOptEnumFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *TheTestEnum
GetField2() *YetAnotherTestEnum
GetField3() *YetYetAnotherTestEnum
}
func (this *NinOptEnum) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinOptEnum) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinOptEnumFromFace(this)
}
func (this *NinOptEnum) GetField1() *TheTestEnum {
return this.Field1
}
func (this *NinOptEnum) GetField2() *YetAnotherTestEnum {
return this.Field2
}
func (this *NinOptEnum) GetField3() *YetYetAnotherTestEnum {
return this.Field3
}
func NewNinOptEnumFromFace(that NinOptEnumFace) *NinOptEnum {
this := &NinOptEnum{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
return this
}
type NidRepEnumFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []TheTestEnum
GetField2() []YetAnotherTestEnum
GetField3() []YetYetAnotherTestEnum
}
func (this *NidRepEnum) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidRepEnum) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidRepEnumFromFace(this)
}
func (this *NidRepEnum) GetField1() []TheTestEnum {
return this.Field1
}
func (this *NidRepEnum) GetField2() []YetAnotherTestEnum {
return this.Field2
}
func (this *NidRepEnum) GetField3() []YetYetAnotherTestEnum {
return this.Field3
}
func NewNidRepEnumFromFace(that NidRepEnumFace) *NidRepEnum {
this := &NidRepEnum{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
return this
}
type NinRepEnumFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []TheTestEnum
GetField2() []YetAnotherTestEnum
GetField3() []YetYetAnotherTestEnum
}
func (this *NinRepEnum) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinRepEnum) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinRepEnumFromFace(this)
}
func (this *NinRepEnum) GetField1() []TheTestEnum {
return this.Field1
}
func (this *NinRepEnum) GetField2() []YetAnotherTestEnum {
return this.Field2
}
func (this *NinRepEnum) GetField3() []YetYetAnotherTestEnum {
return this.Field3
}
func NewNinRepEnumFromFace(that NinRepEnumFace) *NinRepEnum {
this := &NinRepEnum{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
return this
}
type AnotherNinOptEnumFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *AnotherTestEnum
GetField2() *YetAnotherTestEnum
GetField3() *YetYetAnotherTestEnum
}
func (this *AnotherNinOptEnum) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *AnotherNinOptEnum) TestProto() github_com_gogo_protobuf_proto.Message {
return NewAnotherNinOptEnumFromFace(this)
}
func (this *AnotherNinOptEnum) GetField1() *AnotherTestEnum {
return this.Field1
}
func (this *AnotherNinOptEnum) GetField2() *YetAnotherTestEnum {
return this.Field2
}
func (this *AnotherNinOptEnum) GetField3() *YetYetAnotherTestEnum {
return this.Field3
}
func NewAnotherNinOptEnumFromFace(that AnotherNinOptEnumFace) *AnotherNinOptEnum {
this := &AnotherNinOptEnum{}
this.Field1 = that.GetField1()
this.Field2 = that.GetField2()
this.Field3 = that.GetField3()
return this
}
type TimerFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetTime1() int64
GetTime2() int64
GetData() []byte
}
func (this *Timer) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Timer) TestProto() github_com_gogo_protobuf_proto.Message {
return NewTimerFromFace(this)
}
func (this *Timer) GetTime1() int64 {
return this.Time1
}
func (this *Timer) GetTime2() int64 {
return this.Time2
}
func (this *Timer) GetData() []byte {
return this.Data
}
func NewTimerFromFace(that TimerFace) *Timer {
this := &Timer{}
this.Time1 = that.GetTime1()
this.Time2 = that.GetTime2()
this.Data = that.GetData()
return this
}
type NestedDefinitionFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *int64
GetEnumField() *NestedDefinition_NestedEnum
GetNNM() *NestedDefinition_NestedMessage_NestedNestedMsg
GetNM() *NestedDefinition_NestedMessage
}
func (this *NestedDefinition) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NestedDefinition) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNestedDefinitionFromFace(this)
}
func (this *NestedDefinition) GetField1() *int64 {
return this.Field1
}
func (this *NestedDefinition) GetEnumField() *NestedDefinition_NestedEnum {
return this.EnumField
}
func (this *NestedDefinition) GetNNM() *NestedDefinition_NestedMessage_NestedNestedMsg {
return this.NNM
}
func (this *NestedDefinition) GetNM() *NestedDefinition_NestedMessage {
return this.NM
}
func NewNestedDefinitionFromFace(that NestedDefinitionFace) *NestedDefinition {
this := &NestedDefinition{}
this.Field1 = that.GetField1()
this.EnumField = that.GetEnumField()
this.NNM = that.GetNNM()
this.NM = that.GetNM()
return this
}
type NestedDefinition_NestedMessageFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetNestedField1() *uint64
GetNNM() *NestedDefinition_NestedMessage_NestedNestedMsg
}
func (this *NestedDefinition_NestedMessage) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NestedDefinition_NestedMessage) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNestedDefinition_NestedMessageFromFace(this)
}
func (this *NestedDefinition_NestedMessage) GetNestedField1() *uint64 {
return this.NestedField1
}
func (this *NestedDefinition_NestedMessage) GetNNM() *NestedDefinition_NestedMessage_NestedNestedMsg {
return this.NNM
}
func NewNestedDefinition_NestedMessageFromFace(that NestedDefinition_NestedMessageFace) *NestedDefinition_NestedMessage {
this := &NestedDefinition_NestedMessage{}
this.NestedField1 = that.GetNestedField1()
this.NNM = that.GetNNM()
return this
}
type NestedDefinition_NestedMessage_NestedNestedMsgFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetNestedNestedField1() *string
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNestedDefinition_NestedMessage_NestedNestedMsgFromFace(this)
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) GetNestedNestedField1() *string {
return this.NestedNestedField1
}
func NewNestedDefinition_NestedMessage_NestedNestedMsgFromFace(that NestedDefinition_NestedMessage_NestedNestedMsgFace) *NestedDefinition_NestedMessage_NestedNestedMsg {
this := &NestedDefinition_NestedMessage_NestedNestedMsg{}
this.NestedNestedField1 = that.GetNestedNestedField1()
return this
}
type NestedScopeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetA() *NestedDefinition_NestedMessage_NestedNestedMsg
GetB() *NestedDefinition_NestedEnum
GetC() *NestedDefinition_NestedMessage
}
func (this *NestedScope) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NestedScope) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNestedScopeFromFace(this)
}
func (this *NestedScope) GetA() *NestedDefinition_NestedMessage_NestedNestedMsg {
return this.A
}
func (this *NestedScope) GetB() *NestedDefinition_NestedEnum {
return this.B
}
func (this *NestedScope) GetC() *NestedDefinition_NestedMessage {
return this.C
}
func NewNestedScopeFromFace(that NestedScopeFace) *NestedScope {
this := &NestedScope{}
this.A = that.GetA()
this.B = that.GetB()
this.C = that.GetC()
return this
}
type CustomContainerFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetCustomStruct() NidOptCustom
}
func (this *CustomContainer) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomContainer) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomContainerFromFace(this)
}
func (this *CustomContainer) GetCustomStruct() NidOptCustom {
return this.CustomStruct
}
func NewCustomContainerFromFace(that CustomContainerFace) *CustomContainer {
this := &CustomContainer{}
this.CustomStruct = that.GetCustomStruct()
return this
}
type CustomNameNidOptNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetFieldA() float64
GetFieldB() float32
GetFieldC() int32
GetFieldD() int64
GetFieldE() uint32
GetFieldF() uint64
GetFieldG() int32
GetFieldH() int64
GetFieldI() uint32
GetFieldJ() int32
GetFieldK() uint64
GetFieldL() int64
GetFieldM() bool
GetFieldN() string
GetFieldO() []byte
}
func (this *CustomNameNidOptNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomNameNidOptNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomNameNidOptNativeFromFace(this)
}
func (this *CustomNameNidOptNative) GetFieldA() float64 {
return this.FieldA
}
func (this *CustomNameNidOptNative) GetFieldB() float32 {
return this.FieldB
}
func (this *CustomNameNidOptNative) GetFieldC() int32 {
return this.FieldC
}
func (this *CustomNameNidOptNative) GetFieldD() int64 {
return this.FieldD
}
func (this *CustomNameNidOptNative) GetFieldE() uint32 {
return this.FieldE
}
func (this *CustomNameNidOptNative) GetFieldF() uint64 {
return this.FieldF
}
func (this *CustomNameNidOptNative) GetFieldG() int32 {
return this.FieldG
}
func (this *CustomNameNidOptNative) GetFieldH() int64 {
return this.FieldH
}
func (this *CustomNameNidOptNative) GetFieldI() uint32 {
return this.FieldI
}
func (this *CustomNameNidOptNative) GetFieldJ() int32 {
return this.FieldJ
}
func (this *CustomNameNidOptNative) GetFieldK() uint64 {
return this.FieldK
}
func (this *CustomNameNidOptNative) GetFieldL() int64 {
return this.FieldL
}
func (this *CustomNameNidOptNative) GetFieldM() bool {
return this.FieldM
}
func (this *CustomNameNidOptNative) GetFieldN() string {
return this.FieldN
}
func (this *CustomNameNidOptNative) GetFieldO() []byte {
return this.FieldO
}
func NewCustomNameNidOptNativeFromFace(that CustomNameNidOptNativeFace) *CustomNameNidOptNative {
this := &CustomNameNidOptNative{}
this.FieldA = that.GetFieldA()
this.FieldB = that.GetFieldB()
this.FieldC = that.GetFieldC()
this.FieldD = that.GetFieldD()
this.FieldE = that.GetFieldE()
this.FieldF = that.GetFieldF()
this.FieldG = that.GetFieldG()
this.FieldH = that.GetFieldH()
this.FieldI = that.GetFieldI()
this.FieldJ = that.GetFieldJ()
this.FieldK = that.GetFieldK()
this.FieldL = that.GetFieldL()
this.FieldM = that.GetFieldM()
this.FieldN = that.GetFieldN()
this.FieldO = that.GetFieldO()
return this
}
type CustomNameNinOptNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetFieldA() *float64
GetFieldB() *float32
GetFieldC() *int32
GetFieldD() *int64
GetFieldE() *uint32
GetFieldF() *uint64
GetFieldG() *int32
GetFieldH() *int64
GetFieldI() *uint32
GetFieldJ() *int32
GetFieldK() *uint64
GetFielL() *int64
GetFieldM() *bool
GetFieldN() *string
GetFieldO() []byte
}
func (this *CustomNameNinOptNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomNameNinOptNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomNameNinOptNativeFromFace(this)
}
func (this *CustomNameNinOptNative) GetFieldA() *float64 {
return this.FieldA
}
func (this *CustomNameNinOptNative) GetFieldB() *float32 {
return this.FieldB
}
func (this *CustomNameNinOptNative) GetFieldC() *int32 {
return this.FieldC
}
func (this *CustomNameNinOptNative) GetFieldD() *int64 {
return this.FieldD
}
func (this *CustomNameNinOptNative) GetFieldE() *uint32 {
return this.FieldE
}
func (this *CustomNameNinOptNative) GetFieldF() *uint64 {
return this.FieldF
}
func (this *CustomNameNinOptNative) GetFieldG() *int32 {
return this.FieldG
}
func (this *CustomNameNinOptNative) GetFieldH() *int64 {
return this.FieldH
}
func (this *CustomNameNinOptNative) GetFieldI() *uint32 {
return this.FieldI
}
func (this *CustomNameNinOptNative) GetFieldJ() *int32 {
return this.FieldJ
}
func (this *CustomNameNinOptNative) GetFieldK() *uint64 {
return this.FieldK
}
func (this *CustomNameNinOptNative) GetFielL() *int64 {
return this.FielL
}
func (this *CustomNameNinOptNative) GetFieldM() *bool {
return this.FieldM
}
func (this *CustomNameNinOptNative) GetFieldN() *string {
return this.FieldN
}
func (this *CustomNameNinOptNative) GetFieldO() []byte {
return this.FieldO
}
func NewCustomNameNinOptNativeFromFace(that CustomNameNinOptNativeFace) *CustomNameNinOptNative {
this := &CustomNameNinOptNative{}
this.FieldA = that.GetFieldA()
this.FieldB = that.GetFieldB()
this.FieldC = that.GetFieldC()
this.FieldD = that.GetFieldD()
this.FieldE = that.GetFieldE()
this.FieldF = that.GetFieldF()
this.FieldG = that.GetFieldG()
this.FieldH = that.GetFieldH()
this.FieldI = that.GetFieldI()
this.FieldJ = that.GetFieldJ()
this.FieldK = that.GetFieldK()
this.FielL = that.GetFielL()
this.FieldM = that.GetFieldM()
this.FieldN = that.GetFieldN()
this.FieldO = that.GetFieldO()
return this
}
type CustomNameNinRepNativeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetFieldA() []float64
GetFieldB() []float32
GetFieldC() []int32
GetFieldD() []int64
GetFieldE() []uint32
GetFieldF() []uint64
GetFieldG() []int32
GetFieldH() []int64
GetFieldI() []uint32
GetFieldJ() []int32
GetFieldK() []uint64
GetFieldL() []int64
GetFieldM() []bool
GetFieldN() []string
GetFieldO() [][]byte
}
func (this *CustomNameNinRepNative) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomNameNinRepNative) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomNameNinRepNativeFromFace(this)
}
func (this *CustomNameNinRepNative) GetFieldA() []float64 {
return this.FieldA
}
func (this *CustomNameNinRepNative) GetFieldB() []float32 {
return this.FieldB
}
func (this *CustomNameNinRepNative) GetFieldC() []int32 {
return this.FieldC
}
func (this *CustomNameNinRepNative) GetFieldD() []int64 {
return this.FieldD
}
func (this *CustomNameNinRepNative) GetFieldE() []uint32 {
return this.FieldE
}
func (this *CustomNameNinRepNative) GetFieldF() []uint64 {
return this.FieldF
}
func (this *CustomNameNinRepNative) GetFieldG() []int32 {
return this.FieldG
}
func (this *CustomNameNinRepNative) GetFieldH() []int64 {
return this.FieldH
}
func (this *CustomNameNinRepNative) GetFieldI() []uint32 {
return this.FieldI
}
func (this *CustomNameNinRepNative) GetFieldJ() []int32 {
return this.FieldJ
}
func (this *CustomNameNinRepNative) GetFieldK() []uint64 {
return this.FieldK
}
func (this *CustomNameNinRepNative) GetFieldL() []int64 {
return this.FieldL
}
func (this *CustomNameNinRepNative) GetFieldM() []bool {
return this.FieldM
}
func (this *CustomNameNinRepNative) GetFieldN() []string {
return this.FieldN
}
func (this *CustomNameNinRepNative) GetFieldO() [][]byte {
return this.FieldO
}
func NewCustomNameNinRepNativeFromFace(that CustomNameNinRepNativeFace) *CustomNameNinRepNative {
this := &CustomNameNinRepNative{}
this.FieldA = that.GetFieldA()
this.FieldB = that.GetFieldB()
this.FieldC = that.GetFieldC()
this.FieldD = that.GetFieldD()
this.FieldE = that.GetFieldE()
this.FieldF = that.GetFieldF()
this.FieldG = that.GetFieldG()
this.FieldH = that.GetFieldH()
this.FieldI = that.GetFieldI()
this.FieldJ = that.GetFieldJ()
this.FieldK = that.GetFieldK()
this.FieldL = that.GetFieldL()
this.FieldM = that.GetFieldM()
this.FieldN = that.GetFieldN()
this.FieldO = that.GetFieldO()
return this
}
type CustomNameNinStructFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetFieldA() *float64
GetFieldB() *float32
GetFieldC() *NidOptNative
GetFieldD() []*NinOptNative
GetFieldE() *uint64
GetFieldF() *int32
GetFieldG() *NidOptNative
GetFieldH() *bool
GetFieldI() *string
GetFieldJ() []byte
}
func (this *CustomNameNinStruct) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomNameNinStruct) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomNameNinStructFromFace(this)
}
func (this *CustomNameNinStruct) GetFieldA() *float64 {
return this.FieldA
}
func (this *CustomNameNinStruct) GetFieldB() *float32 {
return this.FieldB
}
func (this *CustomNameNinStruct) GetFieldC() *NidOptNative {
return this.FieldC
}
func (this *CustomNameNinStruct) GetFieldD() []*NinOptNative {
return this.FieldD
}
func (this *CustomNameNinStruct) GetFieldE() *uint64 {
return this.FieldE
}
func (this *CustomNameNinStruct) GetFieldF() *int32 {
return this.FieldF
}
func (this *CustomNameNinStruct) GetFieldG() *NidOptNative {
return this.FieldG
}
func (this *CustomNameNinStruct) GetFieldH() *bool {
return this.FieldH
}
func (this *CustomNameNinStruct) GetFieldI() *string {
return this.FieldI
}
func (this *CustomNameNinStruct) GetFieldJ() []byte {
return this.FieldJ
}
func NewCustomNameNinStructFromFace(that CustomNameNinStructFace) *CustomNameNinStruct {
this := &CustomNameNinStruct{}
this.FieldA = that.GetFieldA()
this.FieldB = that.GetFieldB()
this.FieldC = that.GetFieldC()
this.FieldD = that.GetFieldD()
this.FieldE = that.GetFieldE()
this.FieldF = that.GetFieldF()
this.FieldG = that.GetFieldG()
this.FieldH = that.GetFieldH()
this.FieldI = that.GetFieldI()
this.FieldJ = that.GetFieldJ()
return this
}
type CustomNameCustomTypeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetFieldA() *Uuid
GetFieldB() *github_com_gogo_protobuf_test_custom.Uint128
GetFieldC() []Uuid
GetFieldD() []github_com_gogo_protobuf_test_custom.Uint128
}
func (this *CustomNameCustomType) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomNameCustomType) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomNameCustomTypeFromFace(this)
}
func (this *CustomNameCustomType) GetFieldA() *Uuid {
return this.FieldA
}
func (this *CustomNameCustomType) GetFieldB() *github_com_gogo_protobuf_test_custom.Uint128 {
return this.FieldB
}
func (this *CustomNameCustomType) GetFieldC() []Uuid {
return this.FieldC
}
func (this *CustomNameCustomType) GetFieldD() []github_com_gogo_protobuf_test_custom.Uint128 {
return this.FieldD
}
func NewCustomNameCustomTypeFromFace(that CustomNameCustomTypeFace) *CustomNameCustomType {
this := &CustomNameCustomType{}
this.FieldA = that.GetFieldA()
this.FieldB = that.GetFieldB()
this.FieldC = that.GetFieldC()
this.FieldD = that.GetFieldD()
return this
}
type CustomNameNinEmbeddedStructUnionFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetNidOptNative() *NidOptNative
GetFieldA() *NinOptNative
GetFieldB() *bool
}
func (this *CustomNameNinEmbeddedStructUnion) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomNameNinEmbeddedStructUnion) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomNameNinEmbeddedStructUnionFromFace(this)
}
func (this *CustomNameNinEmbeddedStructUnion) GetNidOptNative() *NidOptNative {
return this.NidOptNative
}
func (this *CustomNameNinEmbeddedStructUnion) GetFieldA() *NinOptNative {
return this.FieldA
}
func (this *CustomNameNinEmbeddedStructUnion) GetFieldB() *bool {
return this.FieldB
}
func NewCustomNameNinEmbeddedStructUnionFromFace(that CustomNameNinEmbeddedStructUnionFace) *CustomNameNinEmbeddedStructUnion {
this := &CustomNameNinEmbeddedStructUnion{}
this.NidOptNative = that.GetNidOptNative()
this.FieldA = that.GetFieldA()
this.FieldB = that.GetFieldB()
return this
}
type CustomNameEnumFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetFieldA() *TheTestEnum
GetFieldB() []TheTestEnum
}
func (this *CustomNameEnum) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *CustomNameEnum) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCustomNameEnumFromFace(this)
}
func (this *CustomNameEnum) GetFieldA() *TheTestEnum {
return this.FieldA
}
func (this *CustomNameEnum) GetFieldB() []TheTestEnum {
return this.FieldB
}
func NewCustomNameEnumFromFace(that CustomNameEnumFace) *CustomNameEnum {
this := &CustomNameEnum{}
this.FieldA = that.GetFieldA()
this.FieldB = that.GetFieldB()
return this
}
type UnrecognizedFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *string
}
func (this *Unrecognized) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Unrecognized) TestProto() github_com_gogo_protobuf_proto.Message {
return NewUnrecognizedFromFace(this)
}
func (this *Unrecognized) GetField1() *string {
return this.Field1
}
func NewUnrecognizedFromFace(that UnrecognizedFace) *Unrecognized {
this := &Unrecognized{}
this.Field1 = that.GetField1()
return this
}
type UnrecognizedWithInnerFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetEmbedded() []*UnrecognizedWithInner_Inner
GetField2() *string
}
func (this *UnrecognizedWithInner) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *UnrecognizedWithInner) TestProto() github_com_gogo_protobuf_proto.Message {
return NewUnrecognizedWithInnerFromFace(this)
}
func (this *UnrecognizedWithInner) GetEmbedded() []*UnrecognizedWithInner_Inner {
return this.Embedded
}
func (this *UnrecognizedWithInner) GetField2() *string {
return this.Field2
}
func NewUnrecognizedWithInnerFromFace(that UnrecognizedWithInnerFace) *UnrecognizedWithInner {
this := &UnrecognizedWithInner{}
this.Embedded = that.GetEmbedded()
this.Field2 = that.GetField2()
return this
}
type UnrecognizedWithInner_InnerFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *uint32
}
func (this *UnrecognizedWithInner_Inner) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *UnrecognizedWithInner_Inner) TestProto() github_com_gogo_protobuf_proto.Message {
return NewUnrecognizedWithInner_InnerFromFace(this)
}
func (this *UnrecognizedWithInner_Inner) GetField1() *uint32 {
return this.Field1
}
func NewUnrecognizedWithInner_InnerFromFace(that UnrecognizedWithInner_InnerFace) *UnrecognizedWithInner_Inner {
this := &UnrecognizedWithInner_Inner{}
this.Field1 = that.GetField1()
return this
}
type UnrecognizedWithEmbedFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetUnrecognizedWithEmbed_Embedded() UnrecognizedWithEmbed_Embedded
GetField2() *string
}
func (this *UnrecognizedWithEmbed) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *UnrecognizedWithEmbed) TestProto() github_com_gogo_protobuf_proto.Message {
return NewUnrecognizedWithEmbedFromFace(this)
}
func (this *UnrecognizedWithEmbed) GetUnrecognizedWithEmbed_Embedded() UnrecognizedWithEmbed_Embedded {
return this.UnrecognizedWithEmbed_Embedded
}
func (this *UnrecognizedWithEmbed) GetField2() *string {
return this.Field2
}
func NewUnrecognizedWithEmbedFromFace(that UnrecognizedWithEmbedFace) *UnrecognizedWithEmbed {
this := &UnrecognizedWithEmbed{}
this.UnrecognizedWithEmbed_Embedded = that.GetUnrecognizedWithEmbed_Embedded()
this.Field2 = that.GetField2()
return this
}
type UnrecognizedWithEmbed_EmbeddedFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *uint32
}
func (this *UnrecognizedWithEmbed_Embedded) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *UnrecognizedWithEmbed_Embedded) TestProto() github_com_gogo_protobuf_proto.Message {
return NewUnrecognizedWithEmbed_EmbeddedFromFace(this)
}
func (this *UnrecognizedWithEmbed_Embedded) GetField1() *uint32 {
return this.Field1
}
func NewUnrecognizedWithEmbed_EmbeddedFromFace(that UnrecognizedWithEmbed_EmbeddedFace) *UnrecognizedWithEmbed_Embedded {
this := &UnrecognizedWithEmbed_Embedded{}
this.Field1 = that.GetField1()
return this
}
type NodeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetLabel() *string
GetChildren() []*Node
}
func (this *Node) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Node) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNodeFromFace(this)
}
func (this *Node) GetLabel() *string {
return this.Label
}
func (this *Node) GetChildren() []*Node {
return this.Children
}
func NewNodeFromFace(that NodeFace) *Node {
this := &Node{}
this.Label = that.GetLabel()
this.Children = that.GetChildren()
return this
}
type NonByteCustomTypeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *T
}
func (this *NonByteCustomType) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NonByteCustomType) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNonByteCustomTypeFromFace(this)
}
func (this *NonByteCustomType) GetField1() *T {
return this.Field1
}
func NewNonByteCustomTypeFromFace(that NonByteCustomTypeFace) *NonByteCustomType {
this := &NonByteCustomType{}
this.Field1 = that.GetField1()
return this
}
type NidOptNonByteCustomTypeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() T
}
func (this *NidOptNonByteCustomType) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidOptNonByteCustomType) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidOptNonByteCustomTypeFromFace(this)
}
func (this *NidOptNonByteCustomType) GetField1() T {
return this.Field1
}
func NewNidOptNonByteCustomTypeFromFace(that NidOptNonByteCustomTypeFace) *NidOptNonByteCustomType {
this := &NidOptNonByteCustomType{}
this.Field1 = that.GetField1()
return this
}
type NinOptNonByteCustomTypeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() *T
}
func (this *NinOptNonByteCustomType) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinOptNonByteCustomType) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinOptNonByteCustomTypeFromFace(this)
}
func (this *NinOptNonByteCustomType) GetField1() *T {
return this.Field1
}
func NewNinOptNonByteCustomTypeFromFace(that NinOptNonByteCustomTypeFace) *NinOptNonByteCustomType {
this := &NinOptNonByteCustomType{}
this.Field1 = that.GetField1()
return this
}
type NidRepNonByteCustomTypeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []T
}
func (this *NidRepNonByteCustomType) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NidRepNonByteCustomType) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNidRepNonByteCustomTypeFromFace(this)
}
func (this *NidRepNonByteCustomType) GetField1() []T {
return this.Field1
}
func NewNidRepNonByteCustomTypeFromFace(that NidRepNonByteCustomTypeFace) *NidRepNonByteCustomType {
this := &NidRepNonByteCustomType{}
this.Field1 = that.GetField1()
return this
}
type NinRepNonByteCustomTypeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField1() []T
}
func (this *NinRepNonByteCustomType) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *NinRepNonByteCustomType) TestProto() github_com_gogo_protobuf_proto.Message {
return NewNinRepNonByteCustomTypeFromFace(this)
}
func (this *NinRepNonByteCustomType) GetField1() []T {
return this.Field1
}
func NewNinRepNonByteCustomTypeFromFace(that NinRepNonByteCustomTypeFace) *NinRepNonByteCustomType {
this := &NinRepNonByteCustomType{}
this.Field1 = that.GetField1()
return this
}
type ProtoTypeFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetField2() *string
}
func (this *ProtoType) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *ProtoType) TestProto() github_com_gogo_protobuf_proto.Message {
return NewProtoTypeFromFace(this)
}
func (this *ProtoType) GetField2() *string {
return this.Field2
}
func NewProtoTypeFromFace(that ProtoTypeFace) *ProtoType {
this := &ProtoType{}
this.Field2 = that.GetField2()
return this
}
func (this *NidOptNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.NidOptNative{")
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
s = append(s, "Field5: "+fmt.Sprintf("%#v", this.Field5)+",\n")
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
s = append(s, "Field8: "+fmt.Sprintf("%#v", this.Field8)+",\n")
s = append(s, "Field9: "+fmt.Sprintf("%#v", this.Field9)+",\n")
s = append(s, "Field10: "+fmt.Sprintf("%#v", this.Field10)+",\n")
s = append(s, "Field11: "+fmt.Sprintf("%#v", this.Field11)+",\n")
s = append(s, "Field12: "+fmt.Sprintf("%#v", this.Field12)+",\n")
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
s = append(s, "Field14: "+fmt.Sprintf("%#v", this.Field14)+",\n")
s = append(s, "Field15: "+fmt.Sprintf("%#v", this.Field15)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.NinOptNative{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "float64")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "float32")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+valueToGoStringThetest(this.Field3, "int32")+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+valueToGoStringThetest(this.Field4, "int64")+",\n")
}
if this.Field5 != nil {
s = append(s, "Field5: "+valueToGoStringThetest(this.Field5, "uint32")+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+valueToGoStringThetest(this.Field6, "uint64")+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+valueToGoStringThetest(this.Field7, "int32")+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+valueToGoStringThetest(this.Field8, "int64")+",\n")
}
if this.Field9 != nil {
s = append(s, "Field9: "+valueToGoStringThetest(this.Field9, "uint32")+",\n")
}
if this.Field10 != nil {
s = append(s, "Field10: "+valueToGoStringThetest(this.Field10, "int32")+",\n")
}
if this.Field11 != nil {
s = append(s, "Field11: "+valueToGoStringThetest(this.Field11, "uint64")+",\n")
}
if this.Field12 != nil {
s = append(s, "Field12: "+valueToGoStringThetest(this.Field12, "int64")+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+valueToGoStringThetest(this.Field13, "bool")+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+valueToGoStringThetest(this.Field14, "string")+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+valueToGoStringThetest(this.Field15, "byte")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidRepNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.NidRepNative{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
}
if this.Field5 != nil {
s = append(s, "Field5: "+fmt.Sprintf("%#v", this.Field5)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+fmt.Sprintf("%#v", this.Field8)+",\n")
}
if this.Field9 != nil {
s = append(s, "Field9: "+fmt.Sprintf("%#v", this.Field9)+",\n")
}
if this.Field10 != nil {
s = append(s, "Field10: "+fmt.Sprintf("%#v", this.Field10)+",\n")
}
if this.Field11 != nil {
s = append(s, "Field11: "+fmt.Sprintf("%#v", this.Field11)+",\n")
}
if this.Field12 != nil {
s = append(s, "Field12: "+fmt.Sprintf("%#v", this.Field12)+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+fmt.Sprintf("%#v", this.Field14)+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+fmt.Sprintf("%#v", this.Field15)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinRepNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.NinRepNative{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
}
if this.Field5 != nil {
s = append(s, "Field5: "+fmt.Sprintf("%#v", this.Field5)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+fmt.Sprintf("%#v", this.Field8)+",\n")
}
if this.Field9 != nil {
s = append(s, "Field9: "+fmt.Sprintf("%#v", this.Field9)+",\n")
}
if this.Field10 != nil {
s = append(s, "Field10: "+fmt.Sprintf("%#v", this.Field10)+",\n")
}
if this.Field11 != nil {
s = append(s, "Field11: "+fmt.Sprintf("%#v", this.Field11)+",\n")
}
if this.Field12 != nil {
s = append(s, "Field12: "+fmt.Sprintf("%#v", this.Field12)+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+fmt.Sprintf("%#v", this.Field14)+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+fmt.Sprintf("%#v", this.Field15)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidRepPackedNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 17)
s = append(s, "&test.NidRepPackedNative{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
}
if this.Field5 != nil {
s = append(s, "Field5: "+fmt.Sprintf("%#v", this.Field5)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+fmt.Sprintf("%#v", this.Field8)+",\n")
}
if this.Field9 != nil {
s = append(s, "Field9: "+fmt.Sprintf("%#v", this.Field9)+",\n")
}
if this.Field10 != nil {
s = append(s, "Field10: "+fmt.Sprintf("%#v", this.Field10)+",\n")
}
if this.Field11 != nil {
s = append(s, "Field11: "+fmt.Sprintf("%#v", this.Field11)+",\n")
}
if this.Field12 != nil {
s = append(s, "Field12: "+fmt.Sprintf("%#v", this.Field12)+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinRepPackedNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 17)
s = append(s, "&test.NinRepPackedNative{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
}
if this.Field5 != nil {
s = append(s, "Field5: "+fmt.Sprintf("%#v", this.Field5)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+fmt.Sprintf("%#v", this.Field8)+",\n")
}
if this.Field9 != nil {
s = append(s, "Field9: "+fmt.Sprintf("%#v", this.Field9)+",\n")
}
if this.Field10 != nil {
s = append(s, "Field10: "+fmt.Sprintf("%#v", this.Field10)+",\n")
}
if this.Field11 != nil {
s = append(s, "Field11: "+fmt.Sprintf("%#v", this.Field11)+",\n")
}
if this.Field12 != nil {
s = append(s, "Field12: "+fmt.Sprintf("%#v", this.Field12)+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidOptStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 14)
s = append(s, "&test.NidOptStruct{")
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
s = append(s, "Field3: "+strings.Replace(this.Field3.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Field4: "+strings.Replace(this.Field4.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
s = append(s, "Field8: "+strings.Replace(this.Field8.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
s = append(s, "Field14: "+fmt.Sprintf("%#v", this.Field14)+",\n")
s = append(s, "Field15: "+fmt.Sprintf("%#v", this.Field15)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 14)
s = append(s, "&test.NinOptStruct{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "float64")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "float32")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+valueToGoStringThetest(this.Field6, "uint64")+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+valueToGoStringThetest(this.Field7, "int32")+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+fmt.Sprintf("%#v", this.Field8)+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+valueToGoStringThetest(this.Field13, "bool")+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+valueToGoStringThetest(this.Field14, "string")+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+valueToGoStringThetest(this.Field15, "byte")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidRepStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 14)
s = append(s, "&test.NidRepStruct{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
vs := make([]*NidOptNative, len(this.Field3))
for i := range vs {
vs[i] = &this.Field3[i]
}
s = append(s, "Field3: "+fmt.Sprintf("%#v", vs)+",\n")
}
if this.Field4 != nil {
vs := make([]*NinOptNative, len(this.Field4))
for i := range vs {
vs[i] = &this.Field4[i]
}
s = append(s, "Field4: "+fmt.Sprintf("%#v", vs)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
}
if this.Field8 != nil {
vs := make([]*NidOptNative, len(this.Field8))
for i := range vs {
vs[i] = &this.Field8[i]
}
s = append(s, "Field8: "+fmt.Sprintf("%#v", vs)+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+fmt.Sprintf("%#v", this.Field14)+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+fmt.Sprintf("%#v", this.Field15)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinRepStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 14)
s = append(s, "&test.NinRepStruct{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+fmt.Sprintf("%#v", this.Field6)+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+fmt.Sprintf("%#v", this.Field7)+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+fmt.Sprintf("%#v", this.Field8)+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+fmt.Sprintf("%#v", this.Field13)+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+fmt.Sprintf("%#v", this.Field14)+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+fmt.Sprintf("%#v", this.Field15)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidEmbeddedStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NidEmbeddedStruct{")
if this.NidOptNative != nil {
s = append(s, "NidOptNative: "+fmt.Sprintf("%#v", this.NidOptNative)+",\n")
}
s = append(s, "Field200: "+strings.Replace(this.Field200.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Field210: "+fmt.Sprintf("%#v", this.Field210)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinEmbeddedStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NinEmbeddedStruct{")
if this.NidOptNative != nil {
s = append(s, "NidOptNative: "+fmt.Sprintf("%#v", this.NidOptNative)+",\n")
}
if this.Field200 != nil {
s = append(s, "Field200: "+fmt.Sprintf("%#v", this.Field200)+",\n")
}
if this.Field210 != nil {
s = append(s, "Field210: "+valueToGoStringThetest(this.Field210, "bool")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidNestedStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.NidNestedStruct{")
s = append(s, "Field1: "+strings.Replace(this.Field1.GoString(), `&`, ``, 1)+",\n")
if this.Field2 != nil {
vs := make([]*NidRepStruct, len(this.Field2))
for i := range vs {
vs[i] = &this.Field2[i]
}
s = append(s, "Field2: "+fmt.Sprintf("%#v", vs)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinNestedStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.NinNestedStruct{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidOptCustom) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.NidOptCustom{")
s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n")
s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomDash) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.CustomDash{")
if this.Value != nil {
s = append(s, "Value: "+valueToGoStringThetest(this.Value, "github_com_gogo_protobuf_test_custom_dash_type.Bytes")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptCustom) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.NinOptCustom{")
if this.Id != nil {
s = append(s, "Id: "+valueToGoStringThetest(this.Id, "Uuid")+",\n")
}
if this.Value != nil {
s = append(s, "Value: "+valueToGoStringThetest(this.Value, "github_com_gogo_protobuf_test_custom.Uint128")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidRepCustom) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.NidRepCustom{")
if this.Id != nil {
s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n")
}
if this.Value != nil {
s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinRepCustom) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.NinRepCustom{")
if this.Id != nil {
s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n")
}
if this.Value != nil {
s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptNativeUnion) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 13)
s = append(s, "&test.NinOptNativeUnion{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "float64")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "float32")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+valueToGoStringThetest(this.Field3, "int32")+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+valueToGoStringThetest(this.Field4, "int64")+",\n")
}
if this.Field5 != nil {
s = append(s, "Field5: "+valueToGoStringThetest(this.Field5, "uint32")+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+valueToGoStringThetest(this.Field6, "uint64")+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+valueToGoStringThetest(this.Field13, "bool")+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+valueToGoStringThetest(this.Field14, "string")+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+valueToGoStringThetest(this.Field15, "byte")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptStructUnion) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 13)
s = append(s, "&test.NinOptStructUnion{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "float64")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "float32")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+fmt.Sprintf("%#v", this.Field4)+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+valueToGoStringThetest(this.Field6, "uint64")+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+valueToGoStringThetest(this.Field7, "int32")+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+valueToGoStringThetest(this.Field13, "bool")+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+valueToGoStringThetest(this.Field14, "string")+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+valueToGoStringThetest(this.Field15, "byte")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinEmbeddedStructUnion) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NinEmbeddedStructUnion{")
if this.NidOptNative != nil {
s = append(s, "NidOptNative: "+fmt.Sprintf("%#v", this.NidOptNative)+",\n")
}
if this.Field200 != nil {
s = append(s, "Field200: "+fmt.Sprintf("%#v", this.Field200)+",\n")
}
if this.Field210 != nil {
s = append(s, "Field210: "+valueToGoStringThetest(this.Field210, "bool")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinNestedStructUnion) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NinNestedStructUnion{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Tree) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.Tree{")
if this.Or != nil {
s = append(s, "Or: "+fmt.Sprintf("%#v", this.Or)+",\n")
}
if this.And != nil {
s = append(s, "And: "+fmt.Sprintf("%#v", this.And)+",\n")
}
if this.Leaf != nil {
s = append(s, "Leaf: "+fmt.Sprintf("%#v", this.Leaf)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *OrBranch) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.OrBranch{")
s = append(s, "Left: "+strings.Replace(this.Left.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Right: "+strings.Replace(this.Right.GoString(), `&`, ``, 1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *AndBranch) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.AndBranch{")
s = append(s, "Left: "+strings.Replace(this.Left.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Right: "+strings.Replace(this.Right.GoString(), `&`, ``, 1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Leaf) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.Leaf{")
s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
s = append(s, "StrValue: "+fmt.Sprintf("%#v", this.StrValue)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *DeepTree) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.DeepTree{")
if this.Down != nil {
s = append(s, "Down: "+fmt.Sprintf("%#v", this.Down)+",\n")
}
if this.And != nil {
s = append(s, "And: "+fmt.Sprintf("%#v", this.And)+",\n")
}
if this.Leaf != nil {
s = append(s, "Leaf: "+fmt.Sprintf("%#v", this.Leaf)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *ADeepBranch) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.ADeepBranch{")
s = append(s, "Down: "+strings.Replace(this.Down.GoString(), `&`, ``, 1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *AndDeepBranch) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.AndDeepBranch{")
s = append(s, "Left: "+strings.Replace(this.Left.GoString(), `&`, ``, 1)+",\n")
s = append(s, "Right: "+strings.Replace(this.Right.GoString(), `&`, ``, 1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *DeepLeaf) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.DeepLeaf{")
s = append(s, "Tree: "+strings.Replace(this.Tree.GoString(), `&`, ``, 1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Nil) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 4)
s = append(s, "&test.Nil{")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidOptEnum) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NidOptEnum{")
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptEnum) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NinOptEnum{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "TheTestEnum")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "YetAnotherTestEnum")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+valueToGoStringThetest(this.Field3, "YetYetAnotherTestEnum")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidRepEnum) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NidRepEnum{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinRepEnum) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NinRepEnum{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+fmt.Sprintf("%#v", this.Field2)+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+fmt.Sprintf("%#v", this.Field3)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptEnumDefault) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NinOptEnumDefault{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "TheTestEnum")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "YetAnotherTestEnum")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+valueToGoStringThetest(this.Field3, "YetYetAnotherTestEnum")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *AnotherNinOptEnum) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.AnotherNinOptEnum{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "AnotherTestEnum")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "YetAnotherTestEnum")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+valueToGoStringThetest(this.Field3, "YetYetAnotherTestEnum")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *AnotherNinOptEnumDefault) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.AnotherNinOptEnumDefault{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "AnotherTestEnum")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "YetAnotherTestEnum")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+valueToGoStringThetest(this.Field3, "YetYetAnotherTestEnum")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Timer) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.Timer{")
s = append(s, "Time1: "+fmt.Sprintf("%#v", this.Time1)+",\n")
s = append(s, "Time2: "+fmt.Sprintf("%#v", this.Time2)+",\n")
s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *MyExtendable) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.MyExtendable{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "int64")+",\n")
}
s = append(s, "XXX_InternalExtensions: "+extensionToGoStringThetest(this)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *OtherExtenable) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.OtherExtenable{")
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "int64")+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+valueToGoStringThetest(this.Field13, "int64")+",\n")
}
if this.M != nil {
s = append(s, "M: "+fmt.Sprintf("%#v", this.M)+",\n")
}
s = append(s, "XXX_InternalExtensions: "+extensionToGoStringThetest(this)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NestedDefinition) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 8)
s = append(s, "&test.NestedDefinition{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "int64")+",\n")
}
if this.EnumField != nil {
s = append(s, "EnumField: "+valueToGoStringThetest(this.EnumField, "NestedDefinition_NestedEnum")+",\n")
}
if this.NNM != nil {
s = append(s, "NNM: "+fmt.Sprintf("%#v", this.NNM)+",\n")
}
if this.NM != nil {
s = append(s, "NM: "+fmt.Sprintf("%#v", this.NM)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NestedDefinition_NestedMessage) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.NestedDefinition_NestedMessage{")
if this.NestedField1 != nil {
s = append(s, "NestedField1: "+valueToGoStringThetest(this.NestedField1, "uint64")+",\n")
}
if this.NNM != nil {
s = append(s, "NNM: "+fmt.Sprintf("%#v", this.NNM)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NestedDefinition_NestedMessage_NestedNestedMsg{")
if this.NestedNestedField1 != nil {
s = append(s, "NestedNestedField1: "+valueToGoStringThetest(this.NestedNestedField1, "string")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NestedScope) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.NestedScope{")
if this.A != nil {
s = append(s, "A: "+fmt.Sprintf("%#v", this.A)+",\n")
}
if this.B != nil {
s = append(s, "B: "+valueToGoStringThetest(this.B, "NestedDefinition_NestedEnum")+",\n")
}
if this.C != nil {
s = append(s, "C: "+fmt.Sprintf("%#v", this.C)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptNativeDefault) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.NinOptNativeDefault{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "float64")+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "float32")+",\n")
}
if this.Field3 != nil {
s = append(s, "Field3: "+valueToGoStringThetest(this.Field3, "int32")+",\n")
}
if this.Field4 != nil {
s = append(s, "Field4: "+valueToGoStringThetest(this.Field4, "int64")+",\n")
}
if this.Field5 != nil {
s = append(s, "Field5: "+valueToGoStringThetest(this.Field5, "uint32")+",\n")
}
if this.Field6 != nil {
s = append(s, "Field6: "+valueToGoStringThetest(this.Field6, "uint64")+",\n")
}
if this.Field7 != nil {
s = append(s, "Field7: "+valueToGoStringThetest(this.Field7, "int32")+",\n")
}
if this.Field8 != nil {
s = append(s, "Field8: "+valueToGoStringThetest(this.Field8, "int64")+",\n")
}
if this.Field9 != nil {
s = append(s, "Field9: "+valueToGoStringThetest(this.Field9, "uint32")+",\n")
}
if this.Field10 != nil {
s = append(s, "Field10: "+valueToGoStringThetest(this.Field10, "int32")+",\n")
}
if this.Field11 != nil {
s = append(s, "Field11: "+valueToGoStringThetest(this.Field11, "uint64")+",\n")
}
if this.Field12 != nil {
s = append(s, "Field12: "+valueToGoStringThetest(this.Field12, "int64")+",\n")
}
if this.Field13 != nil {
s = append(s, "Field13: "+valueToGoStringThetest(this.Field13, "bool")+",\n")
}
if this.Field14 != nil {
s = append(s, "Field14: "+valueToGoStringThetest(this.Field14, "string")+",\n")
}
if this.Field15 != nil {
s = append(s, "Field15: "+valueToGoStringThetest(this.Field15, "byte")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomContainer) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.CustomContainer{")
s = append(s, "CustomStruct: "+strings.Replace(this.CustomStruct.GoString(), `&`, ``, 1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomNameNidOptNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.CustomNameNidOptNative{")
s = append(s, "FieldA: "+fmt.Sprintf("%#v", this.FieldA)+",\n")
s = append(s, "FieldB: "+fmt.Sprintf("%#v", this.FieldB)+",\n")
s = append(s, "FieldC: "+fmt.Sprintf("%#v", this.FieldC)+",\n")
s = append(s, "FieldD: "+fmt.Sprintf("%#v", this.FieldD)+",\n")
s = append(s, "FieldE: "+fmt.Sprintf("%#v", this.FieldE)+",\n")
s = append(s, "FieldF: "+fmt.Sprintf("%#v", this.FieldF)+",\n")
s = append(s, "FieldG: "+fmt.Sprintf("%#v", this.FieldG)+",\n")
s = append(s, "FieldH: "+fmt.Sprintf("%#v", this.FieldH)+",\n")
s = append(s, "FieldI: "+fmt.Sprintf("%#v", this.FieldI)+",\n")
s = append(s, "FieldJ: "+fmt.Sprintf("%#v", this.FieldJ)+",\n")
s = append(s, "FieldK: "+fmt.Sprintf("%#v", this.FieldK)+",\n")
s = append(s, "FieldL: "+fmt.Sprintf("%#v", this.FieldL)+",\n")
s = append(s, "FieldM: "+fmt.Sprintf("%#v", this.FieldM)+",\n")
s = append(s, "FieldN: "+fmt.Sprintf("%#v", this.FieldN)+",\n")
s = append(s, "FieldO: "+fmt.Sprintf("%#v", this.FieldO)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomNameNinOptNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.CustomNameNinOptNative{")
if this.FieldA != nil {
s = append(s, "FieldA: "+valueToGoStringThetest(this.FieldA, "float64")+",\n")
}
if this.FieldB != nil {
s = append(s, "FieldB: "+valueToGoStringThetest(this.FieldB, "float32")+",\n")
}
if this.FieldC != nil {
s = append(s, "FieldC: "+valueToGoStringThetest(this.FieldC, "int32")+",\n")
}
if this.FieldD != nil {
s = append(s, "FieldD: "+valueToGoStringThetest(this.FieldD, "int64")+",\n")
}
if this.FieldE != nil {
s = append(s, "FieldE: "+valueToGoStringThetest(this.FieldE, "uint32")+",\n")
}
if this.FieldF != nil {
s = append(s, "FieldF: "+valueToGoStringThetest(this.FieldF, "uint64")+",\n")
}
if this.FieldG != nil {
s = append(s, "FieldG: "+valueToGoStringThetest(this.FieldG, "int32")+",\n")
}
if this.FieldH != nil {
s = append(s, "FieldH: "+valueToGoStringThetest(this.FieldH, "int64")+",\n")
}
if this.FieldI != nil {
s = append(s, "FieldI: "+valueToGoStringThetest(this.FieldI, "uint32")+",\n")
}
if this.FieldJ != nil {
s = append(s, "FieldJ: "+valueToGoStringThetest(this.FieldJ, "int32")+",\n")
}
if this.FieldK != nil {
s = append(s, "FieldK: "+valueToGoStringThetest(this.FieldK, "uint64")+",\n")
}
if this.FielL != nil {
s = append(s, "FielL: "+valueToGoStringThetest(this.FielL, "int64")+",\n")
}
if this.FieldM != nil {
s = append(s, "FieldM: "+valueToGoStringThetest(this.FieldM, "bool")+",\n")
}
if this.FieldN != nil {
s = append(s, "FieldN: "+valueToGoStringThetest(this.FieldN, "string")+",\n")
}
if this.FieldO != nil {
s = append(s, "FieldO: "+valueToGoStringThetest(this.FieldO, "byte")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomNameNinRepNative) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 19)
s = append(s, "&test.CustomNameNinRepNative{")
if this.FieldA != nil {
s = append(s, "FieldA: "+fmt.Sprintf("%#v", this.FieldA)+",\n")
}
if this.FieldB != nil {
s = append(s, "FieldB: "+fmt.Sprintf("%#v", this.FieldB)+",\n")
}
if this.FieldC != nil {
s = append(s, "FieldC: "+fmt.Sprintf("%#v", this.FieldC)+",\n")
}
if this.FieldD != nil {
s = append(s, "FieldD: "+fmt.Sprintf("%#v", this.FieldD)+",\n")
}
if this.FieldE != nil {
s = append(s, "FieldE: "+fmt.Sprintf("%#v", this.FieldE)+",\n")
}
if this.FieldF != nil {
s = append(s, "FieldF: "+fmt.Sprintf("%#v", this.FieldF)+",\n")
}
if this.FieldG != nil {
s = append(s, "FieldG: "+fmt.Sprintf("%#v", this.FieldG)+",\n")
}
if this.FieldH != nil {
s = append(s, "FieldH: "+fmt.Sprintf("%#v", this.FieldH)+",\n")
}
if this.FieldI != nil {
s = append(s, "FieldI: "+fmt.Sprintf("%#v", this.FieldI)+",\n")
}
if this.FieldJ != nil {
s = append(s, "FieldJ: "+fmt.Sprintf("%#v", this.FieldJ)+",\n")
}
if this.FieldK != nil {
s = append(s, "FieldK: "+fmt.Sprintf("%#v", this.FieldK)+",\n")
}
if this.FieldL != nil {
s = append(s, "FieldL: "+fmt.Sprintf("%#v", this.FieldL)+",\n")
}
if this.FieldM != nil {
s = append(s, "FieldM: "+fmt.Sprintf("%#v", this.FieldM)+",\n")
}
if this.FieldN != nil {
s = append(s, "FieldN: "+fmt.Sprintf("%#v", this.FieldN)+",\n")
}
if this.FieldO != nil {
s = append(s, "FieldO: "+fmt.Sprintf("%#v", this.FieldO)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomNameNinStruct) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 14)
s = append(s, "&test.CustomNameNinStruct{")
if this.FieldA != nil {
s = append(s, "FieldA: "+valueToGoStringThetest(this.FieldA, "float64")+",\n")
}
if this.FieldB != nil {
s = append(s, "FieldB: "+valueToGoStringThetest(this.FieldB, "float32")+",\n")
}
if this.FieldC != nil {
s = append(s, "FieldC: "+fmt.Sprintf("%#v", this.FieldC)+",\n")
}
if this.FieldD != nil {
s = append(s, "FieldD: "+fmt.Sprintf("%#v", this.FieldD)+",\n")
}
if this.FieldE != nil {
s = append(s, "FieldE: "+valueToGoStringThetest(this.FieldE, "uint64")+",\n")
}
if this.FieldF != nil {
s = append(s, "FieldF: "+valueToGoStringThetest(this.FieldF, "int32")+",\n")
}
if this.FieldG != nil {
s = append(s, "FieldG: "+fmt.Sprintf("%#v", this.FieldG)+",\n")
}
if this.FieldH != nil {
s = append(s, "FieldH: "+valueToGoStringThetest(this.FieldH, "bool")+",\n")
}
if this.FieldI != nil {
s = append(s, "FieldI: "+valueToGoStringThetest(this.FieldI, "string")+",\n")
}
if this.FieldJ != nil {
s = append(s, "FieldJ: "+valueToGoStringThetest(this.FieldJ, "byte")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomNameCustomType) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 8)
s = append(s, "&test.CustomNameCustomType{")
if this.FieldA != nil {
s = append(s, "FieldA: "+valueToGoStringThetest(this.FieldA, "Uuid")+",\n")
}
if this.FieldB != nil {
s = append(s, "FieldB: "+valueToGoStringThetest(this.FieldB, "github_com_gogo_protobuf_test_custom.Uint128")+",\n")
}
if this.FieldC != nil {
s = append(s, "FieldC: "+fmt.Sprintf("%#v", this.FieldC)+",\n")
}
if this.FieldD != nil {
s = append(s, "FieldD: "+fmt.Sprintf("%#v", this.FieldD)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomNameNinEmbeddedStructUnion) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&test.CustomNameNinEmbeddedStructUnion{")
if this.NidOptNative != nil {
s = append(s, "NidOptNative: "+fmt.Sprintf("%#v", this.NidOptNative)+",\n")
}
if this.FieldA != nil {
s = append(s, "FieldA: "+fmt.Sprintf("%#v", this.FieldA)+",\n")
}
if this.FieldB != nil {
s = append(s, "FieldB: "+valueToGoStringThetest(this.FieldB, "bool")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *CustomNameEnum) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.CustomNameEnum{")
if this.FieldA != nil {
s = append(s, "FieldA: "+valueToGoStringThetest(this.FieldA, "TheTestEnum")+",\n")
}
if this.FieldB != nil {
s = append(s, "FieldB: "+fmt.Sprintf("%#v", this.FieldB)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NoExtensionsMap) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NoExtensionsMap{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "int64")+",\n")
}
if this.XXX_extensions != nil {
s = append(s, "XXX_extensions: "+fmt.Sprintf("%#v", this.XXX_extensions)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Unrecognized) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.Unrecognized{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "string")+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *UnrecognizedWithInner) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.UnrecognizedWithInner{")
if this.Embedded != nil {
s = append(s, "Embedded: "+fmt.Sprintf("%#v", this.Embedded)+",\n")
}
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "string")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *UnrecognizedWithInner_Inner) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.UnrecognizedWithInner_Inner{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "uint32")+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *UnrecognizedWithEmbed) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.UnrecognizedWithEmbed{")
s = append(s, "UnrecognizedWithEmbed_Embedded: "+strings.Replace(this.UnrecognizedWithEmbed_Embedded.GoString(), `&`, ``, 1)+",\n")
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "string")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *UnrecognizedWithEmbed_Embedded) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.UnrecognizedWithEmbed_Embedded{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "uint32")+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Node) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&test.Node{")
if this.Label != nil {
s = append(s, "Label: "+valueToGoStringThetest(this.Label, "string")+",\n")
}
if this.Children != nil {
s = append(s, "Children: "+fmt.Sprintf("%#v", this.Children)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NonByteCustomType) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NonByteCustomType{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "T")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidOptNonByteCustomType) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NidOptNonByteCustomType{")
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinOptNonByteCustomType) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NinOptNonByteCustomType{")
if this.Field1 != nil {
s = append(s, "Field1: "+valueToGoStringThetest(this.Field1, "T")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NidRepNonByteCustomType) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NidRepNonByteCustomType{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *NinRepNonByteCustomType) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.NinRepNonByteCustomType{")
if this.Field1 != nil {
s = append(s, "Field1: "+fmt.Sprintf("%#v", this.Field1)+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *ProtoType) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&test.ProtoType{")
if this.Field2 != nil {
s = append(s, "Field2: "+valueToGoStringThetest(this.Field2, "string")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringThetest(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func extensionToGoStringThetest(m github_com_gogo_protobuf_proto.Message) string {
e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
if e == nil {
return "nil"
}
s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{"
keys := make([]int, 0, len(e))
for k := range e {
keys = append(keys, int(k))
}
sort.Ints(keys)
ss := []string{}
for _, k := range keys {
ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
}
s += strings.Join(ss, ",") + "})"
return s
}
func (m *NidOptNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidOptNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(m.Field1))))
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(m.Field2))))
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field3))
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field4))
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field5))
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field6))
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(m.Field7)<<1)^uint32((m.Field7>>31))))
dAtA[i] = 0x40
i++
i = encodeVarintThetest(dAtA, i, uint64((uint64(m.Field8)<<1)^uint64((m.Field8>>63))))
dAtA[i] = 0x4d
i++
i = encodeFixed32Thetest(dAtA, i, uint32(m.Field9))
dAtA[i] = 0x55
i++
i = encodeFixed32Thetest(dAtA, i, uint32(m.Field10))
dAtA[i] = 0x59
i++
i = encodeFixed64Thetest(dAtA, i, uint64(m.Field11))
dAtA[i] = 0x61
i++
i = encodeFixed64Thetest(dAtA, i, uint64(m.Field12))
dAtA[i] = 0x68
i++
if m.Field13 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field14)))
i += copy(dAtA[i:], m.Field14)
if m.Field15 != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field15)))
i += copy(dAtA[i:], m.Field15)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(*m.Field1))))
}
if m.Field2 != nil {
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(*m.Field2))))
}
if m.Field3 != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field3))
}
if m.Field4 != nil {
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field4))
}
if m.Field5 != nil {
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field5))
}
if m.Field6 != nil {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field6))
}
if m.Field7 != nil {
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(*m.Field7)<<1)^uint32((*m.Field7>>31))))
}
if m.Field8 != nil {
dAtA[i] = 0x40
i++
i = encodeVarintThetest(dAtA, i, uint64((uint64(*m.Field8)<<1)^uint64((*m.Field8>>63))))
}
if m.Field9 != nil {
dAtA[i] = 0x4d
i++
i = encodeFixed32Thetest(dAtA, i, uint32(*m.Field9))
}
if m.Field10 != nil {
dAtA[i] = 0x55
i++
i = encodeFixed32Thetest(dAtA, i, uint32(*m.Field10))
}
if m.Field11 != nil {
dAtA[i] = 0x59
i++
i = encodeFixed64Thetest(dAtA, i, uint64(*m.Field11))
}
if m.Field12 != nil {
dAtA[i] = 0x61
i++
i = encodeFixed64Thetest(dAtA, i, uint64(*m.Field12))
}
if m.Field13 != nil {
dAtA[i] = 0x68
i++
if *m.Field13 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.Field14 != nil {
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field14)))
i += copy(dAtA[i:], *m.Field14)
}
if m.Field15 != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field15)))
i += copy(dAtA[i:], m.Field15)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidRepNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidRepNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, num := range m.Field1 {
dAtA[i] = 0x9
i++
f1 := math.Float64bits(float64(num))
dAtA[i] = uint8(f1)
i++
dAtA[i] = uint8(f1 >> 8)
i++
dAtA[i] = uint8(f1 >> 16)
i++
dAtA[i] = uint8(f1 >> 24)
i++
dAtA[i] = uint8(f1 >> 32)
i++
dAtA[i] = uint8(f1 >> 40)
i++
dAtA[i] = uint8(f1 >> 48)
i++
dAtA[i] = uint8(f1 >> 56)
i++
}
}
if len(m.Field2) > 0 {
for _, num := range m.Field2 {
dAtA[i] = 0x15
i++
f2 := math.Float32bits(float32(num))
dAtA[i] = uint8(f2)
i++
dAtA[i] = uint8(f2 >> 8)
i++
dAtA[i] = uint8(f2 >> 16)
i++
dAtA[i] = uint8(f2 >> 24)
i++
}
}
if len(m.Field3) > 0 {
for _, num := range m.Field3 {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field4) > 0 {
for _, num := range m.Field4 {
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field5) > 0 {
for _, num := range m.Field5 {
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field6) > 0 {
for _, num := range m.Field6 {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field7) > 0 {
for _, num := range m.Field7 {
dAtA[i] = 0x38
i++
x3 := (uint32(num) << 1) ^ uint32((num >> 31))
for x3 >= 1<<7 {
dAtA[i] = uint8(uint64(x3)&0x7f | 0x80)
x3 >>= 7
i++
}
dAtA[i] = uint8(x3)
i++
}
}
if len(m.Field8) > 0 {
for _, num := range m.Field8 {
dAtA[i] = 0x40
i++
x4 := (uint64(num) << 1) ^ uint64((num >> 63))
for x4 >= 1<<7 {
dAtA[i] = uint8(uint64(x4)&0x7f | 0x80)
x4 >>= 7
i++
}
dAtA[i] = uint8(x4)
i++
}
}
if len(m.Field9) > 0 {
for _, num := range m.Field9 {
dAtA[i] = 0x4d
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field10) > 0 {
for _, num := range m.Field10 {
dAtA[i] = 0x55
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field11) > 0 {
for _, num := range m.Field11 {
dAtA[i] = 0x59
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field12) > 0 {
for _, num := range m.Field12 {
dAtA[i] = 0x61
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field13) > 0 {
for _, b := range m.Field13 {
dAtA[i] = 0x68
i++
if b {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
dAtA[i] = 0x72
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(b)))
i += copy(dAtA[i:], b)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinRepNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinRepNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, num := range m.Field1 {
dAtA[i] = 0x9
i++
f5 := math.Float64bits(float64(num))
dAtA[i] = uint8(f5)
i++
dAtA[i] = uint8(f5 >> 8)
i++
dAtA[i] = uint8(f5 >> 16)
i++
dAtA[i] = uint8(f5 >> 24)
i++
dAtA[i] = uint8(f5 >> 32)
i++
dAtA[i] = uint8(f5 >> 40)
i++
dAtA[i] = uint8(f5 >> 48)
i++
dAtA[i] = uint8(f5 >> 56)
i++
}
}
if len(m.Field2) > 0 {
for _, num := range m.Field2 {
dAtA[i] = 0x15
i++
f6 := math.Float32bits(float32(num))
dAtA[i] = uint8(f6)
i++
dAtA[i] = uint8(f6 >> 8)
i++
dAtA[i] = uint8(f6 >> 16)
i++
dAtA[i] = uint8(f6 >> 24)
i++
}
}
if len(m.Field3) > 0 {
for _, num := range m.Field3 {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field4) > 0 {
for _, num := range m.Field4 {
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field5) > 0 {
for _, num := range m.Field5 {
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field6) > 0 {
for _, num := range m.Field6 {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field7) > 0 {
for _, num := range m.Field7 {
dAtA[i] = 0x38
i++
x7 := (uint32(num) << 1) ^ uint32((num >> 31))
for x7 >= 1<<7 {
dAtA[i] = uint8(uint64(x7)&0x7f | 0x80)
x7 >>= 7
i++
}
dAtA[i] = uint8(x7)
i++
}
}
if len(m.Field8) > 0 {
for _, num := range m.Field8 {
dAtA[i] = 0x40
i++
x8 := (uint64(num) << 1) ^ uint64((num >> 63))
for x8 >= 1<<7 {
dAtA[i] = uint8(uint64(x8)&0x7f | 0x80)
x8 >>= 7
i++
}
dAtA[i] = uint8(x8)
i++
}
}
if len(m.Field9) > 0 {
for _, num := range m.Field9 {
dAtA[i] = 0x4d
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field10) > 0 {
for _, num := range m.Field10 {
dAtA[i] = 0x55
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field11) > 0 {
for _, num := range m.Field11 {
dAtA[i] = 0x59
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field12) > 0 {
for _, num := range m.Field12 {
dAtA[i] = 0x61
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field13) > 0 {
for _, b := range m.Field13 {
dAtA[i] = 0x68
i++
if b {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
dAtA[i] = 0x72
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(b)))
i += copy(dAtA[i:], b)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidRepPackedNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidRepPackedNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field1)*8))
for _, num := range m.Field1 {
f9 := math.Float64bits(float64(num))
dAtA[i] = uint8(f9)
i++
dAtA[i] = uint8(f9 >> 8)
i++
dAtA[i] = uint8(f9 >> 16)
i++
dAtA[i] = uint8(f9 >> 24)
i++
dAtA[i] = uint8(f9 >> 32)
i++
dAtA[i] = uint8(f9 >> 40)
i++
dAtA[i] = uint8(f9 >> 48)
i++
dAtA[i] = uint8(f9 >> 56)
i++
}
}
if len(m.Field2) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field2)*4))
for _, num := range m.Field2 {
f10 := math.Float32bits(float32(num))
dAtA[i] = uint8(f10)
i++
dAtA[i] = uint8(f10 >> 8)
i++
dAtA[i] = uint8(f10 >> 16)
i++
dAtA[i] = uint8(f10 >> 24)
i++
}
}
if len(m.Field3) > 0 {
dAtA12 := make([]byte, len(m.Field3)*10)
var j11 int
for _, num1 := range m.Field3 {
num := uint64(num1)
for num >= 1<<7 {
dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j11++
}
dAtA12[j11] = uint8(num)
j11++
}
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(j11))
i += copy(dAtA[i:], dAtA12[:j11])
}
if len(m.Field4) > 0 {
dAtA14 := make([]byte, len(m.Field4)*10)
var j13 int
for _, num1 := range m.Field4 {
num := uint64(num1)
for num >= 1<<7 {
dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j13++
}
dAtA14[j13] = uint8(num)
j13++
}
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(j13))
i += copy(dAtA[i:], dAtA14[:j13])
}
if len(m.Field5) > 0 {
dAtA16 := make([]byte, len(m.Field5)*10)
var j15 int
for _, num := range m.Field5 {
for num >= 1<<7 {
dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j15++
}
dAtA16[j15] = uint8(num)
j15++
}
dAtA[i] = 0x2a
i++
i = encodeVarintThetest(dAtA, i, uint64(j15))
i += copy(dAtA[i:], dAtA16[:j15])
}
if len(m.Field6) > 0 {
dAtA18 := make([]byte, len(m.Field6)*10)
var j17 int
for _, num := range m.Field6 {
for num >= 1<<7 {
dAtA18[j17] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j17++
}
dAtA18[j17] = uint8(num)
j17++
}
dAtA[i] = 0x32
i++
i = encodeVarintThetest(dAtA, i, uint64(j17))
i += copy(dAtA[i:], dAtA18[:j17])
}
if len(m.Field7) > 0 {
dAtA19 := make([]byte, len(m.Field7)*5)
var j20 int
for _, num := range m.Field7 {
x21 := (uint32(num) << 1) ^ uint32((num >> 31))
for x21 >= 1<<7 {
dAtA19[j20] = uint8(uint64(x21)&0x7f | 0x80)
j20++
x21 >>= 7
}
dAtA19[j20] = uint8(x21)
j20++
}
dAtA[i] = 0x3a
i++
i = encodeVarintThetest(dAtA, i, uint64(j20))
i += copy(dAtA[i:], dAtA19[:j20])
}
if len(m.Field8) > 0 {
var j22 int
dAtA24 := make([]byte, len(m.Field8)*10)
for _, num := range m.Field8 {
x23 := (uint64(num) << 1) ^ uint64((num >> 63))
for x23 >= 1<<7 {
dAtA24[j22] = uint8(uint64(x23)&0x7f | 0x80)
j22++
x23 >>= 7
}
dAtA24[j22] = uint8(x23)
j22++
}
dAtA[i] = 0x42
i++
i = encodeVarintThetest(dAtA, i, uint64(j22))
i += copy(dAtA[i:], dAtA24[:j22])
}
if len(m.Field9) > 0 {
dAtA[i] = 0x4a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field9)*4))
for _, num := range m.Field9 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field10) > 0 {
dAtA[i] = 0x52
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field10)*4))
for _, num := range m.Field10 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field11) > 0 {
dAtA[i] = 0x5a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field11)*8))
for _, num := range m.Field11 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field12) > 0 {
dAtA[i] = 0x62
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field12)*8))
for _, num := range m.Field12 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field13) > 0 {
dAtA[i] = 0x6a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field13)))
for _, b := range m.Field13 {
if b {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinRepPackedNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinRepPackedNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field1)*8))
for _, num := range m.Field1 {
f25 := math.Float64bits(float64(num))
dAtA[i] = uint8(f25)
i++
dAtA[i] = uint8(f25 >> 8)
i++
dAtA[i] = uint8(f25 >> 16)
i++
dAtA[i] = uint8(f25 >> 24)
i++
dAtA[i] = uint8(f25 >> 32)
i++
dAtA[i] = uint8(f25 >> 40)
i++
dAtA[i] = uint8(f25 >> 48)
i++
dAtA[i] = uint8(f25 >> 56)
i++
}
}
if len(m.Field2) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field2)*4))
for _, num := range m.Field2 {
f26 := math.Float32bits(float32(num))
dAtA[i] = uint8(f26)
i++
dAtA[i] = uint8(f26 >> 8)
i++
dAtA[i] = uint8(f26 >> 16)
i++
dAtA[i] = uint8(f26 >> 24)
i++
}
}
if len(m.Field3) > 0 {
dAtA28 := make([]byte, len(m.Field3)*10)
var j27 int
for _, num1 := range m.Field3 {
num := uint64(num1)
for num >= 1<<7 {
dAtA28[j27] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j27++
}
dAtA28[j27] = uint8(num)
j27++
}
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(j27))
i += copy(dAtA[i:], dAtA28[:j27])
}
if len(m.Field4) > 0 {
dAtA30 := make([]byte, len(m.Field4)*10)
var j29 int
for _, num1 := range m.Field4 {
num := uint64(num1)
for num >= 1<<7 {
dAtA30[j29] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j29++
}
dAtA30[j29] = uint8(num)
j29++
}
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(j29))
i += copy(dAtA[i:], dAtA30[:j29])
}
if len(m.Field5) > 0 {
dAtA32 := make([]byte, len(m.Field5)*10)
var j31 int
for _, num := range m.Field5 {
for num >= 1<<7 {
dAtA32[j31] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j31++
}
dAtA32[j31] = uint8(num)
j31++
}
dAtA[i] = 0x2a
i++
i = encodeVarintThetest(dAtA, i, uint64(j31))
i += copy(dAtA[i:], dAtA32[:j31])
}
if len(m.Field6) > 0 {
dAtA34 := make([]byte, len(m.Field6)*10)
var j33 int
for _, num := range m.Field6 {
for num >= 1<<7 {
dAtA34[j33] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j33++
}
dAtA34[j33] = uint8(num)
j33++
}
dAtA[i] = 0x32
i++
i = encodeVarintThetest(dAtA, i, uint64(j33))
i += copy(dAtA[i:], dAtA34[:j33])
}
if len(m.Field7) > 0 {
dAtA35 := make([]byte, len(m.Field7)*5)
var j36 int
for _, num := range m.Field7 {
x37 := (uint32(num) << 1) ^ uint32((num >> 31))
for x37 >= 1<<7 {
dAtA35[j36] = uint8(uint64(x37)&0x7f | 0x80)
j36++
x37 >>= 7
}
dAtA35[j36] = uint8(x37)
j36++
}
dAtA[i] = 0x3a
i++
i = encodeVarintThetest(dAtA, i, uint64(j36))
i += copy(dAtA[i:], dAtA35[:j36])
}
if len(m.Field8) > 0 {
var j38 int
dAtA40 := make([]byte, len(m.Field8)*10)
for _, num := range m.Field8 {
x39 := (uint64(num) << 1) ^ uint64((num >> 63))
for x39 >= 1<<7 {
dAtA40[j38] = uint8(uint64(x39)&0x7f | 0x80)
j38++
x39 >>= 7
}
dAtA40[j38] = uint8(x39)
j38++
}
dAtA[i] = 0x42
i++
i = encodeVarintThetest(dAtA, i, uint64(j38))
i += copy(dAtA[i:], dAtA40[:j38])
}
if len(m.Field9) > 0 {
dAtA[i] = 0x4a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field9)*4))
for _, num := range m.Field9 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field10) > 0 {
dAtA[i] = 0x52
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field10)*4))
for _, num := range m.Field10 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.Field11) > 0 {
dAtA[i] = 0x5a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field11)*8))
for _, num := range m.Field11 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field12) > 0 {
dAtA[i] = 0x62
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field12)*8))
for _, num := range m.Field12 {
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.Field13) > 0 {
dAtA[i] = 0x6a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field13)))
for _, b := range m.Field13 {
if b {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidOptStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidOptStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(m.Field1))))
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(m.Field2))))
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field3.Size()))
n41, err := m.Field3.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n41
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field4.Size()))
n42, err := m.Field4.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n42
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field6))
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(m.Field7)<<1)^uint32((m.Field7>>31))))
dAtA[i] = 0x42
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field8.Size()))
n43, err := m.Field8.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n43
dAtA[i] = 0x68
i++
if m.Field13 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field14)))
i += copy(dAtA[i:], m.Field14)
if m.Field15 != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field15)))
i += copy(dAtA[i:], m.Field15)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(*m.Field1))))
}
if m.Field2 != nil {
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(*m.Field2))))
}
if m.Field3 != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field3.Size()))
n44, err := m.Field3.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n44
}
if m.Field4 != nil {
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field4.Size()))
n45, err := m.Field4.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n45
}
if m.Field6 != nil {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field6))
}
if m.Field7 != nil {
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(*m.Field7)<<1)^uint32((*m.Field7>>31))))
}
if m.Field8 != nil {
dAtA[i] = 0x42
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field8.Size()))
n46, err := m.Field8.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n46
}
if m.Field13 != nil {
dAtA[i] = 0x68
i++
if *m.Field13 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.Field14 != nil {
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field14)))
i += copy(dAtA[i:], *m.Field14)
}
if m.Field15 != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field15)))
i += copy(dAtA[i:], m.Field15)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidRepStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidRepStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, num := range m.Field1 {
dAtA[i] = 0x9
i++
f47 := math.Float64bits(float64(num))
dAtA[i] = uint8(f47)
i++
dAtA[i] = uint8(f47 >> 8)
i++
dAtA[i] = uint8(f47 >> 16)
i++
dAtA[i] = uint8(f47 >> 24)
i++
dAtA[i] = uint8(f47 >> 32)
i++
dAtA[i] = uint8(f47 >> 40)
i++
dAtA[i] = uint8(f47 >> 48)
i++
dAtA[i] = uint8(f47 >> 56)
i++
}
}
if len(m.Field2) > 0 {
for _, num := range m.Field2 {
dAtA[i] = 0x15
i++
f48 := math.Float32bits(float32(num))
dAtA[i] = uint8(f48)
i++
dAtA[i] = uint8(f48 >> 8)
i++
dAtA[i] = uint8(f48 >> 16)
i++
dAtA[i] = uint8(f48 >> 24)
i++
}
}
if len(m.Field3) > 0 {
for _, msg := range m.Field3 {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Field4) > 0 {
for _, msg := range m.Field4 {
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Field6) > 0 {
for _, num := range m.Field6 {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field7) > 0 {
for _, num := range m.Field7 {
dAtA[i] = 0x38
i++
x49 := (uint32(num) << 1) ^ uint32((num >> 31))
for x49 >= 1<<7 {
dAtA[i] = uint8(uint64(x49)&0x7f | 0x80)
x49 >>= 7
i++
}
dAtA[i] = uint8(x49)
i++
}
}
if len(m.Field8) > 0 {
for _, msg := range m.Field8 {
dAtA[i] = 0x42
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Field13) > 0 {
for _, b := range m.Field13 {
dAtA[i] = 0x68
i++
if b {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
dAtA[i] = 0x72
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(b)))
i += copy(dAtA[i:], b)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinRepStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinRepStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, num := range m.Field1 {
dAtA[i] = 0x9
i++
f50 := math.Float64bits(float64(num))
dAtA[i] = uint8(f50)
i++
dAtA[i] = uint8(f50 >> 8)
i++
dAtA[i] = uint8(f50 >> 16)
i++
dAtA[i] = uint8(f50 >> 24)
i++
dAtA[i] = uint8(f50 >> 32)
i++
dAtA[i] = uint8(f50 >> 40)
i++
dAtA[i] = uint8(f50 >> 48)
i++
dAtA[i] = uint8(f50 >> 56)
i++
}
}
if len(m.Field2) > 0 {
for _, num := range m.Field2 {
dAtA[i] = 0x15
i++
f51 := math.Float32bits(float32(num))
dAtA[i] = uint8(f51)
i++
dAtA[i] = uint8(f51 >> 8)
i++
dAtA[i] = uint8(f51 >> 16)
i++
dAtA[i] = uint8(f51 >> 24)
i++
}
}
if len(m.Field3) > 0 {
for _, msg := range m.Field3 {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Field4) > 0 {
for _, msg := range m.Field4 {
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Field6) > 0 {
for _, num := range m.Field6 {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field7) > 0 {
for _, num := range m.Field7 {
dAtA[i] = 0x38
i++
x52 := (uint32(num) << 1) ^ uint32((num >> 31))
for x52 >= 1<<7 {
dAtA[i] = uint8(uint64(x52)&0x7f | 0x80)
x52 >>= 7
i++
}
dAtA[i] = uint8(x52)
i++
}
}
if len(m.Field8) > 0 {
for _, msg := range m.Field8 {
dAtA[i] = 0x42
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Field13) > 0 {
for _, b := range m.Field13 {
dAtA[i] = 0x68
i++
if b {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
dAtA[i] = 0x72
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(b)))
i += copy(dAtA[i:], b)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidEmbeddedStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidEmbeddedStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.NidOptNative != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.NidOptNative.Size()))
n53, err := m.NidOptNative.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n53
}
dAtA[i] = 0xc2
i++
dAtA[i] = 0xc
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field200.Size()))
n54, err := m.Field200.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n54
dAtA[i] = 0x90
i++
dAtA[i] = 0xd
i++
if m.Field210 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinEmbeddedStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinEmbeddedStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.NidOptNative != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.NidOptNative.Size()))
n55, err := m.NidOptNative.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n55
}
if m.Field200 != nil {
dAtA[i] = 0xc2
i++
dAtA[i] = 0xc
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field200.Size()))
n56, err := m.Field200.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n56
}
if m.Field210 != nil {
dAtA[i] = 0x90
i++
dAtA[i] = 0xd
i++
if *m.Field210 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidNestedStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidNestedStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field1.Size()))
n57, err := m.Field1.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n57
if len(m.Field2) > 0 {
for _, msg := range m.Field2 {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinNestedStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinNestedStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field1.Size()))
n58, err := m.Field1.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n58
}
if len(m.Field2) > 0 {
for _, msg := range m.Field2 {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidOptCustom) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidOptCustom) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Id.Size()))
n59, err := m.Id.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n59
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Value.Size()))
n60, err := m.Value.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n60
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomDash) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomDash) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Value != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Value.Size()))
n61, err := m.Value.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n61
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptCustom) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptCustom) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Id != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Id.Size()))
n62, err := m.Id.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n62
}
if m.Value != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Value.Size()))
n63, err := m.Value.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n63
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidRepCustom) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidRepCustom) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Id) > 0 {
for _, msg := range m.Id {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Value) > 0 {
for _, msg := range m.Value {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinRepCustom) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinRepCustom) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Id) > 0 {
for _, msg := range m.Id {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Value) > 0 {
for _, msg := range m.Value {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptNativeUnion) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptNativeUnion) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(*m.Field1))))
}
if m.Field2 != nil {
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(*m.Field2))))
}
if m.Field3 != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field3))
}
if m.Field4 != nil {
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field4))
}
if m.Field5 != nil {
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field5))
}
if m.Field6 != nil {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field6))
}
if m.Field13 != nil {
dAtA[i] = 0x68
i++
if *m.Field13 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.Field14 != nil {
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field14)))
i += copy(dAtA[i:], *m.Field14)
}
if m.Field15 != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field15)))
i += copy(dAtA[i:], m.Field15)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptStructUnion) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptStructUnion) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(*m.Field1))))
}
if m.Field2 != nil {
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(*m.Field2))))
}
if m.Field3 != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field3.Size()))
n64, err := m.Field3.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n64
}
if m.Field4 != nil {
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field4.Size()))
n65, err := m.Field4.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n65
}
if m.Field6 != nil {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field6))
}
if m.Field7 != nil {
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(*m.Field7)<<1)^uint32((*m.Field7>>31))))
}
if m.Field13 != nil {
dAtA[i] = 0x68
i++
if *m.Field13 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.Field14 != nil {
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field14)))
i += copy(dAtA[i:], *m.Field14)
}
if m.Field15 != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field15)))
i += copy(dAtA[i:], m.Field15)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinEmbeddedStructUnion) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinEmbeddedStructUnion) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.NidOptNative != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.NidOptNative.Size()))
n66, err := m.NidOptNative.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n66
}
if m.Field200 != nil {
dAtA[i] = 0xc2
i++
dAtA[i] = 0xc
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field200.Size()))
n67, err := m.Field200.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n67
}
if m.Field210 != nil {
dAtA[i] = 0x90
i++
dAtA[i] = 0xd
i++
if *m.Field210 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinNestedStructUnion) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinNestedStructUnion) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field1.Size()))
n68, err := m.Field1.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n68
}
if m.Field2 != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field2.Size()))
n69, err := m.Field2.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n69
}
if m.Field3 != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field3.Size()))
n70, err := m.Field3.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n70
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *Tree) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Tree) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Or != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Or.Size()))
n71, err := m.Or.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n71
}
if m.And != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.And.Size()))
n72, err := m.And.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n72
}
if m.Leaf != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Leaf.Size()))
n73, err := m.Leaf.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n73
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *OrBranch) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *OrBranch) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Left.Size()))
n74, err := m.Left.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n74
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Right.Size()))
n75, err := m.Right.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n75
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *AndBranch) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AndBranch) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Left.Size()))
n76, err := m.Left.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n76
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Right.Size()))
n77, err := m.Right.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n77
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *Leaf) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Leaf) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Value))
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.StrValue)))
i += copy(dAtA[i:], m.StrValue)
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *DeepTree) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *DeepTree) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Down != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Down.Size()))
n78, err := m.Down.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n78
}
if m.And != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.And.Size()))
n79, err := m.And.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n79
}
if m.Leaf != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Leaf.Size()))
n80, err := m.Leaf.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n80
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *ADeepBranch) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ADeepBranch) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Down.Size()))
n81, err := m.Down.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n81
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *AndDeepBranch) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AndDeepBranch) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Left.Size()))
n82, err := m.Left.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n82
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Right.Size()))
n83, err := m.Right.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n83
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *DeepLeaf) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *DeepLeaf) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Tree.Size()))
n84, err := m.Tree.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n84
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *Nil) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Nil) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidOptEnum) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidOptEnum) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field1))
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptEnum) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptEnum) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
if m.Field2 != nil {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field2))
}
if m.Field3 != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidRepEnum) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidRepEnum) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, num := range m.Field1 {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field2) > 0 {
for _, num := range m.Field2 {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field3) > 0 {
for _, num := range m.Field3 {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinRepEnum) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinRepEnum) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, num := range m.Field1 {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field2) > 0 {
for _, num := range m.Field2 {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.Field3) > 0 {
for _, num := range m.Field3 {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptEnumDefault) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptEnumDefault) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
if m.Field2 != nil {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field2))
}
if m.Field3 != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *AnotherNinOptEnum) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AnotherNinOptEnum) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
if m.Field2 != nil {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field2))
}
if m.Field3 != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *AnotherNinOptEnumDefault) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AnotherNinOptEnumDefault) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
if m.Field2 != nil {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field2))
}
if m.Field3 != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *Timer) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Timer) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(m.Time1))
dAtA[i] = 0x11
i++
i = encodeFixed64Thetest(dAtA, i, uint64(m.Time2))
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Data)))
i += copy(dAtA[i:], m.Data)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *MyExtendable) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *MyExtendable) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
n, err := github_com_gogo_protobuf_proto.EncodeInternalExtension(m, dAtA[i:])
if err != nil {
return 0, err
}
i += n
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *OtherExtenable) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *OtherExtenable) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.M != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.M.Size()))
n85, err := m.M.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n85
}
if m.Field2 != nil {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field2))
}
if m.Field13 != nil {
dAtA[i] = 0x68
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field13))
}
n, err := github_com_gogo_protobuf_proto.EncodeInternalExtension(m, dAtA[i:])
if err != nil {
return 0, err
}
i += n
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NestedDefinition) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NestedDefinition) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
if m.EnumField != nil {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.EnumField))
}
if m.NNM != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.NNM.Size()))
n86, err := m.NNM.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n86
}
if m.NM != nil {
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(m.NM.Size()))
n87, err := m.NM.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n87
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NestedDefinition_NestedMessage) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NestedDefinition_NestedMessage) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.NestedField1 != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(*m.NestedField1))
}
if m.NNM != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.NNM.Size()))
n88, err := m.NNM.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n88
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NestedDefinition_NestedMessage_NestedNestedMsg) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NestedDefinition_NestedMessage_NestedNestedMsg) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.NestedNestedField1 != nil {
dAtA[i] = 0x52
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.NestedNestedField1)))
i += copy(dAtA[i:], *m.NestedNestedField1)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NestedScope) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NestedScope) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.A != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.A.Size()))
n89, err := m.A.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n89
}
if m.B != nil {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.B))
}
if m.C != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.C.Size()))
n90, err := m.C.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n90
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptNativeDefault) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptNativeDefault) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(*m.Field1))))
}
if m.Field2 != nil {
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(*m.Field2))))
}
if m.Field3 != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field3))
}
if m.Field4 != nil {
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field4))
}
if m.Field5 != nil {
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field5))
}
if m.Field6 != nil {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field6))
}
if m.Field7 != nil {
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(*m.Field7)<<1)^uint32((*m.Field7>>31))))
}
if m.Field8 != nil {
dAtA[i] = 0x40
i++
i = encodeVarintThetest(dAtA, i, uint64((uint64(*m.Field8)<<1)^uint64((*m.Field8>>63))))
}
if m.Field9 != nil {
dAtA[i] = 0x4d
i++
i = encodeFixed32Thetest(dAtA, i, uint32(*m.Field9))
}
if m.Field10 != nil {
dAtA[i] = 0x55
i++
i = encodeFixed32Thetest(dAtA, i, uint32(*m.Field10))
}
if m.Field11 != nil {
dAtA[i] = 0x59
i++
i = encodeFixed64Thetest(dAtA, i, uint64(*m.Field11))
}
if m.Field12 != nil {
dAtA[i] = 0x61
i++
i = encodeFixed64Thetest(dAtA, i, uint64(*m.Field12))
}
if m.Field13 != nil {
dAtA[i] = 0x68
i++
if *m.Field13 {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.Field14 != nil {
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field14)))
i += copy(dAtA[i:], *m.Field14)
}
if m.Field15 != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.Field15)))
i += copy(dAtA[i:], m.Field15)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomContainer) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomContainer) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.CustomStruct.Size()))
n91, err := m.CustomStruct.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n91
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomNameNidOptNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomNameNidOptNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(m.FieldA))))
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(m.FieldB))))
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldC))
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldD))
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldE))
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldF))
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(m.FieldG)<<1)^uint32((m.FieldG>>31))))
dAtA[i] = 0x40
i++
i = encodeVarintThetest(dAtA, i, uint64((uint64(m.FieldH)<<1)^uint64((m.FieldH>>63))))
dAtA[i] = 0x4d
i++
i = encodeFixed32Thetest(dAtA, i, uint32(m.FieldI))
dAtA[i] = 0x55
i++
i = encodeFixed32Thetest(dAtA, i, uint32(m.FieldJ))
dAtA[i] = 0x59
i++
i = encodeFixed64Thetest(dAtA, i, uint64(m.FieldK))
dAtA[i] = 0x61
i++
i = encodeFixed64Thetest(dAtA, i, uint64(m.FieldL))
dAtA[i] = 0x68
i++
if m.FieldM {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.FieldN)))
i += copy(dAtA[i:], m.FieldN)
if m.FieldO != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.FieldO)))
i += copy(dAtA[i:], m.FieldO)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomNameNinOptNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomNameNinOptNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.FieldA != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(*m.FieldA))))
}
if m.FieldB != nil {
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(*m.FieldB))))
}
if m.FieldC != nil {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.FieldC))
}
if m.FieldD != nil {
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.FieldD))
}
if m.FieldE != nil {
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.FieldE))
}
if m.FieldF != nil {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.FieldF))
}
if m.FieldG != nil {
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(*m.FieldG)<<1)^uint32((*m.FieldG>>31))))
}
if m.FieldH != nil {
dAtA[i] = 0x40
i++
i = encodeVarintThetest(dAtA, i, uint64((uint64(*m.FieldH)<<1)^uint64((*m.FieldH>>63))))
}
if m.FieldI != nil {
dAtA[i] = 0x4d
i++
i = encodeFixed32Thetest(dAtA, i, uint32(*m.FieldI))
}
if m.FieldJ != nil {
dAtA[i] = 0x55
i++
i = encodeFixed32Thetest(dAtA, i, uint32(*m.FieldJ))
}
if m.FieldK != nil {
dAtA[i] = 0x59
i++
i = encodeFixed64Thetest(dAtA, i, uint64(*m.FieldK))
}
if m.FielL != nil {
dAtA[i] = 0x61
i++
i = encodeFixed64Thetest(dAtA, i, uint64(*m.FielL))
}
if m.FieldM != nil {
dAtA[i] = 0x68
i++
if *m.FieldM {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.FieldN != nil {
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.FieldN)))
i += copy(dAtA[i:], *m.FieldN)
}
if m.FieldO != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.FieldO)))
i += copy(dAtA[i:], m.FieldO)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomNameNinRepNative) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomNameNinRepNative) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.FieldA) > 0 {
for _, num := range m.FieldA {
dAtA[i] = 0x9
i++
f92 := math.Float64bits(float64(num))
dAtA[i] = uint8(f92)
i++
dAtA[i] = uint8(f92 >> 8)
i++
dAtA[i] = uint8(f92 >> 16)
i++
dAtA[i] = uint8(f92 >> 24)
i++
dAtA[i] = uint8(f92 >> 32)
i++
dAtA[i] = uint8(f92 >> 40)
i++
dAtA[i] = uint8(f92 >> 48)
i++
dAtA[i] = uint8(f92 >> 56)
i++
}
}
if len(m.FieldB) > 0 {
for _, num := range m.FieldB {
dAtA[i] = 0x15
i++
f93 := math.Float32bits(float32(num))
dAtA[i] = uint8(f93)
i++
dAtA[i] = uint8(f93 >> 8)
i++
dAtA[i] = uint8(f93 >> 16)
i++
dAtA[i] = uint8(f93 >> 24)
i++
}
}
if len(m.FieldC) > 0 {
for _, num := range m.FieldC {
dAtA[i] = 0x18
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.FieldD) > 0 {
for _, num := range m.FieldD {
dAtA[i] = 0x20
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.FieldE) > 0 {
for _, num := range m.FieldE {
dAtA[i] = 0x28
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.FieldF) > 0 {
for _, num := range m.FieldF {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if len(m.FieldG) > 0 {
for _, num := range m.FieldG {
dAtA[i] = 0x38
i++
x94 := (uint32(num) << 1) ^ uint32((num >> 31))
for x94 >= 1<<7 {
dAtA[i] = uint8(uint64(x94)&0x7f | 0x80)
x94 >>= 7
i++
}
dAtA[i] = uint8(x94)
i++
}
}
if len(m.FieldH) > 0 {
for _, num := range m.FieldH {
dAtA[i] = 0x40
i++
x95 := (uint64(num) << 1) ^ uint64((num >> 63))
for x95 >= 1<<7 {
dAtA[i] = uint8(uint64(x95)&0x7f | 0x80)
x95 >>= 7
i++
}
dAtA[i] = uint8(x95)
i++
}
}
if len(m.FieldI) > 0 {
for _, num := range m.FieldI {
dAtA[i] = 0x4d
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.FieldJ) > 0 {
for _, num := range m.FieldJ {
dAtA[i] = 0x55
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
}
}
if len(m.FieldK) > 0 {
for _, num := range m.FieldK {
dAtA[i] = 0x59
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.FieldL) > 0 {
for _, num := range m.FieldL {
dAtA[i] = 0x61
i++
dAtA[i] = uint8(num)
i++
dAtA[i] = uint8(num >> 8)
i++
dAtA[i] = uint8(num >> 16)
i++
dAtA[i] = uint8(num >> 24)
i++
dAtA[i] = uint8(num >> 32)
i++
dAtA[i] = uint8(num >> 40)
i++
dAtA[i] = uint8(num >> 48)
i++
dAtA[i] = uint8(num >> 56)
i++
}
}
if len(m.FieldM) > 0 {
for _, b := range m.FieldM {
dAtA[i] = 0x68
i++
if b {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
}
if len(m.FieldN) > 0 {
for _, s := range m.FieldN {
dAtA[i] = 0x72
i++
l = len(s)
for l >= 1<<7 {
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
l >>= 7
i++
}
dAtA[i] = uint8(l)
i++
i += copy(dAtA[i:], s)
}
}
if len(m.FieldO) > 0 {
for _, b := range m.FieldO {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(b)))
i += copy(dAtA[i:], b)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomNameNinStruct) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomNameNinStruct) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.FieldA != nil {
dAtA[i] = 0x9
i++
i = encodeFixed64Thetest(dAtA, i, uint64(math.Float64bits(float64(*m.FieldA))))
}
if m.FieldB != nil {
dAtA[i] = 0x15
i++
i = encodeFixed32Thetest(dAtA, i, uint32(math.Float32bits(float32(*m.FieldB))))
}
if m.FieldC != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldC.Size()))
n96, err := m.FieldC.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n96
}
if len(m.FieldD) > 0 {
for _, msg := range m.FieldD {
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.FieldE != nil {
dAtA[i] = 0x30
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.FieldE))
}
if m.FieldF != nil {
dAtA[i] = 0x38
i++
i = encodeVarintThetest(dAtA, i, uint64((uint32(*m.FieldF)<<1)^uint32((*m.FieldF>>31))))
}
if m.FieldG != nil {
dAtA[i] = 0x42
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldG.Size()))
n97, err := m.FieldG.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n97
}
if m.FieldH != nil {
dAtA[i] = 0x68
i++
if *m.FieldH {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.FieldI != nil {
dAtA[i] = 0x72
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.FieldI)))
i += copy(dAtA[i:], *m.FieldI)
}
if m.FieldJ != nil {
dAtA[i] = 0x7a
i++
i = encodeVarintThetest(dAtA, i, uint64(len(m.FieldJ)))
i += copy(dAtA[i:], m.FieldJ)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomNameCustomType) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomNameCustomType) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.FieldA != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldA.Size()))
n98, err := m.FieldA.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n98
}
if m.FieldB != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldB.Size()))
n99, err := m.FieldB.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n99
}
if len(m.FieldC) > 0 {
for _, msg := range m.FieldC {
dAtA[i] = 0x1a
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.FieldD) > 0 {
for _, msg := range m.FieldD {
dAtA[i] = 0x22
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomNameNinEmbeddedStructUnion) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomNameNinEmbeddedStructUnion) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.NidOptNative != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.NidOptNative.Size()))
n100, err := m.NidOptNative.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n100
}
if m.FieldA != nil {
dAtA[i] = 0xc2
i++
dAtA[i] = 0xc
i++
i = encodeVarintThetest(dAtA, i, uint64(m.FieldA.Size()))
n101, err := m.FieldA.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n101
}
if m.FieldB != nil {
dAtA[i] = 0x90
i++
dAtA[i] = 0xd
i++
if *m.FieldB {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *CustomNameEnum) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *CustomNameEnum) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.FieldA != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.FieldA))
}
if len(m.FieldB) > 0 {
for _, num := range m.FieldB {
dAtA[i] = 0x10
i++
i = encodeVarintThetest(dAtA, i, uint64(num))
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NoExtensionsMap) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NoExtensionsMap) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
if m.XXX_extensions != nil {
i += copy(dAtA[i:], m.XXX_extensions)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *Unrecognized) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Unrecognized) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field1)))
i += copy(dAtA[i:], *m.Field1)
}
return i, nil
}
func (m *UnrecognizedWithInner) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *UnrecognizedWithInner) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Embedded) > 0 {
for _, msg := range m.Embedded {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.Field2 != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field2)))
i += copy(dAtA[i:], *m.Field2)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *UnrecognizedWithInner_Inner) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *UnrecognizedWithInner_Inner) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
return i, nil
}
func (m *UnrecognizedWithEmbed) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *UnrecognizedWithEmbed) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.UnrecognizedWithEmbed_Embedded.Size()))
n102, err := m.UnrecognizedWithEmbed_Embedded.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n102
if m.Field2 != nil {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field2)))
i += copy(dAtA[i:], *m.Field2)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *UnrecognizedWithEmbed_Embedded) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *UnrecognizedWithEmbed_Embedded) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintThetest(dAtA, i, uint64(*m.Field1))
}
return i, nil
}
func (m *Node) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Node) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Label != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Label)))
i += copy(dAtA[i:], *m.Label)
}
if len(m.Children) > 0 {
for _, msg := range m.Children {
dAtA[i] = 0x12
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NonByteCustomType) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NonByteCustomType) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field1.Size()))
n103, err := m.Field1.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n103
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidOptNonByteCustomType) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidOptNonByteCustomType) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field1.Size()))
n104, err := m.Field1.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n104
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinOptNonByteCustomType) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinOptNonByteCustomType) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field1 != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(m.Field1.Size()))
n105, err := m.Field1.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n105
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NidRepNonByteCustomType) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NidRepNonByteCustomType) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, msg := range m.Field1 {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *NinRepNonByteCustomType) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *NinRepNonByteCustomType) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Field1) > 0 {
for _, msg := range m.Field1 {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *ProtoType) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ProtoType) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Field2 != nil {
dAtA[i] = 0xa
i++
i = encodeVarintThetest(dAtA, i, uint64(len(*m.Field2)))
i += copy(dAtA[i:], *m.Field2)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeFixed64Thetest(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Thetest(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintThetest(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func NewPopulatedNidOptNative(r randyThetest, easy bool) *NidOptNative {
this := &NidOptNative{}
this.Field1 = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1 *= -1
}
this.Field2 = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2 *= -1
}
this.Field3 = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field3 *= -1
}
this.Field4 = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field4 *= -1
}
this.Field5 = uint32(r.Uint32())
this.Field6 = uint64(uint64(r.Uint32()))
this.Field7 = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7 *= -1
}
this.Field8 = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field8 *= -1
}
this.Field9 = uint32(r.Uint32())
this.Field10 = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field10 *= -1
}
this.Field11 = uint64(uint64(r.Uint32()))
this.Field12 = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field12 *= -1
}
this.Field13 = bool(bool(r.Intn(2) == 0))
this.Field14 = string(randStringThetest(r))
v1 := r.Intn(100)
this.Field15 = make([]byte, v1)
for i := 0; i < v1; i++ {
this.Field15[i] = byte(r.Intn(256))
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNinOptNative(r randyThetest, easy bool) *NinOptNative {
this := &NinOptNative{}
if r.Intn(10) != 0 {
v2 := float64(r.Float64())
if r.Intn(2) == 0 {
v2 *= -1
}
this.Field1 = &v2
}
if r.Intn(10) != 0 {
v3 := float32(r.Float32())
if r.Intn(2) == 0 {
v3 *= -1
}
this.Field2 = &v3
}
if r.Intn(10) != 0 {
v4 := int32(r.Int31())
if r.Intn(2) == 0 {
v4 *= -1
}
this.Field3 = &v4
}
if r.Intn(10) != 0 {
v5 := int64(r.Int63())
if r.Intn(2) == 0 {
v5 *= -1
}
this.Field4 = &v5
}
if r.Intn(10) != 0 {
v6 := uint32(r.Uint32())
this.Field5 = &v6
}
if r.Intn(10) != 0 {
v7 := uint64(uint64(r.Uint32()))
this.Field6 = &v7
}
if r.Intn(10) != 0 {
v8 := int32(r.Int31())
if r.Intn(2) == 0 {
v8 *= -1
}
this.Field7 = &v8
}
if r.Intn(10) != 0 {
v9 := int64(r.Int63())
if r.Intn(2) == 0 {
v9 *= -1
}
this.Field8 = &v9
}
if r.Intn(10) != 0 {
v10 := uint32(r.Uint32())
this.Field9 = &v10
}
if r.Intn(10) != 0 {
v11 := int32(r.Int31())
if r.Intn(2) == 0 {
v11 *= -1
}
this.Field10 = &v11
}
if r.Intn(10) != 0 {
v12 := uint64(uint64(r.Uint32()))
this.Field11 = &v12
}
if r.Intn(10) != 0 {
v13 := int64(r.Int63())
if r.Intn(2) == 0 {
v13 *= -1
}
this.Field12 = &v13
}
if r.Intn(10) != 0 {
v14 := bool(bool(r.Intn(2) == 0))
this.Field13 = &v14
}
if r.Intn(10) != 0 {
v15 := string(randStringThetest(r))
this.Field14 = &v15
}
if r.Intn(10) != 0 {
v16 := r.Intn(100)
this.Field15 = make([]byte, v16)
for i := 0; i < v16; i++ {
this.Field15[i] = byte(r.Intn(256))
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNidRepNative(r randyThetest, easy bool) *NidRepNative {
this := &NidRepNative{}
if r.Intn(10) != 0 {
v17 := r.Intn(10)
this.Field1 = make([]float64, v17)
for i := 0; i < v17; i++ {
this.Field1[i] = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v18 := r.Intn(10)
this.Field2 = make([]float32, v18)
for i := 0; i < v18; i++ {
this.Field2[i] = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v19 := r.Intn(10)
this.Field3 = make([]int32, v19)
for i := 0; i < v19; i++ {
this.Field3[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field3[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v20 := r.Intn(10)
this.Field4 = make([]int64, v20)
for i := 0; i < v20; i++ {
this.Field4[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field4[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v21 := r.Intn(10)
this.Field5 = make([]uint32, v21)
for i := 0; i < v21; i++ {
this.Field5[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v22 := r.Intn(10)
this.Field6 = make([]uint64, v22)
for i := 0; i < v22; i++ {
this.Field6[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v23 := r.Intn(10)
this.Field7 = make([]int32, v23)
for i := 0; i < v23; i++ {
this.Field7[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v24 := r.Intn(10)
this.Field8 = make([]int64, v24)
for i := 0; i < v24; i++ {
this.Field8[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field8[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v25 := r.Intn(10)
this.Field9 = make([]uint32, v25)
for i := 0; i < v25; i++ {
this.Field9[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v26 := r.Intn(10)
this.Field10 = make([]int32, v26)
for i := 0; i < v26; i++ {
this.Field10[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field10[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v27 := r.Intn(10)
this.Field11 = make([]uint64, v27)
for i := 0; i < v27; i++ {
this.Field11[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v28 := r.Intn(10)
this.Field12 = make([]int64, v28)
for i := 0; i < v28; i++ {
this.Field12[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field12[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v29 := r.Intn(10)
this.Field13 = make([]bool, v29)
for i := 0; i < v29; i++ {
this.Field13[i] = bool(bool(r.Intn(2) == 0))
}
}
if r.Intn(10) != 0 {
v30 := r.Intn(10)
this.Field14 = make([]string, v30)
for i := 0; i < v30; i++ {
this.Field14[i] = string(randStringThetest(r))
}
}
if r.Intn(10) != 0 {
v31 := r.Intn(10)
this.Field15 = make([][]byte, v31)
for i := 0; i < v31; i++ {
v32 := r.Intn(100)
this.Field15[i] = make([]byte, v32)
for j := 0; j < v32; j++ {
this.Field15[i][j] = byte(r.Intn(256))
}
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNinRepNative(r randyThetest, easy bool) *NinRepNative {
this := &NinRepNative{}
if r.Intn(10) != 0 {
v33 := r.Intn(10)
this.Field1 = make([]float64, v33)
for i := 0; i < v33; i++ {
this.Field1[i] = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v34 := r.Intn(10)
this.Field2 = make([]float32, v34)
for i := 0; i < v34; i++ {
this.Field2[i] = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v35 := r.Intn(10)
this.Field3 = make([]int32, v35)
for i := 0; i < v35; i++ {
this.Field3[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field3[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v36 := r.Intn(10)
this.Field4 = make([]int64, v36)
for i := 0; i < v36; i++ {
this.Field4[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field4[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v37 := r.Intn(10)
this.Field5 = make([]uint32, v37)
for i := 0; i < v37; i++ {
this.Field5[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v38 := r.Intn(10)
this.Field6 = make([]uint64, v38)
for i := 0; i < v38; i++ {
this.Field6[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v39 := r.Intn(10)
this.Field7 = make([]int32, v39)
for i := 0; i < v39; i++ {
this.Field7[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v40 := r.Intn(10)
this.Field8 = make([]int64, v40)
for i := 0; i < v40; i++ {
this.Field8[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field8[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v41 := r.Intn(10)
this.Field9 = make([]uint32, v41)
for i := 0; i < v41; i++ {
this.Field9[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v42 := r.Intn(10)
this.Field10 = make([]int32, v42)
for i := 0; i < v42; i++ {
this.Field10[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field10[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v43 := r.Intn(10)
this.Field11 = make([]uint64, v43)
for i := 0; i < v43; i++ {
this.Field11[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v44 := r.Intn(10)
this.Field12 = make([]int64, v44)
for i := 0; i < v44; i++ {
this.Field12[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field12[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v45 := r.Intn(10)
this.Field13 = make([]bool, v45)
for i := 0; i < v45; i++ {
this.Field13[i] = bool(bool(r.Intn(2) == 0))
}
}
if r.Intn(10) != 0 {
v46 := r.Intn(10)
this.Field14 = make([]string, v46)
for i := 0; i < v46; i++ {
this.Field14[i] = string(randStringThetest(r))
}
}
if r.Intn(10) != 0 {
v47 := r.Intn(10)
this.Field15 = make([][]byte, v47)
for i := 0; i < v47; i++ {
v48 := r.Intn(100)
this.Field15[i] = make([]byte, v48)
for j := 0; j < v48; j++ {
this.Field15[i][j] = byte(r.Intn(256))
}
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNidRepPackedNative(r randyThetest, easy bool) *NidRepPackedNative {
this := &NidRepPackedNative{}
if r.Intn(10) != 0 {
v49 := r.Intn(10)
this.Field1 = make([]float64, v49)
for i := 0; i < v49; i++ {
this.Field1[i] = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v50 := r.Intn(10)
this.Field2 = make([]float32, v50)
for i := 0; i < v50; i++ {
this.Field2[i] = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v51 := r.Intn(10)
this.Field3 = make([]int32, v51)
for i := 0; i < v51; i++ {
this.Field3[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field3[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v52 := r.Intn(10)
this.Field4 = make([]int64, v52)
for i := 0; i < v52; i++ {
this.Field4[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field4[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v53 := r.Intn(10)
this.Field5 = make([]uint32, v53)
for i := 0; i < v53; i++ {
this.Field5[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v54 := r.Intn(10)
this.Field6 = make([]uint64, v54)
for i := 0; i < v54; i++ {
this.Field6[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v55 := r.Intn(10)
this.Field7 = make([]int32, v55)
for i := 0; i < v55; i++ {
this.Field7[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v56 := r.Intn(10)
this.Field8 = make([]int64, v56)
for i := 0; i < v56; i++ {
this.Field8[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field8[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v57 := r.Intn(10)
this.Field9 = make([]uint32, v57)
for i := 0; i < v57; i++ {
this.Field9[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v58 := r.Intn(10)
this.Field10 = make([]int32, v58)
for i := 0; i < v58; i++ {
this.Field10[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field10[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v59 := r.Intn(10)
this.Field11 = make([]uint64, v59)
for i := 0; i < v59; i++ {
this.Field11[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v60 := r.Intn(10)
this.Field12 = make([]int64, v60)
for i := 0; i < v60; i++ {
this.Field12[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field12[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v61 := r.Intn(10)
this.Field13 = make([]bool, v61)
for i := 0; i < v61; i++ {
this.Field13[i] = bool(bool(r.Intn(2) == 0))
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 14)
}
return this
}
func NewPopulatedNinRepPackedNative(r randyThetest, easy bool) *NinRepPackedNative {
this := &NinRepPackedNative{}
if r.Intn(10) != 0 {
v62 := r.Intn(10)
this.Field1 = make([]float64, v62)
for i := 0; i < v62; i++ {
this.Field1[i] = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v63 := r.Intn(10)
this.Field2 = make([]float32, v63)
for i := 0; i < v63; i++ {
this.Field2[i] = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v64 := r.Intn(10)
this.Field3 = make([]int32, v64)
for i := 0; i < v64; i++ {
this.Field3[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field3[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v65 := r.Intn(10)
this.Field4 = make([]int64, v65)
for i := 0; i < v65; i++ {
this.Field4[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field4[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v66 := r.Intn(10)
this.Field5 = make([]uint32, v66)
for i := 0; i < v66; i++ {
this.Field5[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v67 := r.Intn(10)
this.Field6 = make([]uint64, v67)
for i := 0; i < v67; i++ {
this.Field6[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v68 := r.Intn(10)
this.Field7 = make([]int32, v68)
for i := 0; i < v68; i++ {
this.Field7[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v69 := r.Intn(10)
this.Field8 = make([]int64, v69)
for i := 0; i < v69; i++ {
this.Field8[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field8[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v70 := r.Intn(10)
this.Field9 = make([]uint32, v70)
for i := 0; i < v70; i++ {
this.Field9[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v71 := r.Intn(10)
this.Field10 = make([]int32, v71)
for i := 0; i < v71; i++ {
this.Field10[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field10[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v72 := r.Intn(10)
this.Field11 = make([]uint64, v72)
for i := 0; i < v72; i++ {
this.Field11[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v73 := r.Intn(10)
this.Field12 = make([]int64, v73)
for i := 0; i < v73; i++ {
this.Field12[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.Field12[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v74 := r.Intn(10)
this.Field13 = make([]bool, v74)
for i := 0; i < v74; i++ {
this.Field13[i] = bool(bool(r.Intn(2) == 0))
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 14)
}
return this
}
func NewPopulatedNidOptStruct(r randyThetest, easy bool) *NidOptStruct {
this := &NidOptStruct{}
this.Field1 = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1 *= -1
}
this.Field2 = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2 *= -1
}
v75 := NewPopulatedNidOptNative(r, easy)
this.Field3 = *v75
v76 := NewPopulatedNinOptNative(r, easy)
this.Field4 = *v76
this.Field6 = uint64(uint64(r.Uint32()))
this.Field7 = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7 *= -1
}
v77 := NewPopulatedNidOptNative(r, easy)
this.Field8 = *v77
this.Field13 = bool(bool(r.Intn(2) == 0))
this.Field14 = string(randStringThetest(r))
v78 := r.Intn(100)
this.Field15 = make([]byte, v78)
for i := 0; i < v78; i++ {
this.Field15[i] = byte(r.Intn(256))
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNinOptStruct(r randyThetest, easy bool) *NinOptStruct {
this := &NinOptStruct{}
if r.Intn(10) != 0 {
v79 := float64(r.Float64())
if r.Intn(2) == 0 {
v79 *= -1
}
this.Field1 = &v79
}
if r.Intn(10) != 0 {
v80 := float32(r.Float32())
if r.Intn(2) == 0 {
v80 *= -1
}
this.Field2 = &v80
}
if r.Intn(10) != 0 {
this.Field3 = NewPopulatedNidOptNative(r, easy)
}
if r.Intn(10) != 0 {
this.Field4 = NewPopulatedNinOptNative(r, easy)
}
if r.Intn(10) != 0 {
v81 := uint64(uint64(r.Uint32()))
this.Field6 = &v81
}
if r.Intn(10) != 0 {
v82 := int32(r.Int31())
if r.Intn(2) == 0 {
v82 *= -1
}
this.Field7 = &v82
}
if r.Intn(10) != 0 {
this.Field8 = NewPopulatedNidOptNative(r, easy)
}
if r.Intn(10) != 0 {
v83 := bool(bool(r.Intn(2) == 0))
this.Field13 = &v83
}
if r.Intn(10) != 0 {
v84 := string(randStringThetest(r))
this.Field14 = &v84
}
if r.Intn(10) != 0 {
v85 := r.Intn(100)
this.Field15 = make([]byte, v85)
for i := 0; i < v85; i++ {
this.Field15[i] = byte(r.Intn(256))
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNidRepStruct(r randyThetest, easy bool) *NidRepStruct {
this := &NidRepStruct{}
if r.Intn(10) != 0 {
v86 := r.Intn(10)
this.Field1 = make([]float64, v86)
for i := 0; i < v86; i++ {
this.Field1[i] = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v87 := r.Intn(10)
this.Field2 = make([]float32, v87)
for i := 0; i < v87; i++ {
this.Field2[i] = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v88 := r.Intn(5)
this.Field3 = make([]NidOptNative, v88)
for i := 0; i < v88; i++ {
v89 := NewPopulatedNidOptNative(r, easy)
this.Field3[i] = *v89
}
}
if r.Intn(10) != 0 {
v90 := r.Intn(5)
this.Field4 = make([]NinOptNative, v90)
for i := 0; i < v90; i++ {
v91 := NewPopulatedNinOptNative(r, easy)
this.Field4[i] = *v91
}
}
if r.Intn(10) != 0 {
v92 := r.Intn(10)
this.Field6 = make([]uint64, v92)
for i := 0; i < v92; i++ {
this.Field6[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v93 := r.Intn(10)
this.Field7 = make([]int32, v93)
for i := 0; i < v93; i++ {
this.Field7[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v94 := r.Intn(5)
this.Field8 = make([]NidOptNative, v94)
for i := 0; i < v94; i++ {
v95 := NewPopulatedNidOptNative(r, easy)
this.Field8[i] = *v95
}
}
if r.Intn(10) != 0 {
v96 := r.Intn(10)
this.Field13 = make([]bool, v96)
for i := 0; i < v96; i++ {
this.Field13[i] = bool(bool(r.Intn(2) == 0))
}
}
if r.Intn(10) != 0 {
v97 := r.Intn(10)
this.Field14 = make([]string, v97)
for i := 0; i < v97; i++ {
this.Field14[i] = string(randStringThetest(r))
}
}
if r.Intn(10) != 0 {
v98 := r.Intn(10)
this.Field15 = make([][]byte, v98)
for i := 0; i < v98; i++ {
v99 := r.Intn(100)
this.Field15[i] = make([]byte, v99)
for j := 0; j < v99; j++ {
this.Field15[i][j] = byte(r.Intn(256))
}
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNinRepStruct(r randyThetest, easy bool) *NinRepStruct {
this := &NinRepStruct{}
if r.Intn(10) != 0 {
v100 := r.Intn(10)
this.Field1 = make([]float64, v100)
for i := 0; i < v100; i++ {
this.Field1[i] = float64(r.Float64())
if r.Intn(2) == 0 {
this.Field1[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v101 := r.Intn(10)
this.Field2 = make([]float32, v101)
for i := 0; i < v101; i++ {
this.Field2[i] = float32(r.Float32())
if r.Intn(2) == 0 {
this.Field2[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v102 := r.Intn(5)
this.Field3 = make([]*NidOptNative, v102)
for i := 0; i < v102; i++ {
this.Field3[i] = NewPopulatedNidOptNative(r, easy)
}
}
if r.Intn(10) != 0 {
v103 := r.Intn(5)
this.Field4 = make([]*NinOptNative, v103)
for i := 0; i < v103; i++ {
this.Field4[i] = NewPopulatedNinOptNative(r, easy)
}
}
if r.Intn(10) != 0 {
v104 := r.Intn(10)
this.Field6 = make([]uint64, v104)
for i := 0; i < v104; i++ {
this.Field6[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v105 := r.Intn(10)
this.Field7 = make([]int32, v105)
for i := 0; i < v105; i++ {
this.Field7[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.Field7[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v106 := r.Intn(5)
this.Field8 = make([]*NidOptNative, v106)
for i := 0; i < v106; i++ {
this.Field8[i] = NewPopulatedNidOptNative(r, easy)
}
}
if r.Intn(10) != 0 {
v107 := r.Intn(10)
this.Field13 = make([]bool, v107)
for i := 0; i < v107; i++ {
this.Field13[i] = bool(bool(r.Intn(2) == 0))
}
}
if r.Intn(10) != 0 {
v108 := r.Intn(10)
this.Field14 = make([]string, v108)
for i := 0; i < v108; i++ {
this.Field14[i] = string(randStringThetest(r))
}
}
if r.Intn(10) != 0 {
v109 := r.Intn(10)
this.Field15 = make([][]byte, v109)
for i := 0; i < v109; i++ {
v110 := r.Intn(100)
this.Field15[i] = make([]byte, v110)
for j := 0; j < v110; j++ {
this.Field15[i][j] = byte(r.Intn(256))
}
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedNidEmbeddedStruct(r randyThetest, easy bool) *NidEmbeddedStruct {
this := &NidEmbeddedStruct{}
if r.Intn(10) != 0 {
this.NidOptNative = NewPopulatedNidOptNative(r, easy)
}
v111 := NewPopulatedNidOptNative(r, easy)
this.Field200 = *v111
this.Field210 = bool(bool(r.Intn(2) == 0))
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 211)
}
return this
}
func NewPopulatedNinEmbeddedStruct(r randyThetest, easy bool) *NinEmbeddedStruct {
this := &NinEmbeddedStruct{}
if r.Intn(10) != 0 {
this.NidOptNative = NewPopulatedNidOptNative(r, easy)
}
if r.Intn(10) != 0 {
this.Field200 = NewPopulatedNidOptNative(r, easy)
}
if r.Intn(10) != 0 {
v112 := bool(bool(r.Intn(2) == 0))
this.Field210 = &v112
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 211)
}
return this
}
func NewPopulatedNidNestedStruct(r randyThetest, easy bool) *NidNestedStruct {
this := &NidNestedStruct{}
v113 := NewPopulatedNidOptStruct(r, easy)
this.Field1 = *v113
if r.Intn(10) != 0 {
v114 := r.Intn(5)
this.Field2 = make([]NidRepStruct, v114)
for i := 0; i < v114; i++ {
v115 := NewPopulatedNidRepStruct(r, easy)
this.Field2[i] = *v115
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNinNestedStruct(r randyThetest, easy bool) *NinNestedStruct {
this := &NinNestedStruct{}
if r.Intn(10) != 0 {
this.Field1 = NewPopulatedNinOptStruct(r, easy)
}
if r.Intn(10) != 0 {
v116 := r.Intn(5)
this.Field2 = make([]*NinRepStruct, v116)
for i := 0; i < v116; i++ {
this.Field2[i] = NewPopulatedNinRepStruct(r, easy)
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNidOptCustom(r randyThetest, easy bool) *NidOptCustom {
this := &NidOptCustom{}
v117 := NewPopulatedUuid(r)
this.Id = *v117
v118 := github_com_gogo_protobuf_test_custom.NewPopulatedUint128(r)
this.Value = *v118
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedCustomDash(r randyThetest, easy bool) *CustomDash {
this := &CustomDash{}
if r.Intn(10) != 0 {
this.Value = github_com_gogo_protobuf_test_custom_dash_type.NewPopulatedBytes(r)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedNinOptCustom(r randyThetest, easy bool) *NinOptCustom {
this := &NinOptCustom{}
if r.Intn(10) != 0 {
this.Id = NewPopulatedUuid(r)
}
if r.Intn(10) != 0 {
this.Value = github_com_gogo_protobuf_test_custom.NewPopulatedUint128(r)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNidRepCustom(r randyThetest, easy bool) *NidRepCustom {
this := &NidRepCustom{}
if r.Intn(10) != 0 {
v119 := r.Intn(10)
this.Id = make([]Uuid, v119)
for i := 0; i < v119; i++ {
v120 := NewPopulatedUuid(r)
this.Id[i] = *v120
}
}
if r.Intn(10) != 0 {
v121 := r.Intn(10)
this.Value = make([]github_com_gogo_protobuf_test_custom.Uint128, v121)
for i := 0; i < v121; i++ {
v122 := github_com_gogo_protobuf_test_custom.NewPopulatedUint128(r)
this.Value[i] = *v122
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNinRepCustom(r randyThetest, easy bool) *NinRepCustom {
this := &NinRepCustom{}
if r.Intn(10) != 0 {
v123 := r.Intn(10)
this.Id = make([]Uuid, v123)
for i := 0; i < v123; i++ {
v124 := NewPopulatedUuid(r)
this.Id[i] = *v124
}
}
if r.Intn(10) != 0 {
v125 := r.Intn(10)
this.Value = make([]github_com_gogo_protobuf_test_custom.Uint128, v125)
for i := 0; i < v125; i++ {
v126 := github_com_gogo_protobuf_test_custom.NewPopulatedUint128(r)
this.Value[i] = *v126
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNinOptNativeUnion(r randyThetest, easy bool) *NinOptNativeUnion {
this := &NinOptNativeUnion{}
fieldNum := r.Intn(9)
switch fieldNum {
case 0:
v127 := float64(r.Float64())
if r.Intn(2) == 0 {
v127 *= -1
}
this.Field1 = &v127
case 1:
v128 := float32(r.Float32())
if r.Intn(2) == 0 {
v128 *= -1
}
this.Field2 = &v128
case 2:
v129 := int32(r.Int31())
if r.Intn(2) == 0 {
v129 *= -1
}
this.Field3 = &v129
case 3:
v130 := int64(r.Int63())
if r.Intn(2) == 0 {
v130 *= -1
}
this.Field4 = &v130
case 4:
v131 := uint32(r.Uint32())
this.Field5 = &v131
case 5:
v132 := uint64(uint64(r.Uint32()))
this.Field6 = &v132
case 6:
v133 := bool(bool(r.Intn(2) == 0))
this.Field13 = &v133
case 7:
v134 := string(randStringThetest(r))
this.Field14 = &v134
case 8:
v135 := r.Intn(100)
this.Field15 = make([]byte, v135)
for i := 0; i < v135; i++ {
this.Field15[i] = byte(r.Intn(256))
}
}
return this
}
func NewPopulatedNinOptStructUnion(r randyThetest, easy bool) *NinOptStructUnion {
this := &NinOptStructUnion{}
fieldNum := r.Intn(9)
switch fieldNum {
case 0:
v136 := float64(r.Float64())
if r.Intn(2) == 0 {
v136 *= -1
}
this.Field1 = &v136
case 1:
v137 := float32(r.Float32())
if r.Intn(2) == 0 {
v137 *= -1
}
this.Field2 = &v137
case 2:
this.Field3 = NewPopulatedNidOptNative(r, easy)
case 3:
this.Field4 = NewPopulatedNinOptNative(r, easy)
case 4:
v138 := uint64(uint64(r.Uint32()))
this.Field6 = &v138
case 5:
v139 := int32(r.Int31())
if r.Intn(2) == 0 {
v139 *= -1
}
this.Field7 = &v139
case 6:
v140 := bool(bool(r.Intn(2) == 0))
this.Field13 = &v140
case 7:
v141 := string(randStringThetest(r))
this.Field14 = &v141
case 8:
v142 := r.Intn(100)
this.Field15 = make([]byte, v142)
for i := 0; i < v142; i++ {
this.Field15[i] = byte(r.Intn(256))
}
}
return this
}
func NewPopulatedNinEmbeddedStructUnion(r randyThetest, easy bool) *NinEmbeddedStructUnion {
this := &NinEmbeddedStructUnion{}
fieldNum := r.Intn(3)
switch fieldNum {
case 0:
this.NidOptNative = NewPopulatedNidOptNative(r, easy)
case 1:
this.Field200 = NewPopulatedNinOptNative(r, easy)
case 2:
v143 := bool(bool(r.Intn(2) == 0))
this.Field210 = &v143
}
return this
}
func NewPopulatedNinNestedStructUnion(r randyThetest, easy bool) *NinNestedStructUnion {
this := &NinNestedStructUnion{}
fieldNum := r.Intn(3)
switch fieldNum {
case 0:
this.Field1 = NewPopulatedNinOptNativeUnion(r, easy)
case 1:
this.Field2 = NewPopulatedNinOptStructUnion(r, easy)
case 2:
this.Field3 = NewPopulatedNinEmbeddedStructUnion(r, easy)
}
return this
}
func NewPopulatedTree(r randyThetest, easy bool) *Tree {
this := &Tree{}
fieldNum := r.Intn(102)
switch fieldNum {
case 0:
this.Or = NewPopulatedOrBranch(r, easy)
case 1:
this.And = NewPopulatedAndBranch(r, easy)
case 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101:
this.Leaf = NewPopulatedLeaf(r, easy)
}
return this
}
func NewPopulatedOrBranch(r randyThetest, easy bool) *OrBranch {
this := &OrBranch{}
v144 := NewPopulatedTree(r, easy)
this.Left = *v144
v145 := NewPopulatedTree(r, easy)
this.Right = *v145
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedAndBranch(r randyThetest, easy bool) *AndBranch {
this := &AndBranch{}
v146 := NewPopulatedTree(r, easy)
this.Left = *v146
v147 := NewPopulatedTree(r, easy)
this.Right = *v147
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedLeaf(r randyThetest, easy bool) *Leaf {
this := &Leaf{}
this.Value = int64(r.Int63())
if r.Intn(2) == 0 {
this.Value *= -1
}
this.StrValue = string(randStringThetest(r))
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedDeepTree(r randyThetest, easy bool) *DeepTree {
this := &DeepTree{}
fieldNum := r.Intn(102)
switch fieldNum {
case 0:
this.Down = NewPopulatedADeepBranch(r, easy)
case 1:
this.And = NewPopulatedAndDeepBranch(r, easy)
case 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101:
this.Leaf = NewPopulatedDeepLeaf(r, easy)
}
return this
}
func NewPopulatedADeepBranch(r randyThetest, easy bool) *ADeepBranch {
this := &ADeepBranch{}
v148 := NewPopulatedDeepTree(r, easy)
this.Down = *v148
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedAndDeepBranch(r randyThetest, easy bool) *AndDeepBranch {
this := &AndDeepBranch{}
v149 := NewPopulatedDeepTree(r, easy)
this.Left = *v149
v150 := NewPopulatedDeepTree(r, easy)
this.Right = *v150
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedDeepLeaf(r randyThetest, easy bool) *DeepLeaf {
this := &DeepLeaf{}
v151 := NewPopulatedTree(r, easy)
this.Tree = *v151
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedNil(r randyThetest, easy bool) *Nil {
this := &Nil{}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 1)
}
return this
}
func NewPopulatedNidOptEnum(r randyThetest, easy bool) *NidOptEnum {
this := &NidOptEnum{}
this.Field1 = TheTestEnum([]int32{0, 1, 2}[r.Intn(3)])
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedNinOptEnum(r randyThetest, easy bool) *NinOptEnum {
this := &NinOptEnum{}
if r.Intn(10) != 0 {
v152 := TheTestEnum([]int32{0, 1, 2}[r.Intn(3)])
this.Field1 = &v152
}
if r.Intn(10) != 0 {
v153 := YetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field2 = &v153
}
if r.Intn(10) != 0 {
v154 := YetYetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field3 = &v154
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedNidRepEnum(r randyThetest, easy bool) *NidRepEnum {
this := &NidRepEnum{}
if r.Intn(10) != 0 {
v155 := r.Intn(10)
this.Field1 = make([]TheTestEnum, v155)
for i := 0; i < v155; i++ {
this.Field1[i] = TheTestEnum([]int32{0, 1, 2}[r.Intn(3)])
}
}
if r.Intn(10) != 0 {
v156 := r.Intn(10)
this.Field2 = make([]YetAnotherTestEnum, v156)
for i := 0; i < v156; i++ {
this.Field2[i] = YetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
}
}
if r.Intn(10) != 0 {
v157 := r.Intn(10)
this.Field3 = make([]YetYetAnotherTestEnum, v157)
for i := 0; i < v157; i++ {
this.Field3[i] = YetYetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedNinRepEnum(r randyThetest, easy bool) *NinRepEnum {
this := &NinRepEnum{}
if r.Intn(10) != 0 {
v158 := r.Intn(10)
this.Field1 = make([]TheTestEnum, v158)
for i := 0; i < v158; i++ {
this.Field1[i] = TheTestEnum([]int32{0, 1, 2}[r.Intn(3)])
}
}
if r.Intn(10) != 0 {
v159 := r.Intn(10)
this.Field2 = make([]YetAnotherTestEnum, v159)
for i := 0; i < v159; i++ {
this.Field2[i] = YetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
}
}
if r.Intn(10) != 0 {
v160 := r.Intn(10)
this.Field3 = make([]YetYetAnotherTestEnum, v160)
for i := 0; i < v160; i++ {
this.Field3[i] = YetYetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedNinOptEnumDefault(r randyThetest, easy bool) *NinOptEnumDefault {
this := &NinOptEnumDefault{}
if r.Intn(10) != 0 {
v161 := TheTestEnum([]int32{0, 1, 2}[r.Intn(3)])
this.Field1 = &v161
}
if r.Intn(10) != 0 {
v162 := YetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field2 = &v162
}
if r.Intn(10) != 0 {
v163 := YetYetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field3 = &v163
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedAnotherNinOptEnum(r randyThetest, easy bool) *AnotherNinOptEnum {
this := &AnotherNinOptEnum{}
if r.Intn(10) != 0 {
v164 := AnotherTestEnum([]int32{10, 11}[r.Intn(2)])
this.Field1 = &v164
}
if r.Intn(10) != 0 {
v165 := YetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field2 = &v165
}
if r.Intn(10) != 0 {
v166 := YetYetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field3 = &v166
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedAnotherNinOptEnumDefault(r randyThetest, easy bool) *AnotherNinOptEnumDefault {
this := &AnotherNinOptEnumDefault{}
if r.Intn(10) != 0 {
v167 := AnotherTestEnum([]int32{10, 11}[r.Intn(2)])
this.Field1 = &v167
}
if r.Intn(10) != 0 {
v168 := YetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field2 = &v168
}
if r.Intn(10) != 0 {
v169 := YetYetAnotherTestEnum([]int32{0, 1}[r.Intn(2)])
this.Field3 = &v169
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedTimer(r randyThetest, easy bool) *Timer {
this := &Timer{}
this.Time1 = int64(r.Int63())
if r.Intn(2) == 0 {
this.Time1 *= -1
}
this.Time2 = int64(r.Int63())
if r.Intn(2) == 0 {
this.Time2 *= -1
}
v170 := r.Intn(100)
this.Data = make([]byte, v170)
for i := 0; i < v170; i++ {
this.Data[i] = byte(r.Intn(256))
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedMyExtendable(r randyThetest, easy bool) *MyExtendable {
this := &MyExtendable{}
if r.Intn(10) != 0 {
v171 := int64(r.Int63())
if r.Intn(2) == 0 {
v171 *= -1
}
this.Field1 = &v171
}
if !easy && r.Intn(10) != 0 {
l := r.Intn(5)
for i := 0; i < l; i++ {
fieldNumber := r.Intn(100) + 100
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
dAtA := randFieldThetest(nil, r, fieldNumber, wire)
github_com_gogo_protobuf_proto.SetRawExtension(this, int32(fieldNumber), dAtA)
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 201)
}
return this
}
func NewPopulatedOtherExtenable(r randyThetest, easy bool) *OtherExtenable {
this := &OtherExtenable{}
if r.Intn(10) != 0 {
this.M = NewPopulatedMyExtendable(r, easy)
}
if r.Intn(10) != 0 {
v172 := int64(r.Int63())
if r.Intn(2) == 0 {
v172 *= -1
}
this.Field2 = &v172
}
if r.Intn(10) != 0 {
v173 := int64(r.Int63())
if r.Intn(2) == 0 {
v173 *= -1
}
this.Field13 = &v173
}
if !easy && r.Intn(10) != 0 {
l := r.Intn(5)
for i := 0; i < l; i++ {
eIndex := r.Intn(2)
fieldNumber := 0
switch eIndex {
case 0:
fieldNumber = r.Intn(3) + 14
case 1:
fieldNumber = r.Intn(3) + 10
}
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
dAtA := randFieldThetest(nil, r, fieldNumber, wire)
github_com_gogo_protobuf_proto.SetRawExtension(this, int32(fieldNumber), dAtA)
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 18)
}
return this
}
func NewPopulatedNestedDefinition(r randyThetest, easy bool) *NestedDefinition {
this := &NestedDefinition{}
if r.Intn(10) != 0 {
v174 := int64(r.Int63())
if r.Intn(2) == 0 {
v174 *= -1
}
this.Field1 = &v174
}
if r.Intn(10) != 0 {
v175 := NestedDefinition_NestedEnum([]int32{1}[r.Intn(1)])
this.EnumField = &v175
}
if r.Intn(10) != 0 {
this.NNM = NewPopulatedNestedDefinition_NestedMessage_NestedNestedMsg(r, easy)
}
if r.Intn(10) != 0 {
this.NM = NewPopulatedNestedDefinition_NestedMessage(r, easy)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 5)
}
return this
}
func NewPopulatedNestedDefinition_NestedMessage(r randyThetest, easy bool) *NestedDefinition_NestedMessage {
this := &NestedDefinition_NestedMessage{}
if r.Intn(10) != 0 {
v176 := uint64(uint64(r.Uint32()))
this.NestedField1 = &v176
}
if r.Intn(10) != 0 {
this.NNM = NewPopulatedNestedDefinition_NestedMessage_NestedNestedMsg(r, easy)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNestedDefinition_NestedMessage_NestedNestedMsg(r randyThetest, easy bool) *NestedDefinition_NestedMessage_NestedNestedMsg {
this := &NestedDefinition_NestedMessage_NestedNestedMsg{}
if r.Intn(10) != 0 {
v177 := string(randStringThetest(r))
this.NestedNestedField1 = &v177
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 11)
}
return this
}
func NewPopulatedNestedScope(r randyThetest, easy bool) *NestedScope {
this := &NestedScope{}
if r.Intn(10) != 0 {
this.A = NewPopulatedNestedDefinition_NestedMessage_NestedNestedMsg(r, easy)
}
if r.Intn(10) != 0 {
v178 := NestedDefinition_NestedEnum([]int32{1}[r.Intn(1)])
this.B = &v178
}
if r.Intn(10) != 0 {
this.C = NewPopulatedNestedDefinition_NestedMessage(r, easy)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 4)
}
return this
}
func NewPopulatedNinOptNativeDefault(r randyThetest, easy bool) *NinOptNativeDefault {
this := &NinOptNativeDefault{}
if r.Intn(10) != 0 {
v179 := float64(r.Float64())
if r.Intn(2) == 0 {
v179 *= -1
}
this.Field1 = &v179
}
if r.Intn(10) != 0 {
v180 := float32(r.Float32())
if r.Intn(2) == 0 {
v180 *= -1
}
this.Field2 = &v180
}
if r.Intn(10) != 0 {
v181 := int32(r.Int31())
if r.Intn(2) == 0 {
v181 *= -1
}
this.Field3 = &v181
}
if r.Intn(10) != 0 {
v182 := int64(r.Int63())
if r.Intn(2) == 0 {
v182 *= -1
}
this.Field4 = &v182
}
if r.Intn(10) != 0 {
v183 := uint32(r.Uint32())
this.Field5 = &v183
}
if r.Intn(10) != 0 {
v184 := uint64(uint64(r.Uint32()))
this.Field6 = &v184
}
if r.Intn(10) != 0 {
v185 := int32(r.Int31())
if r.Intn(2) == 0 {
v185 *= -1
}
this.Field7 = &v185
}
if r.Intn(10) != 0 {
v186 := int64(r.Int63())
if r.Intn(2) == 0 {
v186 *= -1
}
this.Field8 = &v186
}
if r.Intn(10) != 0 {
v187 := uint32(r.Uint32())
this.Field9 = &v187
}
if r.Intn(10) != 0 {
v188 := int32(r.Int31())
if r.Intn(2) == 0 {
v188 *= -1
}
this.Field10 = &v188
}
if r.Intn(10) != 0 {
v189 := uint64(uint64(r.Uint32()))
this.Field11 = &v189
}
if r.Intn(10) != 0 {
v190 := int64(r.Int63())
if r.Intn(2) == 0 {
v190 *= -1
}
this.Field12 = &v190
}
if r.Intn(10) != 0 {
v191 := bool(bool(r.Intn(2) == 0))
this.Field13 = &v191
}
if r.Intn(10) != 0 {
v192 := string(randStringThetest(r))
this.Field14 = &v192
}
if r.Intn(10) != 0 {
v193 := r.Intn(100)
this.Field15 = make([]byte, v193)
for i := 0; i < v193; i++ {
this.Field15[i] = byte(r.Intn(256))
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedCustomContainer(r randyThetest, easy bool) *CustomContainer {
this := &CustomContainer{}
v194 := NewPopulatedNidOptCustom(r, easy)
this.CustomStruct = *v194
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedCustomNameNidOptNative(r randyThetest, easy bool) *CustomNameNidOptNative {
this := &CustomNameNidOptNative{}
this.FieldA = float64(r.Float64())
if r.Intn(2) == 0 {
this.FieldA *= -1
}
this.FieldB = float32(r.Float32())
if r.Intn(2) == 0 {
this.FieldB *= -1
}
this.FieldC = int32(r.Int31())
if r.Intn(2) == 0 {
this.FieldC *= -1
}
this.FieldD = int64(r.Int63())
if r.Intn(2) == 0 {
this.FieldD *= -1
}
this.FieldE = uint32(r.Uint32())
this.FieldF = uint64(uint64(r.Uint32()))
this.FieldG = int32(r.Int31())
if r.Intn(2) == 0 {
this.FieldG *= -1
}
this.FieldH = int64(r.Int63())
if r.Intn(2) == 0 {
this.FieldH *= -1
}
this.FieldI = uint32(r.Uint32())
this.FieldJ = int32(r.Int31())
if r.Intn(2) == 0 {
this.FieldJ *= -1
}
this.FieldK = uint64(uint64(r.Uint32()))
this.FieldL = int64(r.Int63())
if r.Intn(2) == 0 {
this.FieldL *= -1
}
this.FieldM = bool(bool(r.Intn(2) == 0))
this.FieldN = string(randStringThetest(r))
v195 := r.Intn(100)
this.FieldO = make([]byte, v195)
for i := 0; i < v195; i++ {
this.FieldO[i] = byte(r.Intn(256))
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedCustomNameNinOptNative(r randyThetest, easy bool) *CustomNameNinOptNative {
this := &CustomNameNinOptNative{}
if r.Intn(10) != 0 {
v196 := float64(r.Float64())
if r.Intn(2) == 0 {
v196 *= -1
}
this.FieldA = &v196
}
if r.Intn(10) != 0 {
v197 := float32(r.Float32())
if r.Intn(2) == 0 {
v197 *= -1
}
this.FieldB = &v197
}
if r.Intn(10) != 0 {
v198 := int32(r.Int31())
if r.Intn(2) == 0 {
v198 *= -1
}
this.FieldC = &v198
}
if r.Intn(10) != 0 {
v199 := int64(r.Int63())
if r.Intn(2) == 0 {
v199 *= -1
}
this.FieldD = &v199
}
if r.Intn(10) != 0 {
v200 := uint32(r.Uint32())
this.FieldE = &v200
}
if r.Intn(10) != 0 {
v201 := uint64(uint64(r.Uint32()))
this.FieldF = &v201
}
if r.Intn(10) != 0 {
v202 := int32(r.Int31())
if r.Intn(2) == 0 {
v202 *= -1
}
this.FieldG = &v202
}
if r.Intn(10) != 0 {
v203 := int64(r.Int63())
if r.Intn(2) == 0 {
v203 *= -1
}
this.FieldH = &v203
}
if r.Intn(10) != 0 {
v204 := uint32(r.Uint32())
this.FieldI = &v204
}
if r.Intn(10) != 0 {
v205 := int32(r.Int31())
if r.Intn(2) == 0 {
v205 *= -1
}
this.FieldJ = &v205
}
if r.Intn(10) != 0 {
v206 := uint64(uint64(r.Uint32()))
this.FieldK = &v206
}
if r.Intn(10) != 0 {
v207 := int64(r.Int63())
if r.Intn(2) == 0 {
v207 *= -1
}
this.FielL = &v207
}
if r.Intn(10) != 0 {
v208 := bool(bool(r.Intn(2) == 0))
this.FieldM = &v208
}
if r.Intn(10) != 0 {
v209 := string(randStringThetest(r))
this.FieldN = &v209
}
if r.Intn(10) != 0 {
v210 := r.Intn(100)
this.FieldO = make([]byte, v210)
for i := 0; i < v210; i++ {
this.FieldO[i] = byte(r.Intn(256))
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedCustomNameNinRepNative(r randyThetest, easy bool) *CustomNameNinRepNative {
this := &CustomNameNinRepNative{}
if r.Intn(10) != 0 {
v211 := r.Intn(10)
this.FieldA = make([]float64, v211)
for i := 0; i < v211; i++ {
this.FieldA[i] = float64(r.Float64())
if r.Intn(2) == 0 {
this.FieldA[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v212 := r.Intn(10)
this.FieldB = make([]float32, v212)
for i := 0; i < v212; i++ {
this.FieldB[i] = float32(r.Float32())
if r.Intn(2) == 0 {
this.FieldB[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v213 := r.Intn(10)
this.FieldC = make([]int32, v213)
for i := 0; i < v213; i++ {
this.FieldC[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.FieldC[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v214 := r.Intn(10)
this.FieldD = make([]int64, v214)
for i := 0; i < v214; i++ {
this.FieldD[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.FieldD[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v215 := r.Intn(10)
this.FieldE = make([]uint32, v215)
for i := 0; i < v215; i++ {
this.FieldE[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v216 := r.Intn(10)
this.FieldF = make([]uint64, v216)
for i := 0; i < v216; i++ {
this.FieldF[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v217 := r.Intn(10)
this.FieldG = make([]int32, v217)
for i := 0; i < v217; i++ {
this.FieldG[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.FieldG[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v218 := r.Intn(10)
this.FieldH = make([]int64, v218)
for i := 0; i < v218; i++ {
this.FieldH[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.FieldH[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v219 := r.Intn(10)
this.FieldI = make([]uint32, v219)
for i := 0; i < v219; i++ {
this.FieldI[i] = uint32(r.Uint32())
}
}
if r.Intn(10) != 0 {
v220 := r.Intn(10)
this.FieldJ = make([]int32, v220)
for i := 0; i < v220; i++ {
this.FieldJ[i] = int32(r.Int31())
if r.Intn(2) == 0 {
this.FieldJ[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v221 := r.Intn(10)
this.FieldK = make([]uint64, v221)
for i := 0; i < v221; i++ {
this.FieldK[i] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v222 := r.Intn(10)
this.FieldL = make([]int64, v222)
for i := 0; i < v222; i++ {
this.FieldL[i] = int64(r.Int63())
if r.Intn(2) == 0 {
this.FieldL[i] *= -1
}
}
}
if r.Intn(10) != 0 {
v223 := r.Intn(10)
this.FieldM = make([]bool, v223)
for i := 0; i < v223; i++ {
this.FieldM[i] = bool(bool(r.Intn(2) == 0))
}
}
if r.Intn(10) != 0 {
v224 := r.Intn(10)
this.FieldN = make([]string, v224)
for i := 0; i < v224; i++ {
this.FieldN[i] = string(randStringThetest(r))
}
}
if r.Intn(10) != 0 {
v225 := r.Intn(10)
this.FieldO = make([][]byte, v225)
for i := 0; i < v225; i++ {
v226 := r.Intn(100)
this.FieldO[i] = make([]byte, v226)
for j := 0; j < v226; j++ {
this.FieldO[i][j] = byte(r.Intn(256))
}
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedCustomNameNinStruct(r randyThetest, easy bool) *CustomNameNinStruct {
this := &CustomNameNinStruct{}
if r.Intn(10) != 0 {
v227 := float64(r.Float64())
if r.Intn(2) == 0 {
v227 *= -1
}
this.FieldA = &v227
}
if r.Intn(10) != 0 {
v228 := float32(r.Float32())
if r.Intn(2) == 0 {
v228 *= -1
}
this.FieldB = &v228
}
if r.Intn(10) != 0 {
this.FieldC = NewPopulatedNidOptNative(r, easy)
}
if r.Intn(10) != 0 {
v229 := r.Intn(5)
this.FieldD = make([]*NinOptNative, v229)
for i := 0; i < v229; i++ {
this.FieldD[i] = NewPopulatedNinOptNative(r, easy)
}
}
if r.Intn(10) != 0 {
v230 := uint64(uint64(r.Uint32()))
this.FieldE = &v230
}
if r.Intn(10) != 0 {
v231 := int32(r.Int31())
if r.Intn(2) == 0 {
v231 *= -1
}
this.FieldF = &v231
}
if r.Intn(10) != 0 {
this.FieldG = NewPopulatedNidOptNative(r, easy)
}
if r.Intn(10) != 0 {
v232 := bool(bool(r.Intn(2) == 0))
this.FieldH = &v232
}
if r.Intn(10) != 0 {
v233 := string(randStringThetest(r))
this.FieldI = &v233
}
if r.Intn(10) != 0 {
v234 := r.Intn(100)
this.FieldJ = make([]byte, v234)
for i := 0; i < v234; i++ {
this.FieldJ[i] = byte(r.Intn(256))
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 16)
}
return this
}
func NewPopulatedCustomNameCustomType(r randyThetest, easy bool) *CustomNameCustomType {
this := &CustomNameCustomType{}
if r.Intn(10) != 0 {
this.FieldA = NewPopulatedUuid(r)
}
if r.Intn(10) != 0 {
this.FieldB = github_com_gogo_protobuf_test_custom.NewPopulatedUint128(r)
}
if r.Intn(10) != 0 {
v235 := r.Intn(10)
this.FieldC = make([]Uuid, v235)
for i := 0; i < v235; i++ {
v236 := NewPopulatedUuid(r)
this.FieldC[i] = *v236
}
}
if r.Intn(10) != 0 {
v237 := r.Intn(10)
this.FieldD = make([]github_com_gogo_protobuf_test_custom.Uint128, v237)
for i := 0; i < v237; i++ {
v238 := github_com_gogo_protobuf_test_custom.NewPopulatedUint128(r)
this.FieldD[i] = *v238
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 5)
}
return this
}
func NewPopulatedCustomNameNinEmbeddedStructUnion(r randyThetest, easy bool) *CustomNameNinEmbeddedStructUnion {
this := &CustomNameNinEmbeddedStructUnion{}
fieldNum := r.Intn(3)
switch fieldNum {
case 0:
this.NidOptNative = NewPopulatedNidOptNative(r, easy)
case 1:
this.FieldA = NewPopulatedNinOptNative(r, easy)
case 2:
v239 := bool(bool(r.Intn(2) == 0))
this.FieldB = &v239
}
return this
}
func NewPopulatedCustomNameEnum(r randyThetest, easy bool) *CustomNameEnum {
this := &CustomNameEnum{}
if r.Intn(10) != 0 {
v240 := TheTestEnum([]int32{0, 1, 2}[r.Intn(3)])
this.FieldA = &v240
}
if r.Intn(10) != 0 {
v241 := r.Intn(10)
this.FieldB = make([]TheTestEnum, v241)
for i := 0; i < v241; i++ {
this.FieldB[i] = TheTestEnum([]int32{0, 1, 2}[r.Intn(3)])
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNoExtensionsMap(r randyThetest, easy bool) *NoExtensionsMap {
this := &NoExtensionsMap{}
if r.Intn(10) != 0 {
v242 := int64(r.Int63())
if r.Intn(2) == 0 {
v242 *= -1
}
this.Field1 = &v242
}
if !easy && r.Intn(10) != 0 {
l := r.Intn(5)
for i := 0; i < l; i++ {
fieldNumber := r.Intn(100) + 100
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
dAtA := randFieldThetest(nil, r, fieldNumber, wire)
github_com_gogo_protobuf_proto.SetRawExtension(this, int32(fieldNumber), dAtA)
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 201)
}
return this
}
func NewPopulatedUnrecognized(r randyThetest, easy bool) *Unrecognized {
this := &Unrecognized{}
if r.Intn(10) != 0 {
v243 := string(randStringThetest(r))
this.Field1 = &v243
}
if !easy && r.Intn(10) != 0 {
}
return this
}
func NewPopulatedUnrecognizedWithInner(r randyThetest, easy bool) *UnrecognizedWithInner {
this := &UnrecognizedWithInner{}
if r.Intn(10) != 0 {
v244 := r.Intn(5)
this.Embedded = make([]*UnrecognizedWithInner_Inner, v244)
for i := 0; i < v244; i++ {
this.Embedded[i] = NewPopulatedUnrecognizedWithInner_Inner(r, easy)
}
}
if r.Intn(10) != 0 {
v245 := string(randStringThetest(r))
this.Field2 = &v245
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedUnrecognizedWithInner_Inner(r randyThetest, easy bool) *UnrecognizedWithInner_Inner {
this := &UnrecognizedWithInner_Inner{}
if r.Intn(10) != 0 {
v246 := uint32(r.Uint32())
this.Field1 = &v246
}
if !easy && r.Intn(10) != 0 {
}
return this
}
func NewPopulatedUnrecognizedWithEmbed(r randyThetest, easy bool) *UnrecognizedWithEmbed {
this := &UnrecognizedWithEmbed{}
v247 := NewPopulatedUnrecognizedWithEmbed_Embedded(r, easy)
this.UnrecognizedWithEmbed_Embedded = *v247
if r.Intn(10) != 0 {
v248 := string(randStringThetest(r))
this.Field2 = &v248
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedUnrecognizedWithEmbed_Embedded(r randyThetest, easy bool) *UnrecognizedWithEmbed_Embedded {
this := &UnrecognizedWithEmbed_Embedded{}
if r.Intn(10) != 0 {
v249 := uint32(r.Uint32())
this.Field1 = &v249
}
if !easy && r.Intn(10) != 0 {
}
return this
}
func NewPopulatedNode(r randyThetest, easy bool) *Node {
this := &Node{}
if r.Intn(10) != 0 {
v250 := string(randStringThetest(r))
this.Label = &v250
}
if r.Intn(10) == 0 {
v251 := r.Intn(5)
this.Children = make([]*Node, v251)
for i := 0; i < v251; i++ {
this.Children[i] = NewPopulatedNode(r, easy)
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 3)
}
return this
}
func NewPopulatedNonByteCustomType(r randyThetest, easy bool) *NonByteCustomType {
this := &NonByteCustomType{}
if r.Intn(10) != 0 {
this.Field1 = NewPopulatedT(r)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedNidOptNonByteCustomType(r randyThetest, easy bool) *NidOptNonByteCustomType {
this := &NidOptNonByteCustomType{}
v252 := NewPopulatedT(r)
this.Field1 = *v252
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedNinOptNonByteCustomType(r randyThetest, easy bool) *NinOptNonByteCustomType {
this := &NinOptNonByteCustomType{}
if r.Intn(10) != 0 {
this.Field1 = NewPopulatedT(r)
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedNidRepNonByteCustomType(r randyThetest, easy bool) *NidRepNonByteCustomType {
this := &NidRepNonByteCustomType{}
if r.Intn(10) != 0 {
v253 := r.Intn(10)
this.Field1 = make([]T, v253)
for i := 0; i < v253; i++ {
v254 := NewPopulatedT(r)
this.Field1[i] = *v254
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedNinRepNonByteCustomType(r randyThetest, easy bool) *NinRepNonByteCustomType {
this := &NinRepNonByteCustomType{}
if r.Intn(10) != 0 {
v255 := r.Intn(10)
this.Field1 = make([]T, v255)
for i := 0; i < v255; i++ {
v256 := NewPopulatedT(r)
this.Field1[i] = *v256
}
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
func NewPopulatedProtoType(r randyThetest, easy bool) *ProtoType {
this := &ProtoType{}
if r.Intn(10) != 0 {
v257 := string(randStringThetest(r))
this.Field2 = &v257
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedThetest(r, 2)
}
return this
}
type randyThetest interface {
Float32() float32
Float64() float64
Int63() int64
Int31() int32
Uint32() uint32
Intn(n int) int
}
func randUTF8RuneThetest(r randyThetest) rune {
ru := r.Intn(62)
if ru < 10 {
return rune(ru + 48)
} else if ru < 36 {
return rune(ru + 55)
}
return rune(ru + 61)
}
func randStringThetest(r randyThetest) string {
v258 := r.Intn(100)
tmps := make([]rune, v258)
for i := 0; i < v258; i++ {
tmps[i] = randUTF8RuneThetest(r)
}
return string(tmps)
}
func randUnrecognizedThetest(r randyThetest, maxFieldNumber int) (dAtA []byte) {
l := r.Intn(5)
for i := 0; i < l; i++ {
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
fieldNumber := maxFieldNumber + r.Intn(100)
dAtA = randFieldThetest(dAtA, r, fieldNumber, wire)
}
return dAtA
}
func randFieldThetest(dAtA []byte, r randyThetest, fieldNumber int, wire int) []byte {
key := uint32(fieldNumber)<<3 | uint32(wire)
switch wire {
case 0:
dAtA = encodeVarintPopulateThetest(dAtA, uint64(key))
v259 := r.Int63()
if r.Intn(2) == 0 {
v259 *= -1
}
dAtA = encodeVarintPopulateThetest(dAtA, uint64(v259))
case 1:
dAtA = encodeVarintPopulateThetest(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
case 2:
dAtA = encodeVarintPopulateThetest(dAtA, uint64(key))
ll := r.Intn(100)
dAtA = encodeVarintPopulateThetest(dAtA, uint64(ll))
for j := 0; j < ll; j++ {
dAtA = append(dAtA, byte(r.Intn(256)))
}
default:
dAtA = encodeVarintPopulateThetest(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return dAtA
}
func encodeVarintPopulateThetest(dAtA []byte, v uint64) []byte {
for v >= 1<<7 {
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
v >>= 7
}
dAtA = append(dAtA, uint8(v))
return dAtA
}
func (m *NidOptNative) Size() (n int) {
var l int
_ = l
n += 9
n += 5
n += 1 + sovThetest(uint64(m.Field3))
n += 1 + sovThetest(uint64(m.Field4))
n += 1 + sovThetest(uint64(m.Field5))
n += 1 + sovThetest(uint64(m.Field6))
n += 1 + sozThetest(uint64(m.Field7))
n += 1 + sozThetest(uint64(m.Field8))
n += 5
n += 5
n += 9
n += 9
n += 2
l = len(m.Field14)
n += 1 + l + sovThetest(uint64(l))
if m.Field15 != nil {
l = len(m.Field15)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptNative) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 9
}
if m.Field2 != nil {
n += 5
}
if m.Field3 != nil {
n += 1 + sovThetest(uint64(*m.Field3))
}
if m.Field4 != nil {
n += 1 + sovThetest(uint64(*m.Field4))
}
if m.Field5 != nil {
n += 1 + sovThetest(uint64(*m.Field5))
}
if m.Field6 != nil {
n += 1 + sovThetest(uint64(*m.Field6))
}
if m.Field7 != nil {
n += 1 + sozThetest(uint64(*m.Field7))
}
if m.Field8 != nil {
n += 1 + sozThetest(uint64(*m.Field8))
}
if m.Field9 != nil {
n += 5
}
if m.Field10 != nil {
n += 5
}
if m.Field11 != nil {
n += 9
}
if m.Field12 != nil {
n += 9
}
if m.Field13 != nil {
n += 2
}
if m.Field14 != nil {
l = len(*m.Field14)
n += 1 + l + sovThetest(uint64(l))
}
if m.Field15 != nil {
l = len(m.Field15)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidRepNative) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
n += 9 * len(m.Field1)
}
if len(m.Field2) > 0 {
n += 5 * len(m.Field2)
}
if len(m.Field3) > 0 {
for _, e := range m.Field3 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field4) > 0 {
for _, e := range m.Field4 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field5) > 0 {
for _, e := range m.Field5 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field6) > 0 {
for _, e := range m.Field6 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field7) > 0 {
for _, e := range m.Field7 {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.Field8) > 0 {
for _, e := range m.Field8 {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.Field9) > 0 {
n += 5 * len(m.Field9)
}
if len(m.Field10) > 0 {
n += 5 * len(m.Field10)
}
if len(m.Field11) > 0 {
n += 9 * len(m.Field11)
}
if len(m.Field12) > 0 {
n += 9 * len(m.Field12)
}
if len(m.Field13) > 0 {
n += 2 * len(m.Field13)
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
l = len(s)
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
l = len(b)
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinRepNative) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
n += 9 * len(m.Field1)
}
if len(m.Field2) > 0 {
n += 5 * len(m.Field2)
}
if len(m.Field3) > 0 {
for _, e := range m.Field3 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field4) > 0 {
for _, e := range m.Field4 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field5) > 0 {
for _, e := range m.Field5 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field6) > 0 {
for _, e := range m.Field6 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field7) > 0 {
for _, e := range m.Field7 {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.Field8) > 0 {
for _, e := range m.Field8 {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.Field9) > 0 {
n += 5 * len(m.Field9)
}
if len(m.Field10) > 0 {
n += 5 * len(m.Field10)
}
if len(m.Field11) > 0 {
n += 9 * len(m.Field11)
}
if len(m.Field12) > 0 {
n += 9 * len(m.Field12)
}
if len(m.Field13) > 0 {
n += 2 * len(m.Field13)
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
l = len(s)
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
l = len(b)
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidRepPackedNative) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
n += 1 + sovThetest(uint64(len(m.Field1)*8)) + len(m.Field1)*8
}
if len(m.Field2) > 0 {
n += 1 + sovThetest(uint64(len(m.Field2)*4)) + len(m.Field2)*4
}
if len(m.Field3) > 0 {
l = 0
for _, e := range m.Field3 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field4) > 0 {
l = 0
for _, e := range m.Field4 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field5) > 0 {
l = 0
for _, e := range m.Field5 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field6) > 0 {
l = 0
for _, e := range m.Field6 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field7) > 0 {
l = 0
for _, e := range m.Field7 {
l += sozThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field8) > 0 {
l = 0
for _, e := range m.Field8 {
l += sozThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field9) > 0 {
n += 1 + sovThetest(uint64(len(m.Field9)*4)) + len(m.Field9)*4
}
if len(m.Field10) > 0 {
n += 1 + sovThetest(uint64(len(m.Field10)*4)) + len(m.Field10)*4
}
if len(m.Field11) > 0 {
n += 1 + sovThetest(uint64(len(m.Field11)*8)) + len(m.Field11)*8
}
if len(m.Field12) > 0 {
n += 1 + sovThetest(uint64(len(m.Field12)*8)) + len(m.Field12)*8
}
if len(m.Field13) > 0 {
n += 1 + sovThetest(uint64(len(m.Field13))) + len(m.Field13)*1
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinRepPackedNative) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
n += 1 + sovThetest(uint64(len(m.Field1)*8)) + len(m.Field1)*8
}
if len(m.Field2) > 0 {
n += 1 + sovThetest(uint64(len(m.Field2)*4)) + len(m.Field2)*4
}
if len(m.Field3) > 0 {
l = 0
for _, e := range m.Field3 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field4) > 0 {
l = 0
for _, e := range m.Field4 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field5) > 0 {
l = 0
for _, e := range m.Field5 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field6) > 0 {
l = 0
for _, e := range m.Field6 {
l += sovThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field7) > 0 {
l = 0
for _, e := range m.Field7 {
l += sozThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field8) > 0 {
l = 0
for _, e := range m.Field8 {
l += sozThetest(uint64(e))
}
n += 1 + sovThetest(uint64(l)) + l
}
if len(m.Field9) > 0 {
n += 1 + sovThetest(uint64(len(m.Field9)*4)) + len(m.Field9)*4
}
if len(m.Field10) > 0 {
n += 1 + sovThetest(uint64(len(m.Field10)*4)) + len(m.Field10)*4
}
if len(m.Field11) > 0 {
n += 1 + sovThetest(uint64(len(m.Field11)*8)) + len(m.Field11)*8
}
if len(m.Field12) > 0 {
n += 1 + sovThetest(uint64(len(m.Field12)*8)) + len(m.Field12)*8
}
if len(m.Field13) > 0 {
n += 1 + sovThetest(uint64(len(m.Field13))) + len(m.Field13)*1
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidOptStruct) Size() (n int) {
var l int
_ = l
n += 9
n += 5
l = m.Field3.Size()
n += 1 + l + sovThetest(uint64(l))
l = m.Field4.Size()
n += 1 + l + sovThetest(uint64(l))
n += 1 + sovThetest(uint64(m.Field6))
n += 1 + sozThetest(uint64(m.Field7))
l = m.Field8.Size()
n += 1 + l + sovThetest(uint64(l))
n += 2
l = len(m.Field14)
n += 1 + l + sovThetest(uint64(l))
if m.Field15 != nil {
l = len(m.Field15)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptStruct) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 9
}
if m.Field2 != nil {
n += 5
}
if m.Field3 != nil {
l = m.Field3.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field4 != nil {
l = m.Field4.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field6 != nil {
n += 1 + sovThetest(uint64(*m.Field6))
}
if m.Field7 != nil {
n += 1 + sozThetest(uint64(*m.Field7))
}
if m.Field8 != nil {
l = m.Field8.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field13 != nil {
n += 2
}
if m.Field14 != nil {
l = len(*m.Field14)
n += 1 + l + sovThetest(uint64(l))
}
if m.Field15 != nil {
l = len(m.Field15)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidRepStruct) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
n += 9 * len(m.Field1)
}
if len(m.Field2) > 0 {
n += 5 * len(m.Field2)
}
if len(m.Field3) > 0 {
for _, e := range m.Field3 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field4) > 0 {
for _, e := range m.Field4 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field6) > 0 {
for _, e := range m.Field6 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field7) > 0 {
for _, e := range m.Field7 {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.Field8) > 0 {
for _, e := range m.Field8 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field13) > 0 {
n += 2 * len(m.Field13)
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
l = len(s)
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
l = len(b)
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinRepStruct) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
n += 9 * len(m.Field1)
}
if len(m.Field2) > 0 {
n += 5 * len(m.Field2)
}
if len(m.Field3) > 0 {
for _, e := range m.Field3 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field4) > 0 {
for _, e := range m.Field4 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field6) > 0 {
for _, e := range m.Field6 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field7) > 0 {
for _, e := range m.Field7 {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.Field8) > 0 {
for _, e := range m.Field8 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field13) > 0 {
n += 2 * len(m.Field13)
}
if len(m.Field14) > 0 {
for _, s := range m.Field14 {
l = len(s)
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Field15) > 0 {
for _, b := range m.Field15 {
l = len(b)
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidEmbeddedStruct) Size() (n int) {
var l int
_ = l
if m.NidOptNative != nil {
l = m.NidOptNative.Size()
n += 1 + l + sovThetest(uint64(l))
}
l = m.Field200.Size()
n += 2 + l + sovThetest(uint64(l))
n += 3
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinEmbeddedStruct) Size() (n int) {
var l int
_ = l
if m.NidOptNative != nil {
l = m.NidOptNative.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field200 != nil {
l = m.Field200.Size()
n += 2 + l + sovThetest(uint64(l))
}
if m.Field210 != nil {
n += 3
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidNestedStruct) Size() (n int) {
var l int
_ = l
l = m.Field1.Size()
n += 1 + l + sovThetest(uint64(l))
if len(m.Field2) > 0 {
for _, e := range m.Field2 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinNestedStruct) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
l = m.Field1.Size()
n += 1 + l + sovThetest(uint64(l))
}
if len(m.Field2) > 0 {
for _, e := range m.Field2 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidOptCustom) Size() (n int) {
var l int
_ = l
l = m.Id.Size()
n += 1 + l + sovThetest(uint64(l))
l = m.Value.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomDash) Size() (n int) {
var l int
_ = l
if m.Value != nil {
l = m.Value.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptCustom) Size() (n int) {
var l int
_ = l
if m.Id != nil {
l = m.Id.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Value != nil {
l = m.Value.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidRepCustom) Size() (n int) {
var l int
_ = l
if len(m.Id) > 0 {
for _, e := range m.Id {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Value) > 0 {
for _, e := range m.Value {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinRepCustom) Size() (n int) {
var l int
_ = l
if len(m.Id) > 0 {
for _, e := range m.Id {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.Value) > 0 {
for _, e := range m.Value {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptNativeUnion) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 9
}
if m.Field2 != nil {
n += 5
}
if m.Field3 != nil {
n += 1 + sovThetest(uint64(*m.Field3))
}
if m.Field4 != nil {
n += 1 + sovThetest(uint64(*m.Field4))
}
if m.Field5 != nil {
n += 1 + sovThetest(uint64(*m.Field5))
}
if m.Field6 != nil {
n += 1 + sovThetest(uint64(*m.Field6))
}
if m.Field13 != nil {
n += 2
}
if m.Field14 != nil {
l = len(*m.Field14)
n += 1 + l + sovThetest(uint64(l))
}
if m.Field15 != nil {
l = len(m.Field15)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptStructUnion) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 9
}
if m.Field2 != nil {
n += 5
}
if m.Field3 != nil {
l = m.Field3.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field4 != nil {
l = m.Field4.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field6 != nil {
n += 1 + sovThetest(uint64(*m.Field6))
}
if m.Field7 != nil {
n += 1 + sozThetest(uint64(*m.Field7))
}
if m.Field13 != nil {
n += 2
}
if m.Field14 != nil {
l = len(*m.Field14)
n += 1 + l + sovThetest(uint64(l))
}
if m.Field15 != nil {
l = len(m.Field15)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinEmbeddedStructUnion) Size() (n int) {
var l int
_ = l
if m.NidOptNative != nil {
l = m.NidOptNative.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field200 != nil {
l = m.Field200.Size()
n += 2 + l + sovThetest(uint64(l))
}
if m.Field210 != nil {
n += 3
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinNestedStructUnion) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
l = m.Field1.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field2 != nil {
l = m.Field2.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field3 != nil {
l = m.Field3.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Tree) Size() (n int) {
var l int
_ = l
if m.Or != nil {
l = m.Or.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.And != nil {
l = m.And.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Leaf != nil {
l = m.Leaf.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *OrBranch) Size() (n int) {
var l int
_ = l
l = m.Left.Size()
n += 1 + l + sovThetest(uint64(l))
l = m.Right.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *AndBranch) Size() (n int) {
var l int
_ = l
l = m.Left.Size()
n += 1 + l + sovThetest(uint64(l))
l = m.Right.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Leaf) Size() (n int) {
var l int
_ = l
n += 1 + sovThetest(uint64(m.Value))
l = len(m.StrValue)
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *DeepTree) Size() (n int) {
var l int
_ = l
if m.Down != nil {
l = m.Down.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.And != nil {
l = m.And.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Leaf != nil {
l = m.Leaf.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *ADeepBranch) Size() (n int) {
var l int
_ = l
l = m.Down.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *AndDeepBranch) Size() (n int) {
var l int
_ = l
l = m.Left.Size()
n += 1 + l + sovThetest(uint64(l))
l = m.Right.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *DeepLeaf) Size() (n int) {
var l int
_ = l
l = m.Tree.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Nil) Size() (n int) {
var l int
_ = l
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidOptEnum) Size() (n int) {
var l int
_ = l
n += 1 + sovThetest(uint64(m.Field1))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptEnum) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
if m.Field2 != nil {
n += 1 + sovThetest(uint64(*m.Field2))
}
if m.Field3 != nil {
n += 1 + sovThetest(uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidRepEnum) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
for _, e := range m.Field1 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field2) > 0 {
for _, e := range m.Field2 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field3) > 0 {
for _, e := range m.Field3 {
n += 1 + sovThetest(uint64(e))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinRepEnum) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
for _, e := range m.Field1 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field2) > 0 {
for _, e := range m.Field2 {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.Field3) > 0 {
for _, e := range m.Field3 {
n += 1 + sovThetest(uint64(e))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptEnumDefault) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
if m.Field2 != nil {
n += 1 + sovThetest(uint64(*m.Field2))
}
if m.Field3 != nil {
n += 1 + sovThetest(uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *AnotherNinOptEnum) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
if m.Field2 != nil {
n += 1 + sovThetest(uint64(*m.Field2))
}
if m.Field3 != nil {
n += 1 + sovThetest(uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *AnotherNinOptEnumDefault) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
if m.Field2 != nil {
n += 1 + sovThetest(uint64(*m.Field2))
}
if m.Field3 != nil {
n += 1 + sovThetest(uint64(*m.Field3))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Timer) Size() (n int) {
var l int
_ = l
n += 9
n += 9
if m.Data != nil {
l = len(m.Data)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *MyExtendable) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
n += github_com_gogo_protobuf_proto.SizeOfInternalExtension(m)
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *OtherExtenable) Size() (n int) {
var l int
_ = l
if m.M != nil {
l = m.M.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.Field2 != nil {
n += 1 + sovThetest(uint64(*m.Field2))
}
if m.Field13 != nil {
n += 1 + sovThetest(uint64(*m.Field13))
}
n += github_com_gogo_protobuf_proto.SizeOfInternalExtension(m)
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NestedDefinition) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
if m.EnumField != nil {
n += 1 + sovThetest(uint64(*m.EnumField))
}
if m.NNM != nil {
l = m.NNM.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.NM != nil {
l = m.NM.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NestedDefinition_NestedMessage) Size() (n int) {
var l int
_ = l
if m.NestedField1 != nil {
n += 9
}
if m.NNM != nil {
l = m.NNM.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NestedDefinition_NestedMessage_NestedNestedMsg) Size() (n int) {
var l int
_ = l
if m.NestedNestedField1 != nil {
l = len(*m.NestedNestedField1)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NestedScope) Size() (n int) {
var l int
_ = l
if m.A != nil {
l = m.A.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.B != nil {
n += 1 + sovThetest(uint64(*m.B))
}
if m.C != nil {
l = m.C.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptNativeDefault) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 9
}
if m.Field2 != nil {
n += 5
}
if m.Field3 != nil {
n += 1 + sovThetest(uint64(*m.Field3))
}
if m.Field4 != nil {
n += 1 + sovThetest(uint64(*m.Field4))
}
if m.Field5 != nil {
n += 1 + sovThetest(uint64(*m.Field5))
}
if m.Field6 != nil {
n += 1 + sovThetest(uint64(*m.Field6))
}
if m.Field7 != nil {
n += 1 + sozThetest(uint64(*m.Field7))
}
if m.Field8 != nil {
n += 1 + sozThetest(uint64(*m.Field8))
}
if m.Field9 != nil {
n += 5
}
if m.Field10 != nil {
n += 5
}
if m.Field11 != nil {
n += 9
}
if m.Field12 != nil {
n += 9
}
if m.Field13 != nil {
n += 2
}
if m.Field14 != nil {
l = len(*m.Field14)
n += 1 + l + sovThetest(uint64(l))
}
if m.Field15 != nil {
l = len(m.Field15)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomContainer) Size() (n int) {
var l int
_ = l
l = m.CustomStruct.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomNameNidOptNative) Size() (n int) {
var l int
_ = l
n += 9
n += 5
n += 1 + sovThetest(uint64(m.FieldC))
n += 1 + sovThetest(uint64(m.FieldD))
n += 1 + sovThetest(uint64(m.FieldE))
n += 1 + sovThetest(uint64(m.FieldF))
n += 1 + sozThetest(uint64(m.FieldG))
n += 1 + sozThetest(uint64(m.FieldH))
n += 5
n += 5
n += 9
n += 9
n += 2
l = len(m.FieldN)
n += 1 + l + sovThetest(uint64(l))
if m.FieldO != nil {
l = len(m.FieldO)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomNameNinOptNative) Size() (n int) {
var l int
_ = l
if m.FieldA != nil {
n += 9
}
if m.FieldB != nil {
n += 5
}
if m.FieldC != nil {
n += 1 + sovThetest(uint64(*m.FieldC))
}
if m.FieldD != nil {
n += 1 + sovThetest(uint64(*m.FieldD))
}
if m.FieldE != nil {
n += 1 + sovThetest(uint64(*m.FieldE))
}
if m.FieldF != nil {
n += 1 + sovThetest(uint64(*m.FieldF))
}
if m.FieldG != nil {
n += 1 + sozThetest(uint64(*m.FieldG))
}
if m.FieldH != nil {
n += 1 + sozThetest(uint64(*m.FieldH))
}
if m.FieldI != nil {
n += 5
}
if m.FieldJ != nil {
n += 5
}
if m.FieldK != nil {
n += 9
}
if m.FielL != nil {
n += 9
}
if m.FieldM != nil {
n += 2
}
if m.FieldN != nil {
l = len(*m.FieldN)
n += 1 + l + sovThetest(uint64(l))
}
if m.FieldO != nil {
l = len(m.FieldO)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomNameNinRepNative) Size() (n int) {
var l int
_ = l
if len(m.FieldA) > 0 {
n += 9 * len(m.FieldA)
}
if len(m.FieldB) > 0 {
n += 5 * len(m.FieldB)
}
if len(m.FieldC) > 0 {
for _, e := range m.FieldC {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.FieldD) > 0 {
for _, e := range m.FieldD {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.FieldE) > 0 {
for _, e := range m.FieldE {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.FieldF) > 0 {
for _, e := range m.FieldF {
n += 1 + sovThetest(uint64(e))
}
}
if len(m.FieldG) > 0 {
for _, e := range m.FieldG {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.FieldH) > 0 {
for _, e := range m.FieldH {
n += 1 + sozThetest(uint64(e))
}
}
if len(m.FieldI) > 0 {
n += 5 * len(m.FieldI)
}
if len(m.FieldJ) > 0 {
n += 5 * len(m.FieldJ)
}
if len(m.FieldK) > 0 {
n += 9 * len(m.FieldK)
}
if len(m.FieldL) > 0 {
n += 9 * len(m.FieldL)
}
if len(m.FieldM) > 0 {
n += 2 * len(m.FieldM)
}
if len(m.FieldN) > 0 {
for _, s := range m.FieldN {
l = len(s)
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.FieldO) > 0 {
for _, b := range m.FieldO {
l = len(b)
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomNameNinStruct) Size() (n int) {
var l int
_ = l
if m.FieldA != nil {
n += 9
}
if m.FieldB != nil {
n += 5
}
if m.FieldC != nil {
l = m.FieldC.Size()
n += 1 + l + sovThetest(uint64(l))
}
if len(m.FieldD) > 0 {
for _, e := range m.FieldD {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.FieldE != nil {
n += 1 + sovThetest(uint64(*m.FieldE))
}
if m.FieldF != nil {
n += 1 + sozThetest(uint64(*m.FieldF))
}
if m.FieldG != nil {
l = m.FieldG.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.FieldH != nil {
n += 2
}
if m.FieldI != nil {
l = len(*m.FieldI)
n += 1 + l + sovThetest(uint64(l))
}
if m.FieldJ != nil {
l = len(m.FieldJ)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomNameCustomType) Size() (n int) {
var l int
_ = l
if m.FieldA != nil {
l = m.FieldA.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.FieldB != nil {
l = m.FieldB.Size()
n += 1 + l + sovThetest(uint64(l))
}
if len(m.FieldC) > 0 {
for _, e := range m.FieldC {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if len(m.FieldD) > 0 {
for _, e := range m.FieldD {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomNameNinEmbeddedStructUnion) Size() (n int) {
var l int
_ = l
if m.NidOptNative != nil {
l = m.NidOptNative.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.FieldA != nil {
l = m.FieldA.Size()
n += 2 + l + sovThetest(uint64(l))
}
if m.FieldB != nil {
n += 3
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *CustomNameEnum) Size() (n int) {
var l int
_ = l
if m.FieldA != nil {
n += 1 + sovThetest(uint64(*m.FieldA))
}
if len(m.FieldB) > 0 {
for _, e := range m.FieldB {
n += 1 + sovThetest(uint64(e))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NoExtensionsMap) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
if m.XXX_extensions != nil {
n += len(m.XXX_extensions)
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Unrecognized) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
l = len(*m.Field1)
n += 1 + l + sovThetest(uint64(l))
}
return n
}
func (m *UnrecognizedWithInner) Size() (n int) {
var l int
_ = l
if len(m.Embedded) > 0 {
for _, e := range m.Embedded {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.Field2 != nil {
l = len(*m.Field2)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *UnrecognizedWithInner_Inner) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
return n
}
func (m *UnrecognizedWithEmbed) Size() (n int) {
var l int
_ = l
l = m.UnrecognizedWithEmbed_Embedded.Size()
n += 1 + l + sovThetest(uint64(l))
if m.Field2 != nil {
l = len(*m.Field2)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *UnrecognizedWithEmbed_Embedded) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
n += 1 + sovThetest(uint64(*m.Field1))
}
return n
}
func (m *Node) Size() (n int) {
var l int
_ = l
if m.Label != nil {
l = len(*m.Label)
n += 1 + l + sovThetest(uint64(l))
}
if len(m.Children) > 0 {
for _, e := range m.Children {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NonByteCustomType) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
l = m.Field1.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidOptNonByteCustomType) Size() (n int) {
var l int
_ = l
l = m.Field1.Size()
n += 1 + l + sovThetest(uint64(l))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinOptNonByteCustomType) Size() (n int) {
var l int
_ = l
if m.Field1 != nil {
l = m.Field1.Size()
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NidRepNonByteCustomType) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
for _, e := range m.Field1 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *NinRepNonByteCustomType) Size() (n int) {
var l int
_ = l
if len(m.Field1) > 0 {
for _, e := range m.Field1 {
l = e.Size()
n += 1 + l + sovThetest(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *ProtoType) Size() (n int) {
var l int
_ = l
if m.Field2 != nil {
l = len(*m.Field2)
n += 1 + l + sovThetest(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovThetest(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozThetest(x uint64) (n int) {
return sovThetest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *NidOptNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidOptNative{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + fmt.Sprintf("%v", this.Field3) + `,`,
`Field4:` + fmt.Sprintf("%v", this.Field4) + `,`,
`Field5:` + fmt.Sprintf("%v", this.Field5) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + fmt.Sprintf("%v", this.Field8) + `,`,
`Field9:` + fmt.Sprintf("%v", this.Field9) + `,`,
`Field10:` + fmt.Sprintf("%v", this.Field10) + `,`,
`Field11:` + fmt.Sprintf("%v", this.Field11) + `,`,
`Field12:` + fmt.Sprintf("%v", this.Field12) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`Field14:` + fmt.Sprintf("%v", this.Field14) + `,`,
`Field15:` + fmt.Sprintf("%v", this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptNative{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + valueToStringThetest(this.Field3) + `,`,
`Field4:` + valueToStringThetest(this.Field4) + `,`,
`Field5:` + valueToStringThetest(this.Field5) + `,`,
`Field6:` + valueToStringThetest(this.Field6) + `,`,
`Field7:` + valueToStringThetest(this.Field7) + `,`,
`Field8:` + valueToStringThetest(this.Field8) + `,`,
`Field9:` + valueToStringThetest(this.Field9) + `,`,
`Field10:` + valueToStringThetest(this.Field10) + `,`,
`Field11:` + valueToStringThetest(this.Field11) + `,`,
`Field12:` + valueToStringThetest(this.Field12) + `,`,
`Field13:` + valueToStringThetest(this.Field13) + `,`,
`Field14:` + valueToStringThetest(this.Field14) + `,`,
`Field15:` + valueToStringThetest(this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidRepNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidRepNative{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + fmt.Sprintf("%v", this.Field3) + `,`,
`Field4:` + fmt.Sprintf("%v", this.Field4) + `,`,
`Field5:` + fmt.Sprintf("%v", this.Field5) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + fmt.Sprintf("%v", this.Field8) + `,`,
`Field9:` + fmt.Sprintf("%v", this.Field9) + `,`,
`Field10:` + fmt.Sprintf("%v", this.Field10) + `,`,
`Field11:` + fmt.Sprintf("%v", this.Field11) + `,`,
`Field12:` + fmt.Sprintf("%v", this.Field12) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`Field14:` + fmt.Sprintf("%v", this.Field14) + `,`,
`Field15:` + fmt.Sprintf("%v", this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinRepNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinRepNative{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + fmt.Sprintf("%v", this.Field3) + `,`,
`Field4:` + fmt.Sprintf("%v", this.Field4) + `,`,
`Field5:` + fmt.Sprintf("%v", this.Field5) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + fmt.Sprintf("%v", this.Field8) + `,`,
`Field9:` + fmt.Sprintf("%v", this.Field9) + `,`,
`Field10:` + fmt.Sprintf("%v", this.Field10) + `,`,
`Field11:` + fmt.Sprintf("%v", this.Field11) + `,`,
`Field12:` + fmt.Sprintf("%v", this.Field12) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`Field14:` + fmt.Sprintf("%v", this.Field14) + `,`,
`Field15:` + fmt.Sprintf("%v", this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidRepPackedNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidRepPackedNative{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + fmt.Sprintf("%v", this.Field3) + `,`,
`Field4:` + fmt.Sprintf("%v", this.Field4) + `,`,
`Field5:` + fmt.Sprintf("%v", this.Field5) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + fmt.Sprintf("%v", this.Field8) + `,`,
`Field9:` + fmt.Sprintf("%v", this.Field9) + `,`,
`Field10:` + fmt.Sprintf("%v", this.Field10) + `,`,
`Field11:` + fmt.Sprintf("%v", this.Field11) + `,`,
`Field12:` + fmt.Sprintf("%v", this.Field12) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinRepPackedNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinRepPackedNative{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + fmt.Sprintf("%v", this.Field3) + `,`,
`Field4:` + fmt.Sprintf("%v", this.Field4) + `,`,
`Field5:` + fmt.Sprintf("%v", this.Field5) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + fmt.Sprintf("%v", this.Field8) + `,`,
`Field9:` + fmt.Sprintf("%v", this.Field9) + `,`,
`Field10:` + fmt.Sprintf("%v", this.Field10) + `,`,
`Field11:` + fmt.Sprintf("%v", this.Field11) + `,`,
`Field12:` + fmt.Sprintf("%v", this.Field12) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidOptStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidOptStruct{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + strings.Replace(strings.Replace(this.Field3.String(), "NidOptNative", "NidOptNative", 1), `&`, ``, 1) + `,`,
`Field4:` + strings.Replace(strings.Replace(this.Field4.String(), "NinOptNative", "NinOptNative", 1), `&`, ``, 1) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + strings.Replace(strings.Replace(this.Field8.String(), "NidOptNative", "NidOptNative", 1), `&`, ``, 1) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`Field14:` + fmt.Sprintf("%v", this.Field14) + `,`,
`Field15:` + fmt.Sprintf("%v", this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptStruct{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + strings.Replace(fmt.Sprintf("%v", this.Field3), "NidOptNative", "NidOptNative", 1) + `,`,
`Field4:` + strings.Replace(fmt.Sprintf("%v", this.Field4), "NinOptNative", "NinOptNative", 1) + `,`,
`Field6:` + valueToStringThetest(this.Field6) + `,`,
`Field7:` + valueToStringThetest(this.Field7) + `,`,
`Field8:` + strings.Replace(fmt.Sprintf("%v", this.Field8), "NidOptNative", "NidOptNative", 1) + `,`,
`Field13:` + valueToStringThetest(this.Field13) + `,`,
`Field14:` + valueToStringThetest(this.Field14) + `,`,
`Field15:` + valueToStringThetest(this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidRepStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidRepStruct{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Field3), "NidOptNative", "NidOptNative", 1), `&`, ``, 1) + `,`,
`Field4:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Field4), "NinOptNative", "NinOptNative", 1), `&`, ``, 1) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Field8), "NidOptNative", "NidOptNative", 1), `&`, ``, 1) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`Field14:` + fmt.Sprintf("%v", this.Field14) + `,`,
`Field15:` + fmt.Sprintf("%v", this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinRepStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinRepStruct{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + strings.Replace(fmt.Sprintf("%v", this.Field3), "NidOptNative", "NidOptNative", 1) + `,`,
`Field4:` + strings.Replace(fmt.Sprintf("%v", this.Field4), "NinOptNative", "NinOptNative", 1) + `,`,
`Field6:` + fmt.Sprintf("%v", this.Field6) + `,`,
`Field7:` + fmt.Sprintf("%v", this.Field7) + `,`,
`Field8:` + strings.Replace(fmt.Sprintf("%v", this.Field8), "NidOptNative", "NidOptNative", 1) + `,`,
`Field13:` + fmt.Sprintf("%v", this.Field13) + `,`,
`Field14:` + fmt.Sprintf("%v", this.Field14) + `,`,
`Field15:` + fmt.Sprintf("%v", this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidEmbeddedStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidEmbeddedStruct{`,
`NidOptNative:` + strings.Replace(fmt.Sprintf("%v", this.NidOptNative), "NidOptNative", "NidOptNative", 1) + `,`,
`Field200:` + strings.Replace(strings.Replace(this.Field200.String(), "NidOptNative", "NidOptNative", 1), `&`, ``, 1) + `,`,
`Field210:` + fmt.Sprintf("%v", this.Field210) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinEmbeddedStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinEmbeddedStruct{`,
`NidOptNative:` + strings.Replace(fmt.Sprintf("%v", this.NidOptNative), "NidOptNative", "NidOptNative", 1) + `,`,
`Field200:` + strings.Replace(fmt.Sprintf("%v", this.Field200), "NidOptNative", "NidOptNative", 1) + `,`,
`Field210:` + valueToStringThetest(this.Field210) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidNestedStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidNestedStruct{`,
`Field1:` + strings.Replace(strings.Replace(this.Field1.String(), "NidOptStruct", "NidOptStruct", 1), `&`, ``, 1) + `,`,
`Field2:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Field2), "NidRepStruct", "NidRepStruct", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinNestedStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinNestedStruct{`,
`Field1:` + strings.Replace(fmt.Sprintf("%v", this.Field1), "NinOptStruct", "NinOptStruct", 1) + `,`,
`Field2:` + strings.Replace(fmt.Sprintf("%v", this.Field2), "NinRepStruct", "NinRepStruct", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidOptCustom) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidOptCustom{`,
`Id:` + fmt.Sprintf("%v", this.Id) + `,`,
`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomDash) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomDash{`,
`Value:` + valueToStringThetest(this.Value) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptCustom) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptCustom{`,
`Id:` + valueToStringThetest(this.Id) + `,`,
`Value:` + valueToStringThetest(this.Value) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidRepCustom) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidRepCustom{`,
`Id:` + fmt.Sprintf("%v", this.Id) + `,`,
`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinRepCustom) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinRepCustom{`,
`Id:` + fmt.Sprintf("%v", this.Id) + `,`,
`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptNativeUnion) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptNativeUnion{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + valueToStringThetest(this.Field3) + `,`,
`Field4:` + valueToStringThetest(this.Field4) + `,`,
`Field5:` + valueToStringThetest(this.Field5) + `,`,
`Field6:` + valueToStringThetest(this.Field6) + `,`,
`Field13:` + valueToStringThetest(this.Field13) + `,`,
`Field14:` + valueToStringThetest(this.Field14) + `,`,
`Field15:` + valueToStringThetest(this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptStructUnion) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptStructUnion{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + strings.Replace(fmt.Sprintf("%v", this.Field3), "NidOptNative", "NidOptNative", 1) + `,`,
`Field4:` + strings.Replace(fmt.Sprintf("%v", this.Field4), "NinOptNative", "NinOptNative", 1) + `,`,
`Field6:` + valueToStringThetest(this.Field6) + `,`,
`Field7:` + valueToStringThetest(this.Field7) + `,`,
`Field13:` + valueToStringThetest(this.Field13) + `,`,
`Field14:` + valueToStringThetest(this.Field14) + `,`,
`Field15:` + valueToStringThetest(this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinEmbeddedStructUnion) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinEmbeddedStructUnion{`,
`NidOptNative:` + strings.Replace(fmt.Sprintf("%v", this.NidOptNative), "NidOptNative", "NidOptNative", 1) + `,`,
`Field200:` + strings.Replace(fmt.Sprintf("%v", this.Field200), "NinOptNative", "NinOptNative", 1) + `,`,
`Field210:` + valueToStringThetest(this.Field210) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinNestedStructUnion) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinNestedStructUnion{`,
`Field1:` + strings.Replace(fmt.Sprintf("%v", this.Field1), "NinOptNativeUnion", "NinOptNativeUnion", 1) + `,`,
`Field2:` + strings.Replace(fmt.Sprintf("%v", this.Field2), "NinOptStructUnion", "NinOptStructUnion", 1) + `,`,
`Field3:` + strings.Replace(fmt.Sprintf("%v", this.Field3), "NinEmbeddedStructUnion", "NinEmbeddedStructUnion", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *Tree) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Tree{`,
`Or:` + strings.Replace(fmt.Sprintf("%v", this.Or), "OrBranch", "OrBranch", 1) + `,`,
`And:` + strings.Replace(fmt.Sprintf("%v", this.And), "AndBranch", "AndBranch", 1) + `,`,
`Leaf:` + strings.Replace(fmt.Sprintf("%v", this.Leaf), "Leaf", "Leaf", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *OrBranch) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&OrBranch{`,
`Left:` + strings.Replace(strings.Replace(this.Left.String(), "Tree", "Tree", 1), `&`, ``, 1) + `,`,
`Right:` + strings.Replace(strings.Replace(this.Right.String(), "Tree", "Tree", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *AndBranch) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&AndBranch{`,
`Left:` + strings.Replace(strings.Replace(this.Left.String(), "Tree", "Tree", 1), `&`, ``, 1) + `,`,
`Right:` + strings.Replace(strings.Replace(this.Right.String(), "Tree", "Tree", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *Leaf) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Leaf{`,
`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
`StrValue:` + fmt.Sprintf("%v", this.StrValue) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *DeepTree) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&DeepTree{`,
`Down:` + strings.Replace(fmt.Sprintf("%v", this.Down), "ADeepBranch", "ADeepBranch", 1) + `,`,
`And:` + strings.Replace(fmt.Sprintf("%v", this.And), "AndDeepBranch", "AndDeepBranch", 1) + `,`,
`Leaf:` + strings.Replace(fmt.Sprintf("%v", this.Leaf), "DeepLeaf", "DeepLeaf", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *ADeepBranch) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&ADeepBranch{`,
`Down:` + strings.Replace(strings.Replace(this.Down.String(), "DeepTree", "DeepTree", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *AndDeepBranch) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&AndDeepBranch{`,
`Left:` + strings.Replace(strings.Replace(this.Left.String(), "DeepTree", "DeepTree", 1), `&`, ``, 1) + `,`,
`Right:` + strings.Replace(strings.Replace(this.Right.String(), "DeepTree", "DeepTree", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *DeepLeaf) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&DeepLeaf{`,
`Tree:` + strings.Replace(strings.Replace(this.Tree.String(), "Tree", "Tree", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *Nil) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Nil{`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidOptEnum) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidOptEnum{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptEnum) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptEnum{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + valueToStringThetest(this.Field3) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidRepEnum) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidRepEnum{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + fmt.Sprintf("%v", this.Field3) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinRepEnum) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinRepEnum{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`Field2:` + fmt.Sprintf("%v", this.Field2) + `,`,
`Field3:` + fmt.Sprintf("%v", this.Field3) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptEnumDefault) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptEnumDefault{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + valueToStringThetest(this.Field3) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *AnotherNinOptEnum) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&AnotherNinOptEnum{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + valueToStringThetest(this.Field3) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *AnotherNinOptEnumDefault) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&AnotherNinOptEnumDefault{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + valueToStringThetest(this.Field3) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *Timer) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Timer{`,
`Time1:` + fmt.Sprintf("%v", this.Time1) + `,`,
`Time2:` + fmt.Sprintf("%v", this.Time2) + `,`,
`Data:` + fmt.Sprintf("%v", this.Data) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *MyExtendable) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&MyExtendable{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`XXX_InternalExtensions:` + github_com_gogo_protobuf_proto.StringFromInternalExtension(this) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *OtherExtenable) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&OtherExtenable{`,
`M:` + strings.Replace(fmt.Sprintf("%v", this.M), "MyExtendable", "MyExtendable", 1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field13:` + valueToStringThetest(this.Field13) + `,`,
`XXX_InternalExtensions:` + github_com_gogo_protobuf_proto.StringFromInternalExtension(this) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NestedDefinition) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NestedDefinition{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`EnumField:` + valueToStringThetest(this.EnumField) + `,`,
`NNM:` + strings.Replace(fmt.Sprintf("%v", this.NNM), "NestedDefinition_NestedMessage_NestedNestedMsg", "NestedDefinition_NestedMessage_NestedNestedMsg", 1) + `,`,
`NM:` + strings.Replace(fmt.Sprintf("%v", this.NM), "NestedDefinition_NestedMessage", "NestedDefinition_NestedMessage", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NestedDefinition_NestedMessage) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NestedDefinition_NestedMessage{`,
`NestedField1:` + valueToStringThetest(this.NestedField1) + `,`,
`NNM:` + strings.Replace(fmt.Sprintf("%v", this.NNM), "NestedDefinition_NestedMessage_NestedNestedMsg", "NestedDefinition_NestedMessage_NestedNestedMsg", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NestedDefinition_NestedMessage_NestedNestedMsg) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NestedDefinition_NestedMessage_NestedNestedMsg{`,
`NestedNestedField1:` + valueToStringThetest(this.NestedNestedField1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NestedScope) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NestedScope{`,
`A:` + strings.Replace(fmt.Sprintf("%v", this.A), "NestedDefinition_NestedMessage_NestedNestedMsg", "NestedDefinition_NestedMessage_NestedNestedMsg", 1) + `,`,
`B:` + valueToStringThetest(this.B) + `,`,
`C:` + strings.Replace(fmt.Sprintf("%v", this.C), "NestedDefinition_NestedMessage", "NestedDefinition_NestedMessage", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptNativeDefault) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptNativeDefault{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`Field3:` + valueToStringThetest(this.Field3) + `,`,
`Field4:` + valueToStringThetest(this.Field4) + `,`,
`Field5:` + valueToStringThetest(this.Field5) + `,`,
`Field6:` + valueToStringThetest(this.Field6) + `,`,
`Field7:` + valueToStringThetest(this.Field7) + `,`,
`Field8:` + valueToStringThetest(this.Field8) + `,`,
`Field9:` + valueToStringThetest(this.Field9) + `,`,
`Field10:` + valueToStringThetest(this.Field10) + `,`,
`Field11:` + valueToStringThetest(this.Field11) + `,`,
`Field12:` + valueToStringThetest(this.Field12) + `,`,
`Field13:` + valueToStringThetest(this.Field13) + `,`,
`Field14:` + valueToStringThetest(this.Field14) + `,`,
`Field15:` + valueToStringThetest(this.Field15) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomContainer) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomContainer{`,
`CustomStruct:` + strings.Replace(strings.Replace(this.CustomStruct.String(), "NidOptCustom", "NidOptCustom", 1), `&`, ``, 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomNameNidOptNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomNameNidOptNative{`,
`FieldA:` + fmt.Sprintf("%v", this.FieldA) + `,`,
`FieldB:` + fmt.Sprintf("%v", this.FieldB) + `,`,
`FieldC:` + fmt.Sprintf("%v", this.FieldC) + `,`,
`FieldD:` + fmt.Sprintf("%v", this.FieldD) + `,`,
`FieldE:` + fmt.Sprintf("%v", this.FieldE) + `,`,
`FieldF:` + fmt.Sprintf("%v", this.FieldF) + `,`,
`FieldG:` + fmt.Sprintf("%v", this.FieldG) + `,`,
`FieldH:` + fmt.Sprintf("%v", this.FieldH) + `,`,
`FieldI:` + fmt.Sprintf("%v", this.FieldI) + `,`,
`FieldJ:` + fmt.Sprintf("%v", this.FieldJ) + `,`,
`FieldK:` + fmt.Sprintf("%v", this.FieldK) + `,`,
`FieldL:` + fmt.Sprintf("%v", this.FieldL) + `,`,
`FieldM:` + fmt.Sprintf("%v", this.FieldM) + `,`,
`FieldN:` + fmt.Sprintf("%v", this.FieldN) + `,`,
`FieldO:` + fmt.Sprintf("%v", this.FieldO) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomNameNinOptNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomNameNinOptNative{`,
`FieldA:` + valueToStringThetest(this.FieldA) + `,`,
`FieldB:` + valueToStringThetest(this.FieldB) + `,`,
`FieldC:` + valueToStringThetest(this.FieldC) + `,`,
`FieldD:` + valueToStringThetest(this.FieldD) + `,`,
`FieldE:` + valueToStringThetest(this.FieldE) + `,`,
`FieldF:` + valueToStringThetest(this.FieldF) + `,`,
`FieldG:` + valueToStringThetest(this.FieldG) + `,`,
`FieldH:` + valueToStringThetest(this.FieldH) + `,`,
`FieldI:` + valueToStringThetest(this.FieldI) + `,`,
`FieldJ:` + valueToStringThetest(this.FieldJ) + `,`,
`FieldK:` + valueToStringThetest(this.FieldK) + `,`,
`FielL:` + valueToStringThetest(this.FielL) + `,`,
`FieldM:` + valueToStringThetest(this.FieldM) + `,`,
`FieldN:` + valueToStringThetest(this.FieldN) + `,`,
`FieldO:` + valueToStringThetest(this.FieldO) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomNameNinRepNative) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomNameNinRepNative{`,
`FieldA:` + fmt.Sprintf("%v", this.FieldA) + `,`,
`FieldB:` + fmt.Sprintf("%v", this.FieldB) + `,`,
`FieldC:` + fmt.Sprintf("%v", this.FieldC) + `,`,
`FieldD:` + fmt.Sprintf("%v", this.FieldD) + `,`,
`FieldE:` + fmt.Sprintf("%v", this.FieldE) + `,`,
`FieldF:` + fmt.Sprintf("%v", this.FieldF) + `,`,
`FieldG:` + fmt.Sprintf("%v", this.FieldG) + `,`,
`FieldH:` + fmt.Sprintf("%v", this.FieldH) + `,`,
`FieldI:` + fmt.Sprintf("%v", this.FieldI) + `,`,
`FieldJ:` + fmt.Sprintf("%v", this.FieldJ) + `,`,
`FieldK:` + fmt.Sprintf("%v", this.FieldK) + `,`,
`FieldL:` + fmt.Sprintf("%v", this.FieldL) + `,`,
`FieldM:` + fmt.Sprintf("%v", this.FieldM) + `,`,
`FieldN:` + fmt.Sprintf("%v", this.FieldN) + `,`,
`FieldO:` + fmt.Sprintf("%v", this.FieldO) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomNameNinStruct) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomNameNinStruct{`,
`FieldA:` + valueToStringThetest(this.FieldA) + `,`,
`FieldB:` + valueToStringThetest(this.FieldB) + `,`,
`FieldC:` + strings.Replace(fmt.Sprintf("%v", this.FieldC), "NidOptNative", "NidOptNative", 1) + `,`,
`FieldD:` + strings.Replace(fmt.Sprintf("%v", this.FieldD), "NinOptNative", "NinOptNative", 1) + `,`,
`FieldE:` + valueToStringThetest(this.FieldE) + `,`,
`FieldF:` + valueToStringThetest(this.FieldF) + `,`,
`FieldG:` + strings.Replace(fmt.Sprintf("%v", this.FieldG), "NidOptNative", "NidOptNative", 1) + `,`,
`FieldH:` + valueToStringThetest(this.FieldH) + `,`,
`FieldI:` + valueToStringThetest(this.FieldI) + `,`,
`FieldJ:` + valueToStringThetest(this.FieldJ) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomNameCustomType) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomNameCustomType{`,
`FieldA:` + valueToStringThetest(this.FieldA) + `,`,
`FieldB:` + valueToStringThetest(this.FieldB) + `,`,
`FieldC:` + fmt.Sprintf("%v", this.FieldC) + `,`,
`FieldD:` + fmt.Sprintf("%v", this.FieldD) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomNameNinEmbeddedStructUnion) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomNameNinEmbeddedStructUnion{`,
`NidOptNative:` + strings.Replace(fmt.Sprintf("%v", this.NidOptNative), "NidOptNative", "NidOptNative", 1) + `,`,
`FieldA:` + strings.Replace(fmt.Sprintf("%v", this.FieldA), "NinOptNative", "NinOptNative", 1) + `,`,
`FieldB:` + valueToStringThetest(this.FieldB) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *CustomNameEnum) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&CustomNameEnum{`,
`FieldA:` + valueToStringThetest(this.FieldA) + `,`,
`FieldB:` + fmt.Sprintf("%v", this.FieldB) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NoExtensionsMap) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NoExtensionsMap{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`XXX_extensions:` + github_com_gogo_protobuf_proto.StringFromExtensionsBytes(this.XXX_extensions) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *Unrecognized) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Unrecognized{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`}`,
}, "")
return s
}
func (this *UnrecognizedWithInner) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&UnrecognizedWithInner{`,
`Embedded:` + strings.Replace(fmt.Sprintf("%v", this.Embedded), "UnrecognizedWithInner_Inner", "UnrecognizedWithInner_Inner", 1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *UnrecognizedWithInner_Inner) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&UnrecognizedWithInner_Inner{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`}`,
}, "")
return s
}
func (this *UnrecognizedWithEmbed) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&UnrecognizedWithEmbed{`,
`UnrecognizedWithEmbed_Embedded:` + strings.Replace(strings.Replace(this.UnrecognizedWithEmbed_Embedded.String(), "UnrecognizedWithEmbed_Embedded", "UnrecognizedWithEmbed_Embedded", 1), `&`, ``, 1) + `,`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *UnrecognizedWithEmbed_Embedded) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&UnrecognizedWithEmbed_Embedded{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`}`,
}, "")
return s
}
func (this *Node) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Node{`,
`Label:` + valueToStringThetest(this.Label) + `,`,
`Children:` + strings.Replace(fmt.Sprintf("%v", this.Children), "Node", "Node", 1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NonByteCustomType) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NonByteCustomType{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidOptNonByteCustomType) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidOptNonByteCustomType{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinOptNonByteCustomType) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinOptNonByteCustomType{`,
`Field1:` + valueToStringThetest(this.Field1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NidRepNonByteCustomType) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NidRepNonByteCustomType{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *NinRepNonByteCustomType) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&NinRepNonByteCustomType{`,
`Field1:` + fmt.Sprintf("%v", this.Field1) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *ProtoType) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&ProtoType{`,
`Field2:` + valueToStringThetest(this.Field2) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func valueToStringThetest(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (this *NinOptNativeUnion) GetValue() interface{} {
if this.Field1 != nil {
return this.Field1
}
if this.Field2 != nil {
return this.Field2
}
if this.Field3 != nil {
return this.Field3
}
if this.Field4 != nil {
return this.Field4
}
if this.Field5 != nil {
return this.Field5
}
if this.Field6 != nil {
return this.Field6
}
if this.Field13 != nil {
return this.Field13
}
if this.Field14 != nil {
return this.Field14
}
if this.Field15 != nil {
return this.Field15
}
return nil
}
func (this *NinOptNativeUnion) SetValue(value interface{}) bool {
switch vt := value.(type) {
case *float64:
this.Field1 = vt
case *float32:
this.Field2 = vt
case *int32:
this.Field3 = vt
case *int64:
this.Field4 = vt
case *uint32:
this.Field5 = vt
case *uint64:
this.Field6 = vt
case *bool:
this.Field13 = vt
case *string:
this.Field14 = vt
case []byte:
this.Field15 = vt
default:
return false
}
return true
}
func (this *NinOptStructUnion) GetValue() interface{} {
if this.Field1 != nil {
return this.Field1
}
if this.Field2 != nil {
return this.Field2
}
if this.Field3 != nil {
return this.Field3
}
if this.Field4 != nil {
return this.Field4
}
if this.Field6 != nil {
return this.Field6
}
if this.Field7 != nil {
return this.Field7
}
if this.Field13 != nil {
return this.Field13
}
if this.Field14 != nil {
return this.Field14
}
if this.Field15 != nil {
return this.Field15
}
return nil
}
func (this *NinOptStructUnion) SetValue(value interface{}) bool {
switch vt := value.(type) {
case *float64:
this.Field1 = vt
case *float32:
this.Field2 = vt
case *NidOptNative:
this.Field3 = vt
case *NinOptNative:
this.Field4 = vt
case *uint64:
this.Field6 = vt
case *int32:
this.Field7 = vt
case *bool:
this.Field13 = vt
case *string:
this.Field14 = vt
case []byte:
this.Field15 = vt
default:
return false
}
return true
}
func (this *NinEmbeddedStructUnion) GetValue() interface{} {
if this.NidOptNative != nil {
return this.NidOptNative
}
if this.Field200 != nil {
return this.Field200
}
if this.Field210 != nil {
return this.Field210
}
return nil
}
func (this *NinEmbeddedStructUnion) SetValue(value interface{}) bool {
switch vt := value.(type) {
case *NidOptNative:
this.NidOptNative = vt
case *NinOptNative:
this.Field200 = vt
case *bool:
this.Field210 = vt
default:
return false
}
return true
}
func (this *NinNestedStructUnion) GetValue() interface{} {
if this.Field1 != nil {
return this.Field1
}
if this.Field2 != nil {
return this.Field2
}
if this.Field3 != nil {
return this.Field3
}
return nil
}
func (this *NinNestedStructUnion) SetValue(value interface{}) bool {
switch vt := value.(type) {
case *NinOptNativeUnion:
this.Field1 = vt
case *NinOptStructUnion:
this.Field2 = vt
case *NinEmbeddedStructUnion:
this.Field3 = vt
default:
this.Field1 = new(NinOptNativeUnion)
if set := this.Field1.SetValue(value); set {
return true
}
this.Field1 = nil
this.Field2 = new(NinOptStructUnion)
if set := this.Field2.SetValue(value); set {
return true
}
this.Field2 = nil
this.Field3 = new(NinEmbeddedStructUnion)
if set := this.Field3.SetValue(value); set {
return true
}
this.Field3 = nil
return false
}
return true
}
func (this *Tree) GetValue() interface{} {
if this.Or != nil {
return this.Or
}
if this.And != nil {
return this.And
}
if this.Leaf != nil {
return this.Leaf
}
return nil
}
func (this *Tree) SetValue(value interface{}) bool {
switch vt := value.(type) {
case *OrBranch:
this.Or = vt
case *AndBranch:
this.And = vt
case *Leaf:
this.Leaf = vt
default:
return false
}
return true
}
func (this *DeepTree) GetValue() interface{} {
if this.Down != nil {
return this.Down
}
if this.And != nil {
return this.And
}
if this.Leaf != nil {
return this.Leaf
}
return nil
}
func (this *DeepTree) SetValue(value interface{}) bool {
switch vt := value.(type) {
case *ADeepBranch:
this.Down = vt
case *AndDeepBranch:
this.And = vt
case *DeepLeaf:
this.Leaf = vt
default:
return false
}
return true
}
func (this *CustomNameNinEmbeddedStructUnion) GetValue() interface{} {
if this.NidOptNative != nil {
return this.NidOptNative
}
if this.FieldA != nil {
return this.FieldA
}
if this.FieldB != nil {
return this.FieldB
}
return nil
}
func (this *CustomNameNinEmbeddedStructUnion) SetValue(value interface{}) bool {
switch vt := value.(type) {
case *NidOptNative:
this.NidOptNative = vt
case *NinOptNative:
this.FieldA = vt
case *bool:
this.FieldB = vt
default:
return false
}
return true
}
func init() { proto.RegisterFile("combos/marshaler/thetest.proto", fileDescriptorThetest) }
var fileDescriptorThetest = []byte{
// 3083 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4f, 0x6c, 0x1b, 0xc7,
0xd5, 0xe7, 0xec, 0x50, 0x0e, 0xf5, 0x24, 0x4b, 0xf4, 0x26, 0x56, 0x16, 0x8c, 0xbe, 0x15, 0xbd,
0x91, 0xf5, 0x31, 0x44, 0x2c, 0x51, 0x14, 0x25, 0xcb, 0x4c, 0x93, 0x42, 0xfc, 0xe3, 0x46, 0x6e,
0x44, 0x19, 0x8c, 0xdc, 0xd6, 0x40, 0x81, 0x82, 0x16, 0xd7, 0x12, 0x51, 0x69, 0x29, 0x90, 0xab,
0x34, 0xee, 0xa1, 0x08, 0x72, 0x28, 0x82, 0x5e, 0x8b, 0x1e, 0xdb, 0xb8, 0x28, 0x0a, 0xa4, 0xb7,
0x1c, 0x8a, 0xa2, 0x28, 0x8a, 0xc6, 0x97, 0x02, 0xea, 0xcd, 0xe8, 0xa9, 0x08, 0x0a, 0x21, 0x62,
0x2e, 0x39, 0xa6, 0xa7, 0xe6, 0x90, 0x43, 0xb1, 0xbb, 0xb3, 0xb3, 0x33, 0xb3, 0xbb, 0xdc, 0xa5,
0xe5, 0xb4, 0xb9, 0xd8, 0xe2, 0xbc, 0xf7, 0x66, 0xde, 0xbe, 0xdf, 0xef, 0xbd, 0x7d, 0x3b, 0x33,
0xa0, 0xee, 0x76, 0x0f, 0xef, 0x75, 0xfb, 0x4b, 0x87, 0xad, 0x5e, 0x7f, 0xbf, 0x75, 0xa0, 0xf7,
0x96, 0xcc, 0x7d, 0xdd, 0xd4, 0xfb, 0xe6, 0xe2, 0x51, 0xaf, 0x6b, 0x76, 0xe5, 0xa4, 0xf5, 0x77,
0xe6, 0xda, 0x5e, 0xc7, 0xdc, 0x3f, 0xbe, 0xb7, 0xb8, 0xdb, 0x3d, 0x5c, 0xda, 0xeb, 0xee, 0x75,
0x97, 0x6c, 0xe1, 0xbd, 0xe3, 0xfb, 0xf6, 0x2f, 0xfb, 0x87, 0xfd, 0x97, 0x63, 0xa4, 0xfd, 0x13,
0xc3, 0x64, 0xa3, 0xd3, 0xde, 0x3e, 0x32, 0x1b, 0x2d, 0xb3, 0xf3, 0x96, 0x2e, 0xcf, 0xc2, 0x85,
0x9b, 0x1d, 0xfd, 0xa0, 0xbd, 0xac, 0xa0, 0x2c, 0xca, 0xa1, 0x4a, 0xf2, 0xe4, 0x74, 0x2e, 0xd1,
0x24, 0x63, 0x54, 0x5a, 0x54, 0xa4, 0x2c, 0xca, 0x49, 0x9c, 0xb4, 0x48, 0xa5, 0x2b, 0x0a, 0xce,
0xa2, 0xdc, 0x18, 0x27, 0x5d, 0xa1, 0xd2, 0x92, 0x92, 0xcc, 0xa2, 0x1c, 0xe6, 0xa4, 0x25, 0x2a,
0x5d, 0x55, 0xc6, 0xb2, 0x28, 0x77, 0x91, 0x93, 0xae, 0x52, 0xe9, 0x9a, 0x72, 0x21, 0x8b, 0x72,
0x49, 0x4e, 0xba, 0x46, 0xa5, 0xd7, 0x95, 0x67, 0xb2, 0x28, 0x77, 0x89, 0x93, 0x5e, 0xa7, 0xd2,
0x75, 0x25, 0x95, 0x45, 0x39, 0x99, 0x93, 0xae, 0x53, 0xe9, 0x0d, 0x65, 0x3c, 0x8b, 0x72, 0xcf,
0x70, 0xd2, 0x1b, 0xb2, 0x0a, 0xcf, 0x38, 0x4f, 0x5e, 0x50, 0x20, 0x8b, 0x72, 0xd3, 0x44, 0xec,
0x0e, 0x7a, 0xf2, 0x65, 0x65, 0x22, 0x8b, 0x72, 0x17, 0x78, 0xf9, 0xb2, 0x27, 0x2f, 0x2a, 0x93,
0x59, 0x94, 0x4b, 0xf3, 0xf2, 0xa2, 0x27, 0x5f, 0x51, 0x2e, 0x66, 0x51, 0x2e, 0xc5, 0xcb, 0x57,
0x3c, 0x79, 0x49, 0x99, 0xca, 0xa2, 0xdc, 0x38, 0x2f, 0x2f, 0x79, 0xf2, 0x55, 0x65, 0x3a, 0x8b,
0x72, 0x93, 0xbc, 0x7c, 0x55, 0x7b, 0xd7, 0x86, 0xd7, 0xf0, 0xe0, 0x9d, 0xe1, 0xe1, 0xa5, 0xc0,
0xce, 0xf0, 0xc0, 0x52, 0x48, 0x67, 0x78, 0x48, 0x29, 0x98, 0x33, 0x3c, 0x98, 0x14, 0xc6, 0x19,
0x1e, 0x46, 0x0a, 0xe0, 0x0c, 0x0f, 0x20, 0x85, 0x6e, 0x86, 0x87, 0x8e, 0x82, 0x36, 0xc3, 0x83,
0x46, 0xe1, 0x9a, 0xe1, 0xe1, 0xa2, 0x40, 0x29, 0x02, 0x50, 0x1e, 0x44, 0x8a, 0x00, 0x91, 0x07,
0x8e, 0x22, 0x80, 0xe3, 0xc1, 0xa2, 0x08, 0xb0, 0x78, 0x80, 0x28, 0x02, 0x20, 0x1e, 0x14, 0x8a,
0x00, 0x85, 0x07, 0x02, 0xc9, 0xb1, 0xa6, 0x7e, 0x14, 0x90, 0x63, 0x78, 0x68, 0x8e, 0xe1, 0xa1,
0x39, 0x86, 0x87, 0xe6, 0x18, 0x1e, 0x9a, 0x63, 0x78, 0x68, 0x8e, 0xe1, 0xa1, 0x39, 0x86, 0x87,
0xe6, 0x18, 0x1e, 0x9a, 0x63, 0x78, 0x78, 0x8e, 0xe1, 0x88, 0x1c, 0xc3, 0x11, 0x39, 0x86, 0x23,
0x72, 0x0c, 0x47, 0xe4, 0x18, 0x8e, 0xc8, 0x31, 0x1c, 0x9a, 0x63, 0x1e, 0xbc, 0x33, 0x3c, 0xbc,
0x81, 0x39, 0x86, 0x43, 0x72, 0x0c, 0x87, 0xe4, 0x18, 0x0e, 0xc9, 0x31, 0x1c, 0x92, 0x63, 0x38,
0x24, 0xc7, 0x70, 0x48, 0x8e, 0xe1, 0x90, 0x1c, 0xc3, 0x61, 0x39, 0x86, 0x43, 0x73, 0x0c, 0x87,
0xe6, 0x18, 0x0e, 0xcd, 0x31, 0x1c, 0x9a, 0x63, 0x38, 0x34, 0xc7, 0x30, 0x9b, 0x63, 0x7f, 0xc6,
0x20, 0x3b, 0x39, 0x76, 0xbb, 0xb5, 0xfb, 0x43, 0xbd, 0x4d, 0xa0, 0x50, 0x85, 0x4c, 0xbb, 0x60,
0x41, 0x97, 0xf6, 0x20, 0x51, 0x85, 0x5c, 0xe3, 0xe5, 0x45, 0x2a, 0x77, 0xb3, 0x8d, 0x97, 0xaf,
0x50, 0xb9, 0x9b, 0x6f, 0xbc, 0xbc, 0x44, 0xe5, 0x6e, 0xc6, 0xf1, 0xf2, 0x55, 0x2a, 0x77, 0x73,
0x8e, 0x97, 0xaf, 0x51, 0xb9, 0x9b, 0x75, 0xbc, 0xfc, 0x3a, 0x95, 0xbb, 0x79, 0xc7, 0xcb, 0xd7,
0xa9, 0xdc, 0xcd, 0x3c, 0x5e, 0x7e, 0x43, 0xce, 0x8a, 0xb9, 0xe7, 0x2a, 0x50, 0x68, 0xb3, 0x62,
0xf6, 0x09, 0x1a, 0xcb, 0x9e, 0x86, 0x9b, 0x7f, 0x82, 0x46, 0xd1, 0xd3, 0x70, 0x33, 0x50, 0xd0,
0x58, 0xd1, 0xde, 0xb3, 0xe1, 0x33, 0x44, 0xf8, 0x32, 0x02, 0x7c, 0x12, 0x03, 0x5d, 0x46, 0x80,
0x4e, 0x62, 0x60, 0xcb, 0x08, 0xb0, 0x49, 0x0c, 0x64, 0x19, 0x01, 0x32, 0x89, 0x81, 0x2b, 0x23,
0xc0, 0x25, 0x31, 0x50, 0x65, 0x04, 0xa8, 0x24, 0x06, 0xa6, 0x8c, 0x00, 0x93, 0xc4, 0x40, 0x94,
0x11, 0x20, 0x92, 0x18, 0x78, 0x32, 0x02, 0x3c, 0x12, 0x03, 0xcd, 0xac, 0x08, 0x8d, 0xc4, 0xc2,
0x32, 0x2b, 0xc2, 0x22, 0xb1, 0x90, 0xcc, 0x8a, 0x90, 0x48, 0x2c, 0x1c, 0xb3, 0x22, 0x1c, 0x12,
0x0b, 0xc5, 0x97, 0x92, 0xdb, 0x11, 0xbe, 0x69, 0xf6, 0x8e, 0x77, 0xcd, 0x73, 0x75, 0x84, 0x05,
0xae, 0x7d, 0x98, 0x28, 0xca, 0x8b, 0x76, 0xc3, 0xca, 0x76, 0x9c, 0xc2, 0x1b, 0xac, 0xc0, 0x35,
0x16, 0x8c, 0x85, 0x11, 0x6c, 0x51, 0x3a, 0x57, 0x6f, 0x58, 0xe0, 0xda, 0x8c, 0x68, 0xff, 0xd6,
0xbf, 0xf2, 0x8e, 0xed, 0x91, 0xe4, 0x76, 0x6c, 0x24, 0xfc, 0xa3, 0x76, 0x6c, 0xf9, 0xe8, 0x90,
0xd3, 0x60, 0xe7, 0xa3, 0x83, 0xed, 0x7b, 0xeb, 0xc4, 0xed, 0xe0, 0xf2, 0xd1, 0xa1, 0xa5, 0x41,
0x7d, 0xba, 0xfd, 0x16, 0x61, 0x70, 0x53, 0x3f, 0x0a, 0x60, 0xf0, 0xa8, 0xfd, 0x56, 0x81, 0x2b,
0x25, 0xa3, 0x32, 0x18, 0x8f, 0xcc, 0xe0, 0x51, 0x3b, 0xaf, 0x02, 0x57, 0x5e, 0x46, 0x66, 0xf0,
0x57, 0xd0, 0x0f, 0x11, 0x06, 0x7b, 0xe1, 0x1f, 0xb5, 0x1f, 0xca, 0x47, 0x87, 0x3c, 0x90, 0xc1,
0x78, 0x04, 0x06, 0xc7, 0xe9, 0x8f, 0xf2, 0xd1, 0xa1, 0x0d, 0x66, 0xf0, 0xb9, 0xbb, 0x99, 0xf7,
0x11, 0x5c, 0x6a, 0x74, 0xda, 0xf5, 0xc3, 0x7b, 0x7a, 0xbb, 0xad, 0xb7, 0x49, 0x1c, 0x0b, 0x5c,
0x25, 0x08, 0x81, 0xfa, 0xf1, 0xe9, 0x9c, 0x17, 0xe1, 0x55, 0x48, 0x39, 0x31, 0x2d, 0x14, 0x94,
0x13, 0x14, 0x51, 0xe1, 0xa8, 0xaa, 0x7c, 0xc5, 0x35, 0x5b, 0x2e, 0x28, 0x7f, 0x47, 0x4c, 0x95,
0xa3, 0xc3, 0xda, 0xcf, 0x6d, 0x0f, 0x8d, 0x73, 0x7b, 0xb8, 0x14, 0xcb, 0x43, 0xc6, 0xb7, 0x17,
0x7c, 0xbe, 0x31, 0x5e, 0x1d, 0xc3, 0x74, 0xa3, 0xd3, 0x6e, 0xe8, 0x7d, 0x33, 0x9e, 0x4b, 0x8e,
0x8e, 0x50, 0x0f, 0x0a, 0x1c, 0x2d, 0x59, 0x0b, 0x4a, 0x69, 0xbe, 0x46, 0x68, 0x1d, 0x6b, 0x59,
0x83, 0x5b, 0x36, 0x1f, 0xb6, 0xac, 0x57, 0xd9, 0xe9, 0x82, 0xf9, 0xb0, 0x05, 0xbd, 0x1c, 0xa2,
0x4b, 0xbd, 0xed, 0xbe, 0x9c, 0xab, 0xc7, 0x7d, 0xb3, 0x7b, 0x28, 0xcf, 0x82, 0xb4, 0xd9, 0xb6,
0xd7, 0x98, 0xac, 0x4c, 0x5a, 0x4e, 0x7d, 0x7c, 0x3a, 0x97, 0xbc, 0x73, 0xdc, 0x69, 0x37, 0xa5,
0xcd, 0xb6, 0x7c, 0x0b, 0xc6, 0xbe, 0xd3, 0x3a, 0x38, 0xd6, 0xed, 0x57, 0xc4, 0x64, 0xa5, 0x44,
0x14, 0x5e, 0x0e, 0xdd, 0x23, 0xb2, 0x16, 0x5e, 0xda, 0xb5, 0xa7, 0x5e, 0xbc, 0xd3, 0x31, 0xcc,
0xe5, 0xe2, 0x7a, 0xd3, 0x99, 0x42, 0xfb, 0x3e, 0x80, 0xb3, 0x66, 0xad, 0xd5, 0xdf, 0x97, 0x1b,
0xee, 0xcc, 0xce, 0xd2, 0xeb, 0x1f, 0x9f, 0xce, 0x95, 0xe2, 0xcc, 0x7a, 0xad, 0xdd, 0xea, 0xef,
0x5f, 0x33, 0x1f, 0x1c, 0xe9, 0x8b, 0x95, 0x07, 0xa6, 0xde, 0x77, 0x67, 0x3f, 0x72, 0xdf, 0x7a,
0xe4, 0xb9, 0x14, 0xe6, 0xb9, 0x52, 0xdc, 0x33, 0xdd, 0xe4, 0x9f, 0xa9, 0xf0, 0xa4, 0xcf, 0xf3,
0xb6, 0xfb, 0x92, 0x10, 0x22, 0x89, 0xa3, 0x22, 0x89, 0xcf, 0x1b, 0xc9, 0x23, 0xb7, 0x3e, 0x0a,
0xcf, 0x8a, 0x87, 0x3d, 0x2b, 0x3e, 0xcf, 0xb3, 0xfe, 0xdb, 0xc9, 0x56, 0x9a, 0x4f, 0x77, 0x8c,
0x4e, 0xd7, 0xf8, 0xda, 0xed, 0x05, 0x3d, 0xd5, 0x2e, 0xa0, 0x9c, 0x3c, 0x79, 0x38, 0x87, 0xb4,
0xf7, 0x25, 0xf7, 0xc9, 0x9d, 0x44, 0x7a, 0xb2, 0x27, 0xff, 0xba, 0xf4, 0x54, 0x5f, 0x45, 0x84,
0x7e, 0x85, 0x60, 0xc6, 0x57, 0xc9, 0x9d, 0x30, 0x3d, 0xdd, 0x72, 0x6e, 0x8c, 0x5a, 0xce, 0x89,
0x83, 0xbf, 0x47, 0xf0, 0x9c, 0x50, 0x5e, 0x1d, 0xf7, 0x96, 0x04, 0xf7, 0x9e, 0xf7, 0xaf, 0x64,
0x2b, 0x32, 0xde, 0xb1, 0xf0, 0x0a, 0x06, 0xcc, 0xcc, 0x14, 0xf7, 0x92, 0x80, 0xfb, 0x2c, 0x35,
0x08, 0x08, 0x97, 0xcb, 0x00, 0xe2, 0x76, 0x17, 0x92, 0x3b, 0x3d, 0x5d, 0x97, 0x55, 0x90, 0xb6,
0x7b, 0xc4, 0xc3, 0x29, 0xc7, 0x7e, 0xbb, 0x57, 0xe9, 0xb5, 0x8c, 0xdd, 0xfd, 0xa6, 0xb4, 0xdd,
0x93, 0xaf, 0x00, 0xde, 0x30, 0xda, 0xc4, 0xa3, 0x69, 0x47, 0x61, 0xc3, 0x68, 0x13, 0x0d, 0x4b,
0x26, 0xab, 0x90, 0x7c, 0x43, 0x6f, 0xdd, 0x27, 0x4e, 0x80, 0xa3, 0x63, 0x8d, 0x34, 0xed, 0x71,
0xb2, 0xe0, 0xf7, 0x20, 0xe5, 0x4e, 0x2c, 0xcf, 0x5b, 0x16, 0xf7, 0x4d, 0xb2, 0x2c, 0xb1, 0xb0,
0xdc, 0x21, 0x6f, 0x2e, 0x5b, 0x2a, 0x2f, 0xc0, 0x58, 0xb3, 0xb3, 0xb7, 0x6f, 0x92, 0xc5, 0xfd,
0x6a, 0x8e, 0x58, 0xbb, 0x0b, 0xe3, 0xd4, 0xa3, 0xa7, 0x3c, 0x75, 0xcd, 0x79, 0x34, 0x39, 0xc3,
0xbe, 0x4f, 0xdc, 0x7d, 0x4b, 0x67, 0x48, 0xce, 0x42, 0xea, 0x4d, 0xb3, 0xe7, 0x15, 0x7d, 0xb7,
0x23, 0xa5, 0xa3, 0xda, 0xbb, 0x08, 0x52, 0x35, 0x5d, 0x3f, 0xb2, 0x03, 0x7e, 0x15, 0x92, 0xb5,
0xee, 0x8f, 0x0c, 0xe2, 0xe0, 0x25, 0x12, 0x51, 0x4b, 0x4c, 0x62, 0x6a, 0x8b, 0xe5, 0xab, 0x6c,
0xdc, 0x9f, 0xa5, 0x71, 0x67, 0xf4, 0xec, 0xd8, 0x6b, 0x5c, 0xec, 0x09, 0x80, 0x96, 0x92, 0x2f,
0xfe, 0xd7, 0x61, 0x82, 0x59, 0x45, 0xce, 0x11, 0x37, 0x24, 0xd1, 0x90, 0x8d, 0x95, 0xa5, 0xa1,
0xe9, 0x70, 0x91, 0x5b, 0xd8, 0x32, 0x65, 0x42, 0x1c, 0x62, 0x6a, 0x87, 0x39, 0xcf, 0x87, 0x39,
0x58, 0x95, 0x84, 0xba, 0xe0, 0xc4, 0xc8, 0x0e, 0xf7, 0xbc, 0x43, 0xce, 0x70, 0x10, 0xad, 0xbf,
0xb5, 0x31, 0xc0, 0x8d, 0xce, 0x81, 0xf6, 0x2a, 0x80, 0x93, 0xf2, 0x75, 0xe3, 0xf8, 0x50, 0xc8,
0xba, 0x29, 0x37, 0xc0, 0x3b, 0xfb, 0xfa, 0x8e, 0xde, 0xb7, 0x55, 0xf8, 0x7e, 0xca, 0x2a, 0x30,
0xe0, 0xa4, 0x98, 0x6d, 0xff, 0x52, 0xa4, 0x7d, 0x60, 0x27, 0x66, 0xa9, 0x2a, 0x8e, 0xea, 0x5d,
0xdd, 0xdc, 0x30, 0xba, 0xe6, 0xbe, 0xde, 0x13, 0x2c, 0x8a, 0xf2, 0x0a, 0x97, 0xb0, 0x53, 0xc5,
0x17, 0xa8, 0x45, 0xa8, 0xd1, 0x8a, 0xf6, 0xa1, 0xed, 0xa0, 0xd5, 0x0a, 0xf8, 0x1e, 0x10, 0xc7,
0x78, 0x40, 0x79, 0x8d, 0xeb, 0xdf, 0x86, 0xb8, 0x29, 0x7c, 0x5a, 0xde, 0xe0, 0xbe, 0x73, 0x86,
0x3b, 0xcb, 0x7f, 0x63, 0xba, 0x31, 0x75, 0x5d, 0x7e, 0x29, 0xd2, 0xe5, 0x90, 0xee, 0x76, 0xd4,
0x98, 0xe2, 0xb8, 0x31, 0xfd, 0x13, 0xed, 0x38, 0xac, 0xe1, 0x9a, 0x7e, 0xbf, 0x75, 0x7c, 0x60,
0xca, 0x2f, 0x47, 0x62, 0x5f, 0x46, 0x55, 0xea, 0x6a, 0x29, 0x2e, 0xfc, 0x65, 0xa9, 0x52, 0xa1,
0xee, 0x5e, 0x1f, 0x81, 0x02, 0x65, 0xa9, 0x5a, 0xa5, 0x65, 0x3b, 0xf5, 0xde, 0xc3, 0x39, 0xf4,
0xc1, 0xc3, 0xb9, 0x84, 0xf6, 0x3b, 0x04, 0x97, 0x88, 0x26, 0x43, 0xdc, 0x6b, 0x82, 0xf3, 0x97,
0xdd, 0x9a, 0x11, 0x14, 0x81, 0xff, 0x1a, 0x79, 0xff, 0x8a, 0x40, 0xf1, 0xf9, 0xea, 0xc6, 0xbb,
0x10, 0xcb, 0xe5, 0x32, 0xaa, 0xff, 0xef, 0x63, 0x7e, 0x17, 0xc6, 0x76, 0x3a, 0x87, 0x7a, 0xcf,
0x7a, 0x13, 0x58, 0x7f, 0x38, 0x2e, 0xbb, 0x87, 0x39, 0xce, 0x90, 0x2b, 0x73, 0x9c, 0xe3, 0x64,
0x45, 0x59, 0x81, 0x64, 0xad, 0x65, 0xb6, 0x6c, 0x0f, 0x26, 0x69, 0x7d, 0x6d, 0x99, 0x2d, 0x6d,
0x05, 0x26, 0xb7, 0x1e, 0xd4, 0xdf, 0x36, 0x75, 0xa3, 0xdd, 0xba, 0x77, 0x20, 0x9e, 0x81, 0xba,
0xfd, 0xea, 0x72, 0x7e, 0x2c, 0xd5, 0x4e, 0x9f, 0xa0, 0x72, 0xd2, 0xf6, 0xe7, 0x2d, 0x98, 0xda,
0xb6, 0xdc, 0xb6, 0xed, 0x6c, 0xb3, 0x2c, 0xa0, 0x2d, 0xbe, 0x11, 0x62, 0x67, 0x6d, 0xa2, 0x2d,
0xa1, 0x7d, 0xc4, 0x34, 0x3c, 0x42, 0xdb, 0x86, 0x69, 0xdb, 0x96, 0x4f, 0xa6, 0xa6, 0xd2, 0x97,
0xf2, 0xc9, 0x14, 0xa4, 0x2f, 0x92, 0x75, 0xff, 0x86, 0x21, 0xed, 0xb4, 0x3a, 0x35, 0xfd, 0x7e,
0xc7, 0xe8, 0x98, 0xfe, 0x7e, 0x95, 0x7a, 0x2c, 0x7f, 0x13, 0xc6, 0xad, 0x90, 0xda, 0xbf, 0x08,
0x60, 0x57, 0x48, 0x8b, 0x22, 0x4c, 0x41, 0x06, 0x6c, 0xea, 0x78, 0x36, 0xf2, 0x4d, 0xc0, 0x8d,
0xc6, 0x16, 0x79, 0xb9, 0x95, 0x86, 0x9a, 0x6e, 0xe9, 0xfd, 0x7e, 0x6b, 0x4f, 0x27, 0xbf, 0xc8,
0x58, 0x7f, 0xaf, 0x69, 0x4d, 0x20, 0x97, 0x40, 0x6a, 0x6c, 0x91, 0x86, 0x77, 0x3e, 0xce, 0x34,
0x4d, 0xa9, 0xb1, 0x95, 0xf9, 0x0b, 0x82, 0x8b, 0xdc, 0xa8, 0xac, 0xc1, 0xa4, 0x33, 0xc0, 0x3c,
0xee, 0x85, 0x26, 0x37, 0xe6, 0xfa, 0x2c, 0x9d, 0xd3, 0xe7, 0xcc, 0x06, 0x4c, 0x0b, 0xe3, 0xf2,
0x22, 0xc8, 0xec, 0x10, 0x71, 0x02, 0xec, 0x86, 0x3a, 0x40, 0xa2, 0xfd, 0x1f, 0x80, 0x17, 0x57,
0x79, 0x1a, 0x26, 0x76, 0xee, 0xde, 0xae, 0xff, 0xa0, 0x51, 0x7f, 0x73, 0xa7, 0x5e, 0x4b, 0x23,
0xed, 0x0f, 0x08, 0x26, 0x48, 0xdb, 0xba, 0xdb, 0x3d, 0xd2, 0xe5, 0x0a, 0xa0, 0x0d, 0xc2, 0xa0,
0x27, 0xf3, 0x1b, 0x6d, 0xc8, 0x4b, 0x80, 0x2a, 0xf1, 0xa1, 0x46, 0x15, 0xb9, 0x08, 0xa8, 0x4a,
0x00, 0x8e, 0x87, 0x0c, 0xaa, 0x6a, 0xff, 0xc2, 0xf0, 0x2c, 0xdb, 0x46, 0xbb, 0xf5, 0xe4, 0x0a,
0xff, 0xdd, 0x54, 0x1e, 0x5f, 0x2e, 0xae, 0x94, 0x16, 0xad, 0x7f, 0x28, 0x25, 0xaf, 0xf0, 0x9f,
0x50, 0x7e, 0x15, 0xdf, 0x35, 0x91, 0x72, 0x92, 0x91, 0xfa, 0xae, 0x89, 0x70, 0x52, 0xdf, 0x35,
0x11, 0x4e, 0xea, 0xbb, 0x26, 0xc2, 0x49, 0x7d, 0x47, 0x01, 0x9c, 0xd4, 0x77, 0x4d, 0x84, 0x93,
0xfa, 0xae, 0x89, 0x70, 0x52, 0xff, 0x35, 0x11, 0x22, 0x0e, 0xbd, 0x26, 0xc2, 0xcb, 0xfd, 0xd7,
0x44, 0x78, 0xb9, 0xff, 0x9a, 0x48, 0x39, 0x69, 0xf6, 0x8e, 0xf5, 0xf0, 0x43, 0x07, 0xde, 0x7e,
0xd8, 0x37, 0xa0, 0x57, 0x80, 0xb7, 0x61, 0xda, 0xd9, 0x8f, 0xa8, 0x76, 0x0d, 0xb3, 0xd5, 0x31,
0xf4, 0x9e, 0xfc, 0x0d, 0x98, 0x74, 0x86, 0x9c, 0xaf, 0x9c, 0xa0, 0xaf, 0x40, 0x47, 0x4e, 0xca,
0x2d, 0xa7, 0xad, 0x7d, 0x99, 0x84, 0x19, 0x67, 0xa0, 0xd1, 0x3a, 0xd4, 0xb9, 0x4b, 0x46, 0x0b,
0xc2, 0x91, 0xd2, 0x94, 0x65, 0x3e, 0x38, 0x9d, 0x73, 0x46, 0x37, 0x28, 0x99, 0x16, 0x84, 0xc3,
0x25, 0x5e, 0xcf, 0x7b, 0xff, 0x2c, 0x08, 0x17, 0x8f, 0x78, 0x3d, 0xfa, 0xba, 0xa1, 0x7a, 0xee,
0x15, 0x24, 0x5e, 0xaf, 0x46, 0x59, 0xb6, 0x20, 0x5c, 0x46, 0xe2, 0xf5, 0xea, 0x94, 0x6f, 0x0b,
0xc2, 0xd1, 0x13, 0xaf, 0x77, 0x93, 0x32, 0x6f, 0x41, 0x38, 0x84, 0xe2, 0xf5, 0xbe, 0x45, 0x39,
0xb8, 0x20, 0x5c, 0x55, 0xe2, 0xf5, 0x5e, 0xa7, 0x6c, 0x5c, 0x10, 0x2e, 0x2d, 0xf1, 0x7a, 0x9b,
0x94, 0x97, 0x39, 0xf1, 0xfa, 0x12, 0xaf, 0x78, 0xcb, 0x63, 0x68, 0x4e, 0xbc, 0xc8, 0xc4, 0x6b,
0x7e, 0xdb, 0xe3, 0x6a, 0x4e, 0xbc, 0xd2, 0xc4, 0x6b, 0xbe, 0xe1, 0xb1, 0x36, 0x27, 0x1e, 0x95,
0xf1, 0x9a, 0x5b, 0x1e, 0x7f, 0x73, 0xe2, 0xa1, 0x19, 0xaf, 0xd9, 0xf0, 0x98, 0x9c, 0x13, 0x8f,
0xcf, 0x78, 0xcd, 0x6d, 0x6f, 0x0f, 0xfd, 0x23, 0x81, 0x7e, 0xcc, 0x25, 0x28, 0x4d, 0xa0, 0x1f,
0x04, 0x50, 0x4f, 0x13, 0xa8, 0x07, 0x01, 0xb4, 0xd3, 0x04, 0xda, 0x41, 0x00, 0xe5, 0x34, 0x81,
0x72, 0x10, 0x40, 0x37, 0x4d, 0xa0, 0x1b, 0x04, 0x50, 0x4d, 0x13, 0xa8, 0x06, 0x01, 0x34, 0xd3,
0x04, 0x9a, 0x41, 0x00, 0xc5, 0x34, 0x81, 0x62, 0x10, 0x40, 0x2f, 0x4d, 0xa0, 0x17, 0x04, 0x50,
0x6b, 0x5e, 0xa4, 0x16, 0x04, 0xd1, 0x6a, 0x5e, 0xa4, 0x15, 0x04, 0x51, 0xea, 0x45, 0x91, 0x52,
0xe3, 0x83, 0xd3, 0xb9, 0x31, 0x6b, 0x88, 0x61, 0xd3, 0xbc, 0xc8, 0x26, 0x08, 0x62, 0xd2, 0xbc,
0xc8, 0x24, 0x08, 0x62, 0xd1, 0xbc, 0xc8, 0x22, 0x08, 0x62, 0xd0, 0x23, 0x91, 0x41, 0xde, 0x15,
0x1f, 0x4d, 0x38, 0x51, 0x8c, 0x62, 0x10, 0x8e, 0xc1, 0x20, 0x1c, 0x83, 0x41, 0x38, 0x06, 0x83,
0x70, 0x0c, 0x06, 0xe1, 0x18, 0x0c, 0xc2, 0x31, 0x18, 0x84, 0x63, 0x30, 0x08, 0xc7, 0x61, 0x10,
0x8e, 0xc5, 0x20, 0x1c, 0xc6, 0xa0, 0x79, 0xf1, 0xc2, 0x03, 0x04, 0x15, 0xa4, 0x79, 0xf1, 0xe4,
0x33, 0x9a, 0x42, 0x38, 0x16, 0x85, 0x70, 0x18, 0x85, 0x3e, 0xc2, 0xf0, 0x2c, 0x47, 0x21, 0x72,
0x3c, 0xf4, 0xb4, 0x2a, 0xd0, 0x5a, 0x8c, 0xfb, 0x15, 0x41, 0x9c, 0x5a, 0x8b, 0x71, 0x46, 0x3d,
0x8c, 0x67, 0xfe, 0x2a, 0x54, 0x8f, 0x51, 0x85, 0x6e, 0x52, 0x0e, 0xad, 0xc5, 0xb8, 0x77, 0xe1,
0xe7, 0xde, 0xfa, 0xb0, 0x22, 0xf0, 0x7a, 0xac, 0x22, 0xb0, 0x19, 0xab, 0x08, 0xdc, 0xf2, 0x10,
0xfc, 0xa9, 0x04, 0xcf, 0x79, 0x08, 0x3a, 0x7f, 0xed, 0x3c, 0x38, 0xb2, 0x4a, 0x80, 0x77, 0x42,
0x25, 0xbb, 0xa7, 0x36, 0x0c, 0x8c, 0xd2, 0x66, 0x5b, 0xbe, 0xcd, 0x9f, 0x55, 0x95, 0x47, 0x3d,
0xbf, 0x61, 0x10, 0x27, 0x7b, 0xa1, 0xf3, 0x80, 0x37, 0xdb, 0x7d, 0xbb, 0x5a, 0x04, 0x2d, 0x5b,
0x6d, 0x5a, 0x62, 0xb9, 0x09, 0x17, 0x6c, 0xf5, 0xbe, 0x0d, 0xef, 0x79, 0x16, 0xae, 0x35, 0xc9,
0x4c, 0xda, 0x23, 0x04, 0x59, 0x8e, 0xca, 0x4f, 0xe7, 0xc4, 0xe0, 0x95, 0x58, 0x27, 0x06, 0x5c,
0x82, 0x78, 0xa7, 0x07, 0xff, 0xef, 0x3f, 0xa8, 0x66, 0xb3, 0x44, 0x3c, 0x49, 0xf8, 0x09, 0x4c,
0x79, 0x4f, 0x60, 0x7f, 0xb2, 0xad, 0x46, 0x6f, 0x66, 0x06, 0xa5, 0xe6, 0xaa, 0xb0, 0x89, 0x36,
0xd4, 0x8c, 0x66, 0xab, 0x56, 0x86, 0xe9, 0x46, 0xd7, 0xde, 0x32, 0xe8, 0x77, 0xba, 0x46, 0x7f,
0xab, 0x75, 0x14, 0xb5, 0x17, 0x91, 0xb2, 0x5a, 0xf3, 0x93, 0x5f, 0xcf, 0x25, 0xb4, 0x97, 0x61,
0xf2, 0x8e, 0xd1, 0xd3, 0x77, 0xbb, 0x7b, 0x46, 0xe7, 0xc7, 0x7a, 0x5b, 0x30, 0x1c, 0x77, 0x0d,
0xcb, 0xc9, 0xc7, 0x96, 0xf6, 0x2f, 0x10, 0x5c, 0x66, 0xd5, 0xbf, 0xdb, 0x31, 0xf7, 0x37, 0x0d,
0xab, 0xa7, 0x7f, 0x15, 0x52, 0x3a, 0x01, 0xce, 0x7e, 0x77, 0x4d, 0xb8, 0x9f, 0x91, 0x81, 0xea,
0x8b, 0xf6, 0xbf, 0x4d, 0x6a, 0x22, 0x6c, 0x71, 0xb8, 0xcb, 0x16, 0x33, 0x57, 0x61, 0xcc, 0x99,
0x9f, 0xf7, 0xeb, 0xa2, 0xe0, 0xd7, 0x6f, 0x03, 0xfc, 0xb2, 0x79, 0x24, 0xdf, 0xe2, 0xfc, 0x62,
0xbe, 0x56, 0x03, 0xd5, 0x17, 0x5d, 0xf2, 0x55, 0x52, 0x56, 0xff, 0x67, 0x33, 0x2a, 0xda, 0xc9,
0x1c, 0xa4, 0xea, 0xa2, 0x4e, 0xb0, 0x9f, 0x35, 0x48, 0x36, 0xba, 0x6d, 0x5d, 0x7e, 0x0e, 0xc6,
0xde, 0x68, 0xdd, 0xd3, 0x0f, 0x48, 0x90, 0x9d, 0x1f, 0xf2, 0x02, 0xa4, 0xaa, 0xfb, 0x9d, 0x83,
0x76, 0x4f, 0x37, 0xc8, 0x91, 0x3d, 0xd9, 0x41, 0xb7, 0x6c, 0x9a, 0x54, 0xa6, 0x55, 0xe1, 0x52,
0xa3, 0x6b, 0x54, 0x1e, 0x98, 0x6c, 0xdd, 0x58, 0x14, 0x52, 0x84, 0x1c, 0xf9, 0xdc, 0xb6, 0xb2,
0xd1, 0x52, 0xa8, 0x8c, 0x7d, 0x7c, 0x3a, 0x87, 0x76, 0xe8, 0xf6, 0xf9, 0x16, 0x3c, 0x4f, 0xd2,
0xc7, 0x37, 0x55, 0x31, 0x6a, 0xaa, 0x71, 0x72, 0x4c, 0xcd, 0x4c, 0xb7, 0x69, 0x4d, 0x67, 0x04,
0x4e, 0xf7, 0x64, 0x9e, 0x59, 0x4d, 0xd1, 0x50, 0xcf, 0xf0, 0x48, 0x9e, 0x05, 0x4e, 0xb7, 0x18,
0x35, 0x9d, 0xe0, 0xd9, 0x8b, 0x30, 0x4e, 0x65, 0x0c, 0x1b, 0xd8, 0x4c, 0x29, 0xe6, 0x35, 0x98,
0x60, 0x12, 0x56, 0x1e, 0x03, 0xb4, 0x91, 0x4e, 0x58, 0xff, 0x55, 0xd2, 0xc8, 0xfa, 0xaf, 0x9a,
0x96, 0xf2, 0x57, 0x61, 0x5a, 0xd8, 0xbe, 0xb4, 0x24, 0xb5, 0x34, 0x58, 0xff, 0xd5, 0xd3, 0x13,
0x99, 0xe4, 0x7b, 0xbf, 0x51, 0x13, 0xf9, 0x57, 0x40, 0xf6, 0x6f, 0x74, 0xca, 0x17, 0x40, 0xda,
0xb0, 0xa6, 0x7c, 0x1e, 0xa4, 0x4a, 0x25, 0x8d, 0x32, 0xd3, 0x3f, 0xfb, 0x65, 0x76, 0xa2, 0xa2,
0x9b, 0xa6, 0xde, 0xbb, 0xab, 0x9b, 0x95, 0x0a, 0x31, 0x7e, 0x0d, 0x2e, 0x07, 0x6e, 0x94, 0x5a,
0xf6, 0xd5, 0xaa, 0x63, 0x5f, 0xab, 0xf9, 0xec, 0x6b, 0x35, 0xdb, 0x1e, 0x95, 0xdd, 0x03, 0xe7,
0x0d, 0x39, 0x60, 0x5b, 0x52, 0x69, 0x33, 0x07, 0xdc, 0x1b, 0xe5, 0xd7, 0x88, 0x6e, 0x25, 0x50,
0x57, 0x8f, 0x38, 0xb0, 0xae, 0x94, 0xab, 0xc4, 0xbe, 0x1a, 0x68, 0x7f, 0x5f, 0x38, 0x55, 0xe5,
0xdf, 0x10, 0x64, 0x92, 0x2a, 0x75, 0xb8, 0x16, 0x38, 0xc9, 0x3e, 0x73, 0xd7, 0xbd, 0x46, 0x1d,
0xae, 0x07, 0xea, 0x76, 0x22, 0xee, 0x7c, 0xd5, 0xcb, 0x4b, 0xe4, 0x25, 0xbf, 0xb1, 0x2c, 0x5f,
0x76, 0x73, 0x94, 0xab, 0xc0, 0x24, 0x40, 0xae, 0x56, 0xb9, 0x4a, 0x0c, 0x2a, 0xa1, 0x06, 0xe1,
0x51, 0x72, 0x2d, 0xcb, 0xaf, 0x93, 0x49, 0xaa, 0xa1, 0x93, 0x44, 0x84, 0xca, 0x35, 0xaf, 0xec,
0x9c, 0x9c, 0xa9, 0x89, 0xc7, 0x67, 0x6a, 0xe2, 0x1f, 0x67, 0x6a, 0xe2, 0x93, 0x33, 0x15, 0x7d,
0x76, 0xa6, 0xa2, 0xcf, 0xcf, 0x54, 0xf4, 0xc5, 0x99, 0x8a, 0xde, 0x19, 0xa8, 0xe8, 0x83, 0x81,
0x8a, 0x3e, 0x1c, 0xa8, 0xe8, 0x8f, 0x03, 0x15, 0x3d, 0x1a, 0xa8, 0xe8, 0x64, 0xa0, 0xa2, 0xc7,
0x03, 0x35, 0xf1, 0xc9, 0x40, 0x45, 0x9f, 0x0d, 0xd4, 0xc4, 0xe7, 0x03, 0x15, 0x7d, 0x31, 0x50,
0x13, 0xef, 0x7c, 0xaa, 0x26, 0x1e, 0x7e, 0xaa, 0x26, 0x3e, 0xf8, 0x54, 0x45, 0xff, 0x09, 0x00,
0x00, 0xff, 0xff, 0x2c, 0x85, 0x07, 0x97, 0x4b, 0x36, 0x00, 0x00,
} | return fmt.Errorf("that is type *NidRepNative but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *NidRepNative but is not nil && this == nil")
} |
options.go | package pogreb
import (
"math"
"time"
"github.com/monopolly/pogreb/fs"
)
// Options holds the optional DB parameters.
type Options struct {
// BackgroundSyncInterval sets the amount of time between background Sync() calls.
//
// Setting the value to 0 disables the automatic background synchronization.
// Setting the value to -1 makes the DB call Sync() after every write operation.
BackgroundSyncInterval time.Duration
// BackgroundCompactionInterval sets the amount of time between background Compact() calls.
//
// Setting the value to 0 disables the automatic background compaction.
BackgroundCompactionInterval time.Duration |
FileSystem fs.FileSystem
path string
maxSegmentSize uint32
compactionMinSegmentSize uint32
compactionMinFragmentation float32
}
func (src *Options) copyWithDefaults(path string) *Options {
opts := Options{}
if src != nil {
opts = *src
}
if opts.FileSystem == nil {
opts.FileSystem = fs.OS
}
if opts.maxSegmentSize == 0 {
opts.maxSegmentSize = math.MaxUint32
}
if opts.compactionMinSegmentSize == 0 {
opts.compactionMinSegmentSize = 32 << 20
}
if opts.compactionMinFragmentation == 0 {
opts.compactionMinFragmentation = 0.5
}
opts.path = path
return &opts
} | |
infoBox.tsx | import React, { useContext } from "react";
import { ThemeContext } from "../../../store/themeContext/themeContext";
import { Scientist, Building, Stage, Patent } from "../../icons";
import useStyles from "./infoBoxStyles";
export interface Props {
researchLead: string;
institution: string;
ipStatus: string;
clinicalStage: string;
}
function InfoBox(props: Props) {
const { theme } = useContext(ThemeContext);
| {/* LEFT */}
<div className={classes.column}>
<div className={classes.row}>
<div className={classes.iconContainer}>
<Scientist className={classes.icon} />
</div>
<div className={classes.textContainer}>
<p className={classes.subHeading}>research lead</p>
<p className={classes.heading}>{props.researchLead}</p>
</div>
</div>
<div className={classes.row}>
<div className={classes.iconContainer}>
<Stage className={classes.icon} />
</div>
<div className={classes.textContainer}>
<p className={classes.subHeading}>clinical stage</p>
<p className={classes.heading}>{props.clinicalStage}</p>
</div>
</div>
</div>
{/* RIGHT */}
<div className={classes.column}>
<div className={classes.row}>
<div className={classes.iconContainer}>
<Building className={classes.icon} />
</div>
<div className={classes.textContainer}>
<p className={classes.subHeading}>institution</p>
<p className={classes.heading}>{props.institution}</p>
</div>
</div>
<div className={classes.row}>
<div className={classes.iconContainer}>
<Patent className={classes.icon} />
</div>
<div className={classes.textContainer}>
<p className={classes.subHeading}>ip status</p>
<p className={classes.heading}>{props.ipStatus}</p>
</div>
</div>
</div>
</div>
);
}
export default React.memo(InfoBox); | const classes = useStyles({ ...props, ...theme });
return (
<div className={classes.InfoBox}> |
FareRulesTransformer.js | /**
* @author Pieter Colpaert <[email protected]>
*/
var Transform = require('stream').Transform,
util = require('util');
util.inherits(FareRulesTransformer, Transform);
function | (options) {
this._feedbaseuri = options.baseuri + options.feedname + "/" + options.version ;
this._options = options;
Transform.call(this, {objectMode : true});
}
FareRulesTransformer.prototype._flush = function () {
}
FareRulesTransformer.prototype._transform = function (data, encoding, done) {
if (!data["fare_id"]) {
console.error("Parser error: could not find a fare_id. Data follows:");
console.error(data);
} else {
var subject = this._feedbaseuri + "/fareclasses/" + data["fare_id"] + "/farerules/" + (data["route_id"]?data["route_id"]:"") + (data["origin_id"]?data["origin_id"]:"") + (data["destination_id"]?data["destination_id"]:"") + (data["contains_id"]?data["contains_id"]:"");
this.push({ subject: subject, predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", object: "http://vocab.gtfs.org/terms#FareRule"});
this.push({ subject: subject, predicate: "http://vocab.gtfs.org/terms#fareClass", object: this._feedbaseuri + "/fareclasses/" + data["fare_id"]});
if (data["route_id"]) {
this.push({ subject: subject, predicate: "http://vocab.gtfs.org/terms#route", object: this._feedbaseuri + "/routes/" + data["route_id"]});
}
if (data["origin_id"]) {
this.push({ subject: subject, predicate: "http://vocab.gtfs.org/terms#originZone", object: this._feedbaseuri + "/zones/" + data["origin_id"]});
}
if (data["destination_id"]) {
this.push({ subject: subject, predicate: "http://vocab.gtfs.org/terms#destinationZone", object: this._feedbaseuri + "/zones/" + data["destination_id"]});
}
if (data["contains_id"]) {
this.push({ subject: subject, predicate: "http://vocab.gtfs.org/terms#zone", object: this._feedbaseuri + "/zones/" + data["contains_id"]});
}
}
done();
};
module.exports = FareRulesTransformer;
| FareRulesTransformer |
key_bucket.rs | pub struct FastlyPublicKeyBucket {
dictionary: fastly::Dictionary,
//cache: ecamo::key_lookup::PublicKeyBucket,
}
impl FastlyPublicKeyBucket {
pub fn new(dictionary: fastly::Dictionary) -> Self |
fn get_from_dictionary(
&self,
key_name: &str,
) -> Result<Option<jwt_simple::algorithms::ES256PublicKey>, Box<dyn std::error::Error>> {
let jwk_string = if let Some(s) = self.dictionary.get(key_name) {
s
} else {
return Ok(None);
};
let jwk: ecamo::config::JwkObject = serde_json::from_str(&jwk_string)?;
let public_key: jwt_simple::algorithms::ES256PublicKey = jwk.try_into()?;
Ok(Some(public_key))
}
}
impl ecamo::key_lookup::PublicKeyLookup for FastlyPublicKeyBucket {
fn lookup(
&self,
key_name: &str,
) -> Option<std::borrow::Cow<jwt_simple::algorithms::ES256PublicKey>> {
match self.get_from_dictionary(key_name) {
Ok(Some(k)) => Some(std::borrow::Cow::Owned(k)),
Ok(None) => None,
Err(e) => {
log::warn!("public key error: key_name={key_name}, e={e}");
None
}
}
//if let Some(k) = self.cache.get(key_name) {
// return Some(k);
//}
//if let Some(public_key) = self.get_from_dictionary(key_name).unwrap() {
// let key = &public_key;
// self.cache.insert(key_name.to_string(), public_key);
// Some(key)
//} else {
// None
//}
}
}
| {
Self {
dictionary,
// cache: std::collections::HashMap::new(),
}
} |
resharing.rs | //! Multi-party key resharing
//!
//! Key resharing process resembles the key generation protocol, however no new random shards are sampled in the beginning. Instead, existing Shamir's shares are reshared with the set of new parties using new randomly generated polynomials.
//! New shares are generated by the set of current shareholders, after which existing shares are destroyed. Eventually old shareholders do not have access to the key anymore.
//!
//! The special case where the old party set is equal to the new party set is called "key refresh". In this case every party just updates own shard with new value.
use crate::protocol::PartyIndex;
use failure::Fail;
pub use super::messages::resharing::{InMsg, Message, OutMsg, Phase1Broadcast};
use crate::ecdsa::messages::SecretShare;
use curv::{BigInt, FE};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeSet, HashMap};
use std::fmt::Debug;
use trace::trace;
/// Contains zero knowledge proof of Paillier key's correctness
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CorrectKeyProof(Vec<BigInt>);
/// Enumerates errors which can be reported by resharing protocol
#[derive(Debug, Fail)]
#[allow(clippy::large_enum_variant)]
pub enum ResharingError {
#[fail(display = "resharing: timeout in {}", phase)]
Timeout { phase: String },
#[fail(display = "resharing: invalid empty message set {}", desc)]
EmptyMessageSet { desc: String },
#[fail(
display = "invalid decommitment {}, commitment {}, party {}",
decomm, comm, party
)]
InvalidComm {
comm: String,
decomm: String,
party: PartyIndex,
},
#[fail(display = "public keys of old committee members are not same")]
InconsistentPublicKeys,
#[fail(display = "invalid secret sharing {}, party {}", vss, party)]
InvalidVSS { vss: String, party: PartyIndex },
#[fail(display = "received point has wrong X coordinate: {}", x_coord)]
WrongXCoordinate { x_coord: usize },
#[fail(display = "unexpected message {:?}, party {}", message_type, party)]
UnknownMessageType {
message_type: Message,
party: PartyIndex,
},
#[fail(display = "invalid proof {}, party {}", proof, party)]
InvalidDlogProof { proof: String, party: PartyIndex },
#[fail(display = "invalid correct key proof {}, party {}", proof, party)]
InvalidCorrectKeyProof { proof: String, party: PartyIndex },
#[fail(display = "missing range proof from {} ", party)]
RangeProofSetupMissing { party: PartyIndex },
#[fail(display = "unexpected range proof from {}, proof {:?} ", party, proof)]
RangeProofSetupUnexpected { proof: String, party: PartyIndex },
#[fail(
display = "range proof setup: dlog proof failed , party {}, proof {} ",
party, proof
)]
RangeProofSetupDlogProofFailed { proof: String, party: PartyIndex },
#[fail(display = "protocol setup error: {}", _0)]
ProtocolSetupError(String),
#[fail(display = "{}", _0)]
GeneralError(String),
}
/// Contains a vector of possible resharing errors
#[derive(Debug)]
pub struct ErrorState {
pub errors: Vec<ResharingError>,
}
/// the state the machine returns in case of error(s)
impl ErrorState {
pub fn new(errors: Vec<ResharingError>) -> Self {
ErrorState { errors }
}
pub fn append(self, rhs: ErrorState) -> Self {
let mut errors = self.errors;
errors.extend(rhs.errors.into_iter());
Self { errors }
}
}
/// Checks whether all expected messages have been received so far from other parties
fn is_broadcast_input_complete(
current_msg_set: &[InMsg],
other_parties: &BTreeSet<PartyIndex>,
) -> bool {
let senders = current_msg_set.iter().map(|m| m.sender).collect::<Vec<_>>();
other_parties.iter().all(|p| senders.contains(p))
}
/// Extracts payloads form enum variants of input message into the hash map
#[trace(disable(current_msg_set), res = "{:?}")]
fn to_hash_map_gen<K, V>(current_msg_set: Vec<InMsg>) -> Result<HashMap<K, V>, Vec<ResharingError>>
where
K: std::cmp::Eq + std::hash::Hash + std::convert::From<PartyIndex> + std::fmt::Debug,
V: std::fmt::Debug,
Option<V>: std::convert::From<Message>,
{
let (converted_messages, errors) =
current_msg_set
.iter()
.fold((vec![], vec![]), |(mut values, mut errors), m| {
let body: Option<V> = m.body.clone().into();
match body {
Some(b) => values.push((m.sender, b)),
None => errors.push(ResharingError::UnknownMessageType {
message_type: m.body.clone(),
party: m.sender,
}),
};
(values, errors)
});
if errors.is_empty() {
Ok(converted_messages
.into_iter()
.map(|(party, body)| (party.into(), body))
.collect::<HashMap<K, V>>())
} else {
Err(errors)
}
}
fn map_parties_to_shares(
parties: &[PartyIndex],
outgoing_shares: &[FE],
) -> HashMap<PartyIndex, SecretShare> {
assert_eq!(outgoing_shares.len(), parties.len()); // hence unwrap() safely
let outgoing_shares = (1..=outgoing_shares.len())
.zip(outgoing_shares.iter())
.collect::<Vec<_>>();
let party_indexes_ascending = parties.iter().collect::<BTreeSet<_>>();
party_indexes_ascending
.iter()
.zip(outgoing_shares.iter())
.map(|(party, share)| (**party, (share.0, *share.1)))
.collect::<HashMap<_, _>>()
}
/// Contains the protocol part performed by a member of old committee
pub mod old_member {
use super::ErrorState;
use crate::ecdsa::keygen::MultiPartyInfo;
use crate::ecdsa::messages::resharing::{InMsg, Message, OutMsg, Phase1Broadcast, VSS};
use crate::ecdsa::resharing::{map_parties_to_shares, ResharingError};
use crate::protocol::{Address, PartyIndex};
use crate::state_machine::{State, StateMachineTraits, Transition};
use crate::Parameters;
use curv::cryptographic_primitives::hashing::hash_sha256::HSha256;
use curv::cryptographic_primitives::hashing::traits::Hash;
use curv::cryptographic_primitives::secret_sharing::feldman_vss::VerifiableSS;
use curv::elliptic::curves::traits::ECScalar;
use curv::{BigInt, FE, GE};
use std::cell::RefCell;
use std::collections::BTreeSet;
use std::iter::FromIterator;
use std::time::Duration;
use trace::trace;
use zeroize::Zeroize;
#[derive(Clone, Debug, super::Serialize, super::Deserialize)]
pub struct FinalState;
type OutMsgVec = Vec<OutMsg>;
pub type MachineResult = Result<FinalState, ErrorState>;
/// Type definitions
#[derive(Debug)]
pub struct KeyResharingTraits;
impl StateMachineTraits for KeyResharingTraits {
type InMsg = InMsg;
type OutMsg = OutMsg;
type FinalState = FinalState;
type ErrorState = ErrorState;
}
/// Initial phase of the protcol
///
/// * generates new Shamir's shares of existing share to share among members of new committee
/// * generates Feldman's VSS
/// * broadcasts commitment to public key and commitment to Feldman's VSS
/// * collects ACK messages
#[derive(Debug)]
pub struct Phase1 {
new_committee: BTreeSet<PartyIndex>,
vss_scheme: VerifiableSS,
outgoing_shares: Vec<FE>,
vss_comm: BigInt,
y: GE,
timeout: Option<Duration>,
}
#[trace(pretty, prefix = "Phase1::")]
impl Phase1 {
pub fn new(
multi_party_info: &MultiPartyInfo,
new_params: &Parameters,
old_committee: &[PartyIndex],
new_committee: &[PartyIndex],
timeout: Option<Duration>,
) -> Result<Self, ResharingError> {
//check if old committee is sized correctly
if old_committee.len() <= multi_party_info.key_params.threshold() {
return Err(ResharingError::ProtocolSetupError(
"old committee too small".to_string(),
));
}
if old_committee.len() > multi_party_info.key_params.share_count() {
return Err(ResharingError::ProtocolSetupError(
"old committee too big".to_string(),
));
}
// check if new committee is sized correctly
if new_committee.len() <= new_params.threshold() {
return Err(ResharingError::ProtocolSetupError(
"new committee too small".to_string(),
));
}
if new_committee.len() > new_params.share_count() {
return Err(ResharingError::ProtocolSetupError(
"new committee too big".to_string(),
));
}
// check if new committee has duplicates
let new_parties_as_set = BTreeSet::from_iter(new_committee.iter().cloned());
if new_parties_as_set.len() != new_committee.len() {
return Err(ResharingError::ProtocolSetupError(
"duplicate entries in new committee's list".to_string(),
));
}
let own_x: FE = ECScalar::from(&BigInt::from(multi_party_info.own_point() as u64));
let multiplier = multi_party_info
.party_to_point_map
.calculate_lagrange_multiplier(old_committee, own_x);
let w_i = multi_party_info.own_share() * multiplier;
let (vss_scheme, outgoing_shares) =
VerifiableSS::share(new_params.threshold, new_params.share_count, &w_i);
let vss_refs = vss_scheme.commitments.iter().collect::<Vec<_>>();
let vss_comm = HSha256::create_hash_from_ge(&vss_refs).to_big_int();
Ok(Phase1 {
new_committee: new_parties_as_set,
vss_scheme,
outgoing_shares,
vss_comm,
y: multi_party_info.public_key,
timeout,
})
}
}
#[trace(pretty, prefix = "Phase1::")]
impl State<KeyResharingTraits> for Phase1 {
fn start(&mut self) -> Option<OutMsgVec> {
log::info!("Phase1 (old member) starts");
let output = self
.new_committee
.iter()
.map(|p| OutMsg {
recipient: Address::Peer(*p),
body: Message::R1(Phase1Broadcast {
y: self.y,
vss_commitment: self.vss_comm.clone(),
}),
})
.collect::<Vec<_>>();
Some(output)
}
#[trace(disable(current_msg_set))]
fn is_message_expected(&self, msg: &InMsg, current_msg_set: &[InMsg]) -> bool {
matches!(msg.body, Message::Ack if self.new_committee.contains(&msg.sender) && !msg.is_duplicate(current_msg_set))
}
#[trace(disable(current_msg_set))]
fn is_input_complete(&self, current_msg_set: &[InMsg]) -> bool {
super::is_broadcast_input_complete(current_msg_set, &self.new_committee)
}
fn consume(&self, _current_msg_set: Vec<InMsg>) -> Transition<KeyResharingTraits> {
Transition::NewState(Box::new(Phase2 {
new_committee: self.new_committee.clone(),
vss_scheme: self.vss_scheme.clone(),
outgoing_shares: RefCell::new(self.outgoing_shares.clone()),
timeout: self.timeout,
}))
}
fn timeout(&self) -> Option<Duration> {
self.timeout
}
fn timeout_outcome(&self, _current_msg_set: Vec<InMsg>) -> MachineResult {
Err(ErrorState::new(vec![super::ResharingError::Timeout {
phase: "Old.phase1".to_owned(),
}]))
}
}
/// Second phase of the protocol
///
/// * Shares new Shamir's secrets and their respective Feldman's VSS with members of new committee
/// * Collect `FinalAck` messages and exits
struct Phase2 {
new_committee: BTreeSet<PartyIndex>,
vss_scheme: VerifiableSS,
outgoing_shares: RefCell<Vec<FE>>,
timeout: Option<Duration>,
}
impl Phase2 {
fn zeroize_secret_shares(&self) {
// Simultaneously remove and zeroize elements.
self.outgoing_shares
.borrow_mut()
.drain(..)
.for_each(|mut share| share.zeroize());
}
}
#[trace(pretty, prefix = "Phase2::")]
impl State<KeyResharingTraits> for Phase2 {
fn start(&mut self) -> Option<Vec<OutMsg>> |
#[trace(disable(current_msg_set))]
fn is_message_expected(&self, msg: &InMsg, current_msg_set: &[InMsg]) -> bool {
matches!(msg.body, Message::FinalAck if self.new_committee.contains(&msg.sender) && !msg.is_duplicate(current_msg_set))
}
#[trace(disable(current_msg_set))]
fn is_input_complete(&self, current_msg_set: &[InMsg]) -> bool {
super::is_broadcast_input_complete(current_msg_set, &self.new_committee)
}
fn consume(&self, _current_msg_set: Vec<InMsg>) -> Transition<KeyResharingTraits> {
log::info!("Phase2 succeeded");
self.zeroize_secret_shares();
Transition::FinalState(Ok(FinalState {}))
}
fn timeout(&self) -> Option<Duration> {
self.timeout
}
fn timeout_outcome(&self, _current_msg_set: Vec<InMsg>) -> MachineResult {
Err(ErrorState::new(vec![super::ResharingError::Timeout {
phase: "Old.phase2".to_owned(),
}]))
}
}
/// Helper function which returns true if a given message of the resharing protocol should be forwarded to a member of old committee
pub fn is_message_to_committee(msg: &Message) -> bool {
matches!(msg, Message::Ack | Message::FinalAck)
}
}
/// Contains the protocol part performed by a member of new committee
pub mod new_member {
use crate::algorithms::nizk_rsa;
use crate::ecdsa::keygen::{CorrectKeyProof, MultiPartyInfo, Party2PointMap, RangeProofSetups};
use crate::ecdsa::messages::resharing::{Phase1Broadcast, Phase2Broadcast, VSS};
use crate::ecdsa::resharing::{
map_parties_to_shares, to_hash_map_gen, ErrorState, InMsg, Message, OutMsg, ResharingError,
};
use crate::ecdsa::{all_mapped_equal, PaillierKeys, PRIME_BIT_LENGTH_IN_PAILLIER_SCHEMA};
use crate::protocol::{Address, PartyIndex};
use crate::state_machine::{State, StateMachineTraits, Transition};
use crate::Parameters;
use curv::cryptographic_primitives::hashing::hash_sha256::HSha256;
use curv::cryptographic_primitives::hashing::traits::Hash;
use curv::elliptic::curves::traits::{ECPoint, ECScalar};
use curv::{BigInt, FE, GE};
use paillier::{EncryptionKey, KeyGeneration, Paillier};
use crate::algorithms::zkp::{ZkpPublicSetup, ZkpSetup};
use crate::ecdsa::messages::SecretShare;
use failure::_core::time::Duration;
use std::collections::{BTreeSet, HashMap};
use std::iter::FromIterator;
use trace::trace;
/// Result of resharing protocol
#[derive(Clone, Debug, super::Serialize, super::Deserialize)]
pub struct FinalState {
pub info: MultiPartyInfo,
}
#[doc(hidden)]
type OutMsgVec = Vec<OutMsg>;
/// Type definitions
#[derive(Debug)]
pub struct KeyResharingTraits;
impl StateMachineTraits for KeyResharingTraits {
type InMsg = InMsg;
type OutMsg = OutMsg;
type FinalState = FinalState;
type ErrorState = ErrorState;
}
pub type MachineResult = Result<FinalState, ErrorState>;
/// Starting phase of resharing protocol
///
/// * Sends nothing out
/// * collects commitments to public key and to Feldman's VSS
/// * verifies that all public keys are same
#[derive(Clone, Debug)]
pub struct Phase1 {
old_params: Parameters,
new_params: Parameters,
old_committee: BTreeSet<PartyIndex>,
others_from_new_committee: BTreeSet<PartyIndex>,
own_party_index: PartyIndex,
range_proof_setup: Option<ZkpSetup>,
timeout: Option<Duration>,
}
#[trace(pretty, prefix = "Phase1::")]
impl Phase1 {
pub fn new(
old_params: &Parameters,
new_params: &Parameters,
old_committee: &[PartyIndex],
new_committee: &[PartyIndex],
own_party_index: PartyIndex,
range_proof_setup: Option<ZkpSetup>,
timeout: Option<Duration>,
) -> Result<Self, ResharingError> {
// check if old committee is sized correctly
if old_committee.len() <= old_params.threshold() {
return Err(ResharingError::ProtocolSetupError(
"old committee too small".to_string(),
));
}
if old_committee.len() > old_params.share_count() {
return Err(ResharingError::ProtocolSetupError(
"old committee too big".to_string(),
));
}
// check if new committee is sized correctly
if new_committee.len() <= new_params.threshold() {
return Err(ResharingError::ProtocolSetupError(
"new committee too small".to_string(),
));
}
if new_committee.len() > new_params.share_count() {
return Err(ResharingError::ProtocolSetupError(
"new committee too big".to_string(),
));
}
// check if new committee has duplicates
let old_parties_as_set = BTreeSet::from_iter(old_committee.iter().cloned());
if old_parties_as_set.len() != old_committee.len() {
return Err(ResharingError::ProtocolSetupError(
"duplicate entries in new committee's list".to_string(),
));
}
// check if new committee has duplicates
let new_parties_as_set = BTreeSet::from_iter(new_committee.iter().cloned());
if new_parties_as_set.len() != new_committee.len() {
return Err(ResharingError::ProtocolSetupError(
"duplicate entries in new committee's list".to_string(),
));
}
if new_parties_as_set.get(&own_party_index).is_none() {
return Err(ResharingError::ProtocolSetupError(
"own party index not in new committee list".to_string(),
));
}
let mut others_from_new_committee = new_parties_as_set;
others_from_new_committee.remove(&own_party_index);
Ok(Phase1 {
old_params: *old_params,
new_params: *new_params,
old_committee: BTreeSet::from_iter(old_committee.iter().cloned()),
others_from_new_committee,
own_party_index,
range_proof_setup,
timeout,
})
}
}
#[trace(pretty, prefix = "Phase1::")]
impl State<KeyResharingTraits> for Phase1 {
fn start(&mut self) -> Option<OutMsgVec> {
log::info!("Phase1 (new member) starts");
None
}
#[trace(disable(current_msg_set))]
fn is_message_expected(&self, msg: &InMsg, current_msg_set: &[InMsg]) -> bool {
matches!(msg.body, Message::R1(_)) && !msg.is_duplicate(current_msg_set)
}
#[trace(disable(current_msg_set))]
fn is_input_complete(&self, current_msg_set: &[InMsg]) -> bool {
super::is_broadcast_input_complete(current_msg_set, &self.old_committee)
}
fn consume(&self, current_msg_set: Vec<InMsg>) -> Transition<KeyResharingTraits> {
match to_hash_map_gen::<PartyIndex, Phase1Broadcast>(current_msg_set) {
Ok(input) => {
if input.is_empty() {
let error_state = ErrorState::new(vec![ResharingError::EmptyMessageSet {
desc: "Phase1, new committee".to_string(),
}]);
log::error!("Phase1 returns {:?}", error_state);
return Transition::FinalState(Err(error_state));
}
let different_public_keys = !all_mapped_equal(input.iter(), |(_, msg)| {
msg.y.bytes_compressed_to_big_int()
});
if different_public_keys {
let error_state =
ErrorState::new(vec![ResharingError::InconsistentPublicKeys]);
log::error!("Phase1 returns {:?}", error_state);
return Transition::FinalState(Err(error_state));
}
// Actual consuming happens here
let (ek, dk) = Paillier::keypair_with_modulus_size(
2 * PRIME_BIT_LENGTH_IN_PAILLIER_SCHEMA,
)
.keys();
let y = input.iter().next().map(|(_, msg)| msg.y).unwrap();
let vss_comms = input
.into_iter()
.map(|(p, m)| (p, m.vss_commitment))
.collect::<HashMap<_, _>>();
Transition::NewState(Box::new(Phase2 {
previous_phase: (*self).clone(),
y,
vss_comms,
my_paillier_keys: PaillierKeys { dk, ek },
}))
}
Err(e) => {
let error_state = ErrorState::new(e);
log::error!("Phase 1 returns {:?}", error_state);
Transition::FinalState(Err(error_state))
}
}
}
fn timeout_outcome(&self, _current_msg_set: Vec<InMsg>) -> MachineResult {
Err(ErrorState::new(vec![super::ResharingError::Timeout {
phase: "Old.phase1".to_owned(),
}]))
}
fn timeout(&self) -> Option<Duration> {
self.timeout
}
}
/// Second phase of the resharing protocol
///
/// * Broadcasts public Paillier key, ZK proof of its correctness and optional `RangeProof` setup to other members of new committee
/// * Collects and verifies same items from other parties
#[derive(Clone)]
pub struct Phase2 {
previous_phase: Phase1,
y: GE,
vss_comms: HashMap<PartyIndex, BigInt>,
my_paillier_keys: PaillierKeys,
}
#[trace(pretty, prefix = "Phase2::")]
impl Phase2 {
fn verify_range_proof_setups(
&self,
input: &HashMap<PartyIndex, Phase2Broadcast>,
) -> Result<Option<RangeProofSetups>, Vec<ResharingError>> {
let my_range_proof_setup = &self.previous_phase.range_proof_setup;
let verification_errors = input
.iter()
.filter_map(
|(&p, m)| match (my_range_proof_setup, &m.range_proof_setup) {
(Some(_), None) => {
Some(ResharingError::RangeProofSetupMissing { party: p })
}
(None, Some(s)) => Some(ResharingError::RangeProofSetupUnexpected {
party: p,
proof: format!("{:?}", s.dlog_proof),
}),
(Some(_), Some(setup)) => {
if setup.verify().is_err() {
Some(ResharingError::RangeProofSetupDlogProofFailed {
proof: format!("{:?}", setup.dlog_proof),
party: p,
})
} else {
None
}
}
_ => None,
},
)
.collect::<Vec<_>>();
if verification_errors.is_empty() {
// either local setup exists and all parties shared their setups
// or local setup does not exist and all parties did not share theirs setups
Ok(my_range_proof_setup.as_ref().map(|s| RangeProofSetups {
my_setup: s.clone(),
party_setups: input
.iter()
.map(|(&p, m)| {
(
p,
m.range_proof_setup
.as_ref()
.expect("range proof setup can't be None here")
.clone(),
)
})
.collect::<HashMap<_, _>>(),
}))
} else {
Err(verification_errors)
}
}
}
#[trace(pretty, prefix = "Phase2::")]
impl State<KeyResharingTraits> for Phase2 {
fn start(&mut self) -> Option<OutMsgVec> {
log::debug!("Phase2 (new member) starts");
let range_proof_setup = self
.previous_phase
.range_proof_setup
.as_ref()
.map(|s| ZkpPublicSetup::from_private_zkp_setup(s));
let proof = nizk_rsa::gen_proof(self.my_paillier_keys.dk.clone());
#[allow(clippy::if_not_else)]
let output = self
.previous_phase
.others_from_new_committee
.iter()
.map(|p| OutMsg {
recipient: Address::Peer(*p),
body: Message::R2(Phase2Broadcast {
ek: self.my_paillier_keys.ek.clone(),
correct_key_proof: CorrectKeyProof(proof.clone()),
range_proof_setup: range_proof_setup.clone(),
}),
})
.collect();
Some(output)
}
#[trace(disable(current_msg_set))]
fn is_message_expected(&self, msg: &InMsg, current_msg_set: &[InMsg]) -> bool {
matches!(msg.body,
Message::R2(_)
if self.previous_phase.others_from_new_committee.contains(&msg.sender)
&& !msg.is_duplicate(current_msg_set))
}
#[trace(disable(current_msg_set))]
fn is_input_complete(&self, current_msg_set: &[InMsg]) -> bool {
super::is_broadcast_input_complete(
current_msg_set,
&self.previous_phase.others_from_new_committee,
)
}
fn consume(&self, current_msg_set: Vec<InMsg>) -> Transition<KeyResharingTraits> {
match to_hash_map_gen::<PartyIndex, Phase2Broadcast>(current_msg_set) {
Ok(input) => {
let mut errors = input
.iter()
.filter_map(|(party, msg)| {
if nizk_rsa::verify(&msg.ek, &msg.correct_key_proof.0).is_err() {
Some(ResharingError::InvalidCorrectKeyProof {
proof: format!("{:?}", msg.correct_key_proof),
party: *party,
})
} else {
None
}
})
.collect::<Vec<_>>();
let range_proof_setups = match self.verify_range_proof_setups(&input) {
Err(ve) => {
errors.extend(ve);
None
}
Ok(setups) => setups,
};
let mut other_paillier_keys = input
.into_iter()
.map(|(p, msg)| (p, msg.ek))
.collect::<HashMap<_, _>>();
other_paillier_keys.insert(
self.previous_phase.own_party_index,
self.my_paillier_keys.ek.clone(),
);
if !errors.is_empty() {
let error_state = ErrorState::new(errors);
log::error!("Phase 2 returns {:?}", error_state);
return Transition::FinalState(Err(error_state));
}
Transition::NewState(Box::new(Phase3 {
previous_phase: (*self).clone(),
other_paillier_keys,
range_proof_setups,
}))
}
Err(e) => {
let error_state = ErrorState::new(e);
log::error!("Phase 2 return {:?}", error_state);
Transition::FinalState(Err(error_state))
}
}
}
fn timeout(&self) -> Option<Duration> {
self.previous_phase.timeout
}
fn timeout_outcome(&self, _current_msg_set: Vec<InMsg>) -> MachineResult {
Err(ErrorState::new(vec![super::ResharingError::Timeout {
phase: "New.phase2".to_owned(),
}]))
}
}
/// Third phase of the protocol
///
/// * sends ACK to old members
/// * collects new Shamir's secrets and FVSS from them
/// * verifies FVSS
#[derive(Clone)]
struct Phase3 {
previous_phase: Phase2,
other_paillier_keys: HashMap<PartyIndex, EncryptionKey>,
range_proof_setups: Option<RangeProofSetups>,
}
#[trace(pretty, prefix = "Phase3::")]
impl State<KeyResharingTraits> for Phase3 {
fn start(&mut self) -> Option<Vec<OutMsg>> {
log::debug!("Phase3 (new member) starts");
Some(
self.previous_phase
.previous_phase
.old_committee
.iter()
.map(|p| OutMsg {
recipient: Address::Peer(*p),
body: Message::Ack,
})
.collect::<Vec<_>>(),
)
}
#[trace(disable(current_msg_set))]
fn is_message_expected(&self, msg: &InMsg, current_msg_set: &[InMsg]) -> bool {
matches!(msg.body,
Message::R3(_)
if self.previous_phase.previous_phase.old_committee.contains(&msg.sender)
&& !msg.is_duplicate(current_msg_set))
}
#[trace(disable(current_msg_set))]
fn is_input_complete(&self, current_msg_set: &[InMsg]) -> bool {
super::is_broadcast_input_complete(
current_msg_set,
&self.previous_phase.previous_phase.old_committee,
)
}
fn consume(&self, current_msg_set: Vec<InMsg>) -> Transition<KeyResharingTraits> {
match to_hash_map_gen::<PartyIndex, VSS>(current_msg_set) {
Err(e) => {
let error_state = ErrorState::new(e);
log::error!("Phase 3 returns {:?}", error_state);
Transition::FinalState(Err(error_state))
}
Ok(input) => {
// check input for emptiness
if input.is_empty() {
let error_state = ErrorState::new(vec![ResharingError::EmptyMessageSet {
desc: "Phase3, new committee".to_string(),
}]);
log::error!("Phase 3 returns {:?}", error_state);
return Transition::FinalState(Err(error_state));
}
// check if all x coordinates are same
if !all_mapped_equal(input.iter(), |(_, vss)| vss.share.0) {
let error_state = ErrorState::new(vec![ResharingError::GeneralError(
"Shares have different x coordinate".to_string(),
)]);
log::error!("Phase 3 returns {:?}", error_state);
return Transition::FinalState(Err(error_state));
}
let (my_x, my_share) = (
input.iter().next().map(|(_, vss)| vss.share.0).unwrap(),
input
.iter()
.fold(FE::zero(), |acc, (_, vss)| acc + vss.share.1),
);
// check commitment errors
let commitment_errors = input
.into_iter()
.filter_map(|(p, vss)| {
let ((_, x_i), vss) = (vss.share, vss.vss);
let vss_refs = vss.commitments.iter().collect::<Vec<_>>();
let decomm = HSha256::create_hash_from_ge(&vss_refs).to_big_int();
match self.previous_phase.vss_comms.get(&p) {
Some(comm) => {
if *comm == decomm {
match vss.validate_share(&x_i, my_x) {
Ok(()) => None,
Err(_) => Some(ResharingError::InvalidVSS {
vss: format!("{:?}", vss),
party: p,
}),
}
} else {
Some(ResharingError::InvalidComm {
comm: format!("{:?}", comm),
decomm: format!("{:?}", decomm),
party: p,
})
}
}
None => Some(ResharingError::GeneralError(format!(
"commitment not found for party {}",
p
))),
}
})
.collect::<Vec<_>>();
if !commitment_errors.is_empty() {
let error_state = ErrorState::new(commitment_errors);
log::error!("Phase3 returns {:?}", error_state);
return Transition::FinalState(Err(error_state));
}
Transition::NewState(Box::new(Phase4 {
previous_phase: (*self).clone(),
share: (my_x, my_share),
}))
}
}
}
fn timeout_outcome(&self, _current_msg_set: Vec<InMsg>) -> MachineResult {
Err(ErrorState::new(vec![super::ResharingError::Timeout {
phase: "Old.phase3".to_owned(),
}]))
}
fn timeout(&self) -> Option<Duration> {
self.previous_phase.previous_phase.timeout
}
}
/// Last phase of the protocol
///
/// * sends `FinalAck` messages to all parties, including members of old and new committees
/// * collects `FinalAck` from membeers of new committee and exits
struct Phase4 {
previous_phase: Phase3,
share: SecretShare,
}
#[trace(pretty, prefix = "Phase4::")]
impl State<KeyResharingTraits> for Phase4 {
fn start(&mut self) -> Option<Vec<OutMsg>> {
log::debug!("Phase4 (new member) starts");
let self_setup = &self.previous_phase.previous_phase.previous_phase;
Some(
#[allow(clippy::filter_map)]
self_setup
.old_committee
.iter()
.map(|p| OutMsg {
recipient: Address::Peer(*p),
body: Message::FinalAck,
})
.chain(self_setup.others_from_new_committee.iter().map(|p| OutMsg {
recipient: Address::Peer(*p),
body: Message::FinalAck,
}))
.collect::<Vec<_>>(),
)
}
#[trace(disable(current_msg_set))]
fn is_message_expected(&self, msg: &InMsg, current_msg_set: &[InMsg]) -> bool {
matches!(msg.body, Message::FinalAck
if self.previous_phase.previous_phase.previous_phase.others_from_new_committee.contains(&msg.sender)
&& !msg.is_duplicate(current_msg_set))
}
#[trace(disable(current_msg_set))]
fn is_input_complete(&self, current_msg_set: &[InMsg]) -> bool {
super::is_broadcast_input_complete(
current_msg_set,
&self
.previous_phase
.previous_phase
.previous_phase
.others_from_new_committee,
)
}
fn consume(&self, _current_msg_set: Vec<InMsg>) -> Transition<KeyResharingTraits> {
let mut new_committee = self
.previous_phase
.previous_phase
.previous_phase
.others_from_new_committee
.iter()
.cloned()
.collect::<Vec<_>>();
new_committee.push(
self.previous_phase
.previous_phase
.previous_phase
.own_party_index,
);
let party_mapping_to_points = Party2PointMap {
// using dummy shares as we need x-coords only
points: map_parties_to_shares(
new_committee.as_slice(),
&vec![FE::zero(); new_committee.len()],
)
.into_iter()
.map(|(party, (point, _))| (party, point))
.collect::<HashMap<_, _>>(),
};
log::info!("Phase4 succeeded");
Transition::FinalState(Ok(FinalState {
info: MultiPartyInfo {
key_params: self.previous_phase.previous_phase.previous_phase.new_params,
own_party_index: self
.previous_phase
.previous_phase
.previous_phase
.own_party_index,
secret_share: self.share,
public_key: self.previous_phase.previous_phase.y,
own_he_keys: self.previous_phase.previous_phase.my_paillier_keys.clone(),
party_he_keys: self.previous_phase.other_paillier_keys.clone(),
party_to_point_map: party_mapping_to_points,
range_proof_setups: self.previous_phase.range_proof_setups.clone(),
},
}))
}
fn timeout(&self) -> Option<Duration> {
self.previous_phase.previous_phase.previous_phase.timeout
}
fn timeout_outcome(&self, _current_msg_set: Vec<InMsg>) -> MachineResult {
Err(ErrorState::new(vec![super::ResharingError::Timeout {
phase: "New.phase4".to_owned(),
}]))
}
}
/// Helper function which returns true if a given message of the resharing protocol should be forwarded to a member of new committee
pub fn is_message_to_committee(msg: &Message) -> bool {
!matches!(msg, Message::Ack)
}
}
#[cfg(test)]
mod tests {
use crate::algorithms::zkp::ZkpSetup;
use crate::ecdsa::keygen::MultiPartyInfo;
use crate::ecdsa::messages::SecretShare;
use crate::ecdsa::resharing::new_member::KeyResharingTraits;
use crate::ecdsa::resharing::old_member::KeyResharingTraits as OldKeyResharingTraits;
use crate::ecdsa::resharing::{InMsg, OutMsg};
use crate::protocol::{Address, InputMessage, PartyIndex};
use crate::state_machine::sync_channels::StateMachine;
use crate::Parameters;
use crossbeam_channel::{Receiver, Sender};
use curv::cryptographic_primitives::secret_sharing::feldman_vss::VerifiableSS;
use curv::elliptic::curves::traits::{ECPoint, ECScalar};
use curv::{BigInt, FE, GE};
use failure::bail;
use std::path::Path;
use std::{fs, thread};
struct Node {
party: PartyIndex,
egress: Receiver<OutMsg>,
ingress: Sender<InMsg>,
}
struct OutputMessageWithSource {
msg: OutMsg,
source: PartyIndex,
}
#[test]
fn resharing() -> Result<(), failure::Error> {
let _ = env_logger::builder().is_test(true).try_init();
sharing_helper(false)
}
#[test]
fn resharing_with_range_proofs() -> Result<(), failure::Error> {
let _ = env_logger::builder().is_test(true).try_init();
sharing_helper(true)
}
pub fn sharing_helper(use_range_proofs: bool) -> Result<(), failure::Error> {
let _ = env_logger::builder().is_test(true).try_init();
let old_params = Parameters {
share_count: 3,
threshold: 1,
};
let new_params = Parameters {
share_count: 4,
threshold: 1,
};
let mut old_nodes = Vec::new();
let mut new_nodes = Vec::new();
let old_committee: Vec<usize> = vec![0, 1, 2];
let new_committee: Vec<usize> = vec![0, 1, 2, 3];
let mut old_handles = Vec::new();
let mut new_handles = Vec::new();
// start new committee first
for i in new_committee.clone() {
let (ingress, rx) = crossbeam_channel::unbounded();
let (tx, egress) = crossbeam_channel::unbounded();
log::info!("starting party new_{}", i);
let nc_clone = new_committee
.iter()
.map(|i| (*i).into())
.collect::<Vec<PartyIndex>>();
let oc_clone = old_committee
.iter()
.map(|i| (*i).into())
.collect::<Vec<PartyIndex>>();
let range_proof_setup = if use_range_proofs {
// the setup from the bank of pre-generated ones
let path = Path::new("tests/data/rp-setups.json");
let zkp_setups: Vec<ZkpSetup> = serde_json::from_str(&fs::read_to_string(path)?)?;
Some(zkp_setups[i].clone())
} else {
None
};
assert!(!use_range_proofs || range_proof_setup.is_some());
let join_handle = thread::spawn(move || {
let start_state = Box::new(super::new_member::Phase1::new(
&old_params,
&new_params,
&oc_clone,
&nc_clone,
i.into(),
range_proof_setup,
None,
)?);
let mut new_member_machine =
StateMachine::<KeyResharingTraits>::new(start_state, &rx, &tx);
match new_member_machine.execute() {
Some(Ok(fs)) => {
log::trace!("new_{} success", i);
Ok(fs)
}
Some(Err(e)) => {
bail!("new_{} error {:?}", i, e);
}
None => {
bail!("new_{} error in the machine", i);
}
}
});
new_nodes.push(Node {
party: i.into(),
egress,
ingress,
});
new_handles.push(join_handle);
}
// and the start old committee
for i in old_committee.clone() {
let (ingress, rx) = crossbeam_channel::unbounded();
let (tx, egress) = crossbeam_channel::unbounded();
log::info!("starting party old_{}", i);
let path = if use_range_proofs {
format!("tests/data/zkrp-keys.{}.json", i)
} else {
format!("tests/data/keys.{}.json", i)
};
let path = Path::new(&path);
let multi_party_shared_info: MultiPartyInfo =
serde_json::from_str(&fs::read_to_string(path)?)?;
assert!(!use_range_proofs || multi_party_shared_info.range_proof_setups.is_some());
let oc_clone = old_committee
.iter()
.map(|i| (*i).into())
.collect::<Vec<PartyIndex>>();
let nc_clone = new_committee
.iter()
.map(|i| (*i).into())
.collect::<Vec<PartyIndex>>();
let join_handle = thread::spawn(move || {
let start_state = Box::new(super::old_member::Phase1::new(
&multi_party_shared_info,
&new_params,
&oc_clone,
&nc_clone,
None,
)?);
let mut old_member_machine =
StateMachine::<OldKeyResharingTraits>::new(start_state, &rx, &tx);
match old_member_machine.execute() {
Some(Ok(fs)) => {
log::trace!("old_{} success", i);
Ok(fs)
}
Some(Err(e)) => {
bail!("old_{} error {:?}", i, e);
}
None => {
bail!("old_{} error in the machine", i);
}
}
});
old_nodes.push(Node {
party: i.into(),
egress,
ingress,
});
old_handles.push(join_handle);
}
//run the multiplexor
let _mx_thread = thread::spawn(move || {
loop {
let mut messages_to_new_nodes = Vec::new();
let mut messages_to_old_nodes = Vec::new();
// collect output from old odes
for node in old_nodes.iter() {
if let Ok(out_msg) = node.egress.try_recv() {
if super::new_member::is_message_to_committee(&out_msg.body) {
messages_to_new_nodes.push(OutputMessageWithSource {
msg: out_msg,
source: node.party,
});
}
}
}
for node in new_nodes.iter() {
if let Ok(out_msg) = node.egress.try_recv() {
if super::old_member::is_message_to_committee(&out_msg.body) {
messages_to_old_nodes.push(OutputMessageWithSource {
msg: out_msg.clone(),
source: node.party,
});
}
if super::new_member::is_message_to_committee(&out_msg.body) {
messages_to_new_nodes.push(OutputMessageWithSource {
msg: out_msg.clone(),
source: node.party,
});
}
}
}
// forward collected messages
messages_to_old_nodes
.iter()
.for_each(|mm| match &mm.msg.recipient {
Address::Broadcast => {
log::error!("the algorithm should not use broadcast");
}
Address::Peer(peer) => {
if let Some(node) = old_nodes.iter().find(|node| (*node).party == *peer)
{
match node.ingress.send(InputMessage {
sender: mm.source,
body: mm.msg.body.clone(),
}) {
Ok(()) => {}
Err(_) => log::warn!(
"error sending msg to old node {}, msg: {}",
peer,
mm.msg.body
),
}
}
}
});
messages_to_new_nodes
.iter()
.for_each(|mm| match &mm.msg.recipient {
Address::Broadcast => {
log::error!("the algorithm should not use broadcast");
}
Address::Peer(peer) => {
if let Some(node) = new_nodes.iter().find(|node| (*node).party == *peer)
{
match node.ingress.send(InputMessage {
sender: mm.source,
body: mm.msg.body.clone(),
}) {
Ok(()) => {}
Err(_) => log::warn!(
"error sending msg to new node {}, msg: {}",
peer,
mm.msg.body
),
};
}
}
});
}
});
let old_committee_result = old_handles
.into_iter()
.map(|h| h.join())
.collect::<Vec<_>>();
let new_committee_result = new_handles
.into_iter()
.map(|h| h.join())
.collect::<Vec<_>>();
if old_committee_result
.iter()
.any(|r| r.is_err() || r.as_ref().unwrap().is_err())
{
old_committee_result.iter().for_each(|r| match r {
Ok(result) => match result {
Ok(final_state) => log::error!("{:?}", final_state),
Err(e) => log::error!("{:?}", e),
},
Err(e) => log::error!("{:?}", e),
});
assert!(false, "Some state machines returned error");
}
if new_committee_result
.iter()
.any(|r| r.is_err() || r.as_ref().unwrap().is_err())
{
new_committee_result.iter().for_each(|r| match r {
Ok(result) => match result {
Ok(final_state) => log::error!("{:?}", final_state),
Err(e) => log::error!("{:?}", e),
},
Err(e) => log::error!("{:?}", e),
});
assert!(false, "Some state machines returned error");
}
let new_final_states = new_committee_result
.into_iter()
.map(|x| x.unwrap().unwrap())
.collect::<Vec<_>>();
// reconstruct the secret
let secret_shares = new_final_states
.iter()
.map(|fs| fs.info.secret_share)
.collect::<Vec<_>>();
let reconstructed_private_key = reconstruct(&secret_shares);
let old_public_key = new_final_states
.iter()
.map(|s| s.info.public_key)
.collect::<Vec<_>>()[0];
let g: GE = ECPoint::generator();
let new_public_key = g * reconstructed_private_key;
assert_eq!(
new_public_key.get_element(),
old_public_key.get_element(),
"new private key key does not match odl public key"
);
Ok(())
}
pub fn reconstruct(secret_shares: &[SecretShare]) -> FE {
//assert!(shares.len() >= self.reconstruct_limit());
let (points, shares): (Vec<FE>, Vec<FE>) = secret_shares
.iter()
.map(|(x, y)| {
let index_bn = BigInt::from(*x as u64);
let x_coord: FE = ECScalar::from(&index_bn);
(x_coord, y)
})
.unzip();
VerifiableSS::lagrange_interpolation_at_zero(&points, &shares)
}
}
| {
log::debug!("Phase2 (old member) starts");
let output = map_parties_to_shares(
&self.new_committee.iter().cloned().collect::<Vec<_>>(),
&self.outgoing_shares.borrow(),
);
Some(
output
.into_iter()
.map(|(p, (x, share))| OutMsg {
recipient: Address::Peer(p),
body: Message::R3(VSS {
share: (x, share),
vss: self.vss_scheme.clone(),
}),
})
.collect::<Vec<_>>(),
)
} |
message.rs | use super::{Result, WebSocketError};
#[cfg(any(feature = "serde-json", feature = "serde-wasm-bindgen"))]
use crate::browser::json;
#[cfg(any(feature = "serde-json", feature = "serde-wasm-bindgen"))]
use serde::de::DeserializeOwned;
use wasm_bindgen::{JsCast, JsValue};
use web_sys::MessageEvent;
#[allow(clippy::module_name_repetitions)]
#[derive(Debug)]
pub struct WebSocketMessage {
pub(crate) data: JsValue,
pub(crate) message_event: MessageEvent,
}
impl WebSocketMessage {
/// Return message data as `String`.
///
/// # Errors
///
/// Returns `WebSocketError::TextError` if data isn't a valid utf-8 string.
pub fn text(&self) -> Result<String> {
self.data.as_string().ok_or(WebSocketError::TextError(
"data is not a valid utf-8 string",
))
}
/// JSON parse message data into provided type.
///
/// # Errors
///
/// Returns
/// - `WebSocketError::SerdeError` when JSON decoding fails.
#[cfg(any(feature = "serde-json", feature = "serde-wasm-bindgen"))]
pub fn json<T>(&self) -> Result<T>
where
T: DeserializeOwned + 'static,
{
if self.data.has_type::<js_sys::JsString>() {
let json_string = self.data.as_string().ok_or(WebSocketError::TextError(
"value is not a valid utf-8 string",
))?;
json::from_str(&json_string)
} else {
json::from_js_value(&self.data)
}
.map_err(WebSocketError::JsonError)
}
/// Return message data as `Vec<u8>`.
///
/// # Errors
///
/// Returns:
/// - `WebSocketError::PromiseError` when loading bytes from `Blob` fails.
/// - `WebSocketError::TextError` if the message data isn't binary but also not a valid utf-8 string.
pub async fn bytes(&self) -> Result<Vec<u8>> {
if let Some(array_buffer) = self.data.dyn_ref::<js_sys::ArrayBuffer>() {
let bytes = js_sys::Uint8Array::new(array_buffer).to_vec();
return Ok(bytes);
}
if let Some(blob) = self.data.dyn_ref::<web_sys::Blob>() {
let blob = gloo_file::Blob::from(blob.clone());
let bytes = gloo_file::futures::read_as_bytes(&blob)
.await
.map_err(WebSocketError::FileReaderError)?;
return Ok(bytes);
}
Ok(self.text()?.into_bytes())
}
/// Return message data as `Blob`.
///
/// # Errors
///
/// Returns `WebSocketError::TextError` if the message data is neither binary nor a valid utf-8 string.
pub fn blob(self) -> Result<gloo_file::Blob> {
if self.contains_array_buffer() {
let array_buffer = self.data.unchecked_into::<js_sys::ArrayBuffer>();
return Ok(gloo_file::Blob::new(array_buffer));
}
if self.contains_blob() {
let blob = self.data.unchecked_into::<web_sys::Blob>();
return Ok(gloo_file::Blob::from(blob));
}
Ok(gloo_file::Blob::new(self.text()?.as_str()))
}
/// Is message data `ArrayBuffer`?
pub fn contains_array_buffer(&self) -> bool {
self.data.has_type::<js_sys::ArrayBuffer>()
}
/// Is message data `Blob`?
pub fn contains_blob(&self) -> bool {
self.data.has_type::<web_sys::Blob>()
}
/// Is message data `String`?
pub fn contains_text(&self) -> bool {
self.data.has_type::<js_sys::JsString>()
}
/// Get underlying data as `wasm_bindgen::JsValue`.
///
/// This is an escape path if current API can't handle your needs.
/// Should you find yourself using it, please consider [opening an issue][issue].
///
/// [issue]: https://github.com/seed-rs/seed/issues
pub const fn raw_data(&self) -> &JsValue {
&self.data
}
/// Get underlying `web_sys::MessageEvent`.
///
/// This is an escape path if current API can't handle your needs.
/// Should you find yourself using it, please consider [opening an issue][issue].
///
/// [issue]: https://github.com/seed-rs/seed/issues
pub const fn | (&self) -> &web_sys::MessageEvent {
&self.message_event
}
}
#[cfg(test)]
pub mod tests {
use crate::browser::web_socket::WebSocketMessage;
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
async fn get_bytes_from_message() {
let bytes = "some test message".as_bytes();
let blob = gloo_file::Blob::new(bytes);
let message_event = web_sys::MessageEvent::new("test").unwrap();
let ws_msg = WebSocketMessage {
data: blob.into(),
message_event,
};
let result_bytes = ws_msg.bytes().await.unwrap();
assert_eq!(bytes, &*result_bytes);
}
use serde::{Deserialize, Serialize};
use wasm_bindgen::JsValue;
#[derive(Serialize, Deserialize)]
pub struct Test {
a: i32,
b: i32,
}
#[wasm_bindgen_test]
async fn convert_json_string_message_to_struct() {
let test = Test { a: 1, b: 2 };
let json_string = serde_json::to_string(&test).unwrap();
let js_string = JsValue::from_str(&json_string);
let message_event = web_sys::MessageEvent::new("test-event").unwrap();
let ws_msg = WebSocketMessage {
data: js_string,
message_event,
};
let result_bytes = ws_msg.bytes().await.unwrap();
assert_eq!(json_string.as_bytes(), &*result_bytes);
assert_eq!(json_string, ws_msg.text().unwrap());
let result = ws_msg.json::<Test>().unwrap();
assert_eq!(result.a, 1);
assert_eq!(result.b, 2);
}
}
| raw_message |
Room.js | import React from "react"
import {Link} from "react-router-dom"
import defaultImg from "../images/room-1.jpeg"
import PropTypes from "prop-types"
export default function | ({room}){
const {name, slug, images, price}=room;
return (
<article className="room">
<div className="img-container">
<img src={images[0]||defaultImg} alt="single room" />
<div className="price-top">
<h6>${price}</h6>
<p>per night</p>
</div>
<Link to={`/rooms/${slug}`} className="btn-primary room-link">
features
</Link>
</div>
<p className="room-info">{name}</p>
</article>
)
}
Room.propTypes={
room:PropTypes.shape({
name: PropTypes.string.isRequired,
slug: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.string).isRequired,
price: PropTypes.number.isRequired
})
} | Room |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.